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

Kirill Tkhai ktkhai at virtuozzo.com
Tue Sep 21 18:13:34 MSK 2021


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