All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] writeback: remove unnecessary wait in throttle_vm_writeout()
@ 2007-09-27  1:50 ` Fengguang Wu
  2007-09-27 15:16   ` Rik van Riel
                     ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Fengguang Wu @ 2007-09-27  1:50 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Nick Piggin, OGAWA Hirofumi, Kumar Gala, Pete Zaitcev, Greg KH,
	Linux Kernel

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>
Signed-off-by: Fengguang Wu <wfg@mail.ustc.edu.cn>
---
 mm/page-writeback.c |   18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

--- linux-2.6.23-rc8-mm1.orig/mm/page-writeback.c
+++ linux-2.6.23-rc8-mm1/mm/page-writeback.c
@@ -507,16 +507,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);
 
@@ -530,6 +520,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;
         }
 }
 


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2007-09-29 12:56 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-27  1:50 [PATCH] writeback: remove unnecessary wait in throttle_vm_writeout() Fengguang Wu
2007-09-27  1:50 ` Fengguang Wu
2007-09-27 15:16   ` Rik van Riel
2007-09-28  1:18     ` Fengguang Wu
2007-09-28  1:18       ` Fengguang Wu
2007-09-27 20:47   ` Andrew Morton
2007-09-28  8:02     ` Ingo Molnar
2007-09-27 22:59       ` Nick Piggin
2007-09-28 16:23       ` Mathieu Desnoyers
2007-09-28  0:10         ` Nick Piggin
2007-09-28 17:57           ` Mathieu Desnoyers
2007-09-28 19:50             ` Frank Ch. Eigler
2007-09-28 20:25             ` Nick Piggin
2007-09-27 21:49   ` Nick Piggin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.