Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Fengguang Wu and committed by
Linus Torvalds
369f2389 1c0eeaf5

+8 -10
+8 -10
mm/page-writeback.c
··· 502 502 long background_thresh; 503 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 505 for ( ; ; ) { 516 506 get_dirty_limits(&background_thresh, &dirty_thresh, NULL, NULL); 517 507 ··· 515 525 global_page_state(NR_WRITEBACK) <= dirty_thresh) 516 526 break; 517 527 congestion_wait(WRITE, HZ/10); 528 + 529 + /* 530 + * The caller might hold locks which can prevent IO completion 531 + * or progress in the filesystem. So we cannot just sit here 532 + * waiting for IO to complete. 533 + */ 534 + if ((gfp_mask & (__GFP_FS|__GFP_IO)) != (__GFP_FS|__GFP_IO)) 535 + break; 518 536 } 519 537 } 520 538