diff options
author | Fengguang Wu <wfg@mail.ustc.edu.cn> | 2007-10-17 02:30:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 11:43:02 -0400 |
commit | 369f2389e7d03022abdd25e298bffb9613cd0e54 (patch) | |
tree | 1071020428c8e3eaa88642682e234de95e7a77bc /mm/page-writeback.c | |
parent | 1c0eeaf5698597146ed9b873e2f9e0961edcf0f9 (diff) |
writeback: remove unnecessary wait in throttle_vm_writeout()
We don't want to introduce pointless delays in throttle_vm_writeout() when
the writeback limits are not yet exceeded, do we?
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Cc: Greg KH <greg@kroah.com>
Reviewed-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Fengguang Wu <wfg@mail.ustc.edu.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page-writeback.c')
-rw-r--r-- | mm/page-writeback.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c index d8c21e5a1bc9..7845462064f4 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c | |||
@@ -502,16 +502,6 @@ void throttle_vm_writeout(gfp_t gfp_mask) | |||
502 | long background_thresh; | 502 | long background_thresh; |
503 | long dirty_thresh; | 503 | long dirty_thresh; |
504 | 504 | ||
505 | if ((gfp_mask & (__GFP_FS|__GFP_IO)) != (__GFP_FS|__GFP_IO)) { | ||
506 | /* | ||
507 | * The caller might hold locks which can prevent IO completion | ||
508 | * or progress in the filesystem. So we cannot just sit here | ||
509 | * waiting for IO to complete. | ||
510 | */ | ||
511 | congestion_wait(WRITE, HZ/10); | ||
512 | return; | ||
513 | } | ||
514 | |||
515 | for ( ; ; ) { | 505 | for ( ; ; ) { |
516 | get_dirty_limits(&background_thresh, &dirty_thresh, NULL, NULL); | 506 | get_dirty_limits(&background_thresh, &dirty_thresh, NULL, NULL); |
517 | 507 | ||
@@ -525,6 +515,14 @@ void throttle_vm_writeout(gfp_t gfp_mask) | |||
525 | global_page_state(NR_WRITEBACK) <= dirty_thresh) | 515 | global_page_state(NR_WRITEBACK) <= dirty_thresh) |
526 | break; | 516 | break; |
527 | congestion_wait(WRITE, HZ/10); | 517 | congestion_wait(WRITE, HZ/10); |
518 | |||
519 | /* | ||
520 | * The caller might hold locks which can prevent IO completion | ||
521 | * or progress in the filesystem. So we cannot just sit here | ||
522 | * waiting for IO to complete. | ||
523 | */ | ||
524 | if ((gfp_mask & (__GFP_FS|__GFP_IO)) != (__GFP_FS|__GFP_IO)) | ||
525 | break; | ||
528 | } | 526 | } |
529 | } | 527 | } |
530 | 528 | ||