]> Git Repo - linux.git/commitdiff
writeback: remove unnecessary wait in throttle_vm_writeout()
authorFengguang Wu <[email protected]>
Wed, 17 Oct 2007 06:30:45 +0000 (23:30 -0700)
committerLinus Torvalds <[email protected]>
Wed, 17 Oct 2007 15:43:02 +0000 (08:43 -0700)
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 <[email protected]>
Cc: OGAWA Hirofumi <[email protected]>
Cc: Kumar Gala <[email protected]>
Cc: Pete Zaitcev <[email protected]>
Cc: Greg KH <[email protected]>
Reviewed-by: Rik van Riel <[email protected]>
Signed-off-by: Fengguang Wu <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/page-writeback.c

index d8c21e5a1bc9430fd7cd35681136911da696cedb..7845462064f4c13457528852c09e5db9e770596b 100644 (file)
@@ -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;
         }
 }
 
This page took 0.05134 seconds and 4 git commands to generate.