Skip to content

Commit

Permalink
writeback: remove unnecessary wait in throttle_vm_writeout()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Fengguang Wu authored and Linus Torvalds committed Oct 17, 2007
1 parent 1c0eeaf commit 369f238
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions mm/page-writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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;
}
}

Expand Down

0 comments on commit 369f238

Please sign in to comment.