From 03801be3ae06713dccf2c31e0b940e9b9c55c7c1 Mon Sep 17 00:00:00 2001 From: Fengguang Wu Date: Tue, 16 Oct 2007 23:30:45 -0700 Subject: [PATCH] --- yaml --- r: 70737 b: refs/heads/master c: 369f2389e7d03022abdd25e298bffb9613cd0e54 h: refs/heads/master i: 70735: c33e5593ad9aeb60f8108baf426ead425e5ecef4 v: v3 --- [refs] | 2 +- trunk/mm/page-writeback.c | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index 1efbaff8d96f..28ec4056a028 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1c0eeaf5698597146ed9b873e2f9e0961edcf0f9 +refs/heads/master: 369f2389e7d03022abdd25e298bffb9613cd0e54 diff --git a/trunk/mm/page-writeback.c b/trunk/mm/page-writeback.c index d8c21e5a1bc9..7845462064f4 100644 --- a/trunk/mm/page-writeback.c +++ b/trunk/mm/page-writeback.c @@ -502,16 +502,6 @@ void throttle_vm_writeout(gfp_t gfp_mask) long background_thresh; long dirty_thresh; - if ((gfp_mask & (__GFP_FS|__GFP_IO)) != (__GFP_FS|__GFP_IO)) { - /* - * The caller might hold locks which can prevent IO completion - * or progress in the filesystem. So we cannot just sit here - * waiting for IO to complete. - */ - congestion_wait(WRITE, HZ/10); - return; - } - for ( ; ; ) { get_dirty_limits(&background_thresh, &dirty_thresh, NULL, NULL); @@ -525,6 +515,14 @@ void throttle_vm_writeout(gfp_t gfp_mask) global_page_state(NR_WRITEBACK) <= dirty_thresh) break; congestion_wait(WRITE, HZ/10); + + /* + * The caller might hold locks which can prevent IO completion + * or progress in the filesystem. So we cannot just sit here + * waiting for IO to complete. + */ + if ((gfp_mask & (__GFP_FS|__GFP_IO)) != (__GFP_FS|__GFP_IO)) + break; } }