[Devel] [PATCH RHEL COMMIT] dm-ploop: Set PF_LOCAL_THROTTLE and PF_MEMALLOC_NOIO

Konstantin Khorenko khorenko at virtuozzo.com
Wed Sep 22 14:44:54 MSK 2021


The commit is pushed to "branch-rh9-5.14.vz9.1.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after ark-5.14
------>
commit b9eba5f085230415beb4322aaa7bba0afe2098b2
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Wed Sep 22 14:44:53 2021 +0300

    dm-ploop: Set PF_LOCAL_THROTTLE and PF_MEMALLOC_NOIO
    
    Set PF_LOCAL_THROTTLE since we're loopback driver.
    Set PF_MEMALLOC_NOIO to inherit GFP_NOIO on mem alloc.
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 drivers/md/dm-ploop-map.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c
index 16c70ec6901c..e3cf0ab73c98 100644
--- a/drivers/md/dm-ploop-map.c
+++ b/drivers/md/dm-ploop-map.c
@@ -1791,9 +1791,9 @@ void do_ploop_work(struct work_struct *ws)
 	LIST_HEAD(discard_pios);
 	LIST_HEAD(cow_pios);
 	LIST_HEAD(resubmit_pios);
-	unsigned int pf_io_thread = (current->flags & PF_IO_THREAD);
+	unsigned int old_flags = current->flags;
 
-	current->flags |= PF_IO_THREAD;
+	current->flags |= PF_IO_THREAD|PF_LOCAL_THROTTLE|PF_MEMALLOC_NOIO;
 
 	spin_lock_irq(&ploop->deferred_lock);
 	list_splice_init(&ploop->pios[PLOOP_LIST_PREPARE], &embedded_pios);
@@ -1812,7 +1812,7 @@ void do_ploop_work(struct work_struct *ws)
 
 	submit_metadata_writeback(ploop);
 
-	current->flags = (current->flags & ~PF_IO_THREAD) | pf_io_thread;
+	current->flags = old_flags;
 }
 
 void do_ploop_fsync_work(struct work_struct *ws)


More information about the Devel mailing list