md: using GFP_NOIO to allocate bio for flush request
RFC 1/1 md: using GFP_NOIO to allocate bio for flush request
flush request is issued in transaction commit code path usually, so looks using GFP_KERNEL to allocate memory for flush request bio falls into the classic deadlock issue. dm already gets it right.
--- drivers/md/md.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/md.c +1 -1
@@ -450,7 +450,7 @@ static void submit_flushes(struct work_satomic_inc (&rdev->nr_pending);atomic_inc (&rdev->nr_pending);rcu_read_unlock (); - bi =bio_alloc_mddev (GFP_KERNEL ,0 , mddev); + bi =bio_alloc_mddev (GFP_NOIO ,0 , mddev); bi->bi_end_io = md_end_flush; bi->bi_private = rdev; bi->bi_bdev = rdev->bdev;
Quoted 5 lines · Shaohua Li
flush request is issued in transaction commit code path usually, so looks using
GFP_KERNELto allocate memory for flush request bio falls into the classic deadlock issue. dm already gets it right.
ping!
Quoted 18 lines
Signed-off-by Shaohua Li <[email protected]>--- drivers/md/md.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Index:
linux/drivers/md/md.c
===================================================================drivers/md/md.c +1
-1@@ -450,7 +450,7 @@ static void submit_flushes(struct work_satomic_inc (&rdev->nr_pending);atomic_inc (&rdev->nr_pending);rcu_read_unlock (); - bi =bio_alloc_mddev (GFP_KERNEL ,0 , mddev); + bi =bio_alloc_mddev (GFP_NOIO ,0 , mddev); bi->bi_end_io = md_end_flush; bi->bi_private = rdev; bi->bi_bdev = rdev->bdev;
Quoted 8 lines · Shaohua Li
Quoted 5 lines · Shaohua Li
flush request is issued in transaction commit code path usually, so looks using
GFP_KERNELto allocate memory for flush request bio falls into the classic deadlock issue. dm already gets it right.ping!
This one should probably also be queued for -stable right?
Quoted 11 lines · On Tue, 8 May 2012 12:31:18 -0700 Dan Williams <[email protected]> wrote:
Quoted 8 lines · Shaohua Li
Quoted 5 lines · Shaohua Li
flush request is issued in transaction commit code path usually, so looks using
GFP_KERNELto allocate memory for flush request bio falls into the classic deadlock issue. dm already gets it right.ping!
This one should probably also be queued for -stable right?
I suspect so.
I've edited the commit-log message slightly and added a 'cc' for stable, It is now in my for-next branch. I'll push to Linus next week.
Thanks Shaohua,
NeilBrown