diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2009-09-17 13:59:14 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-09-21 09:40:33 -0400 |
commit | 87c6a9b253520b66e7f5e8f67a37a701eaa51cee (patch) | |
tree | a3778632eabc961ce3b8c32ecfeeb48383cf78e0 /mm/page-writeback.c | |
parent | 3542a5c0de3d5b33227214a692bf9b12e249078e (diff) |
writeback: make balance_dirty_pages() gradually back more off
Currently it just sleeps for a very short time, just 1 jiffy. If
we keep looping in there, continually delay for a little longer
of up to 100msec in total. That was the old limit for congestion
wait.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'mm/page-writeback.c')
-rw-r--r-- | mm/page-writeback.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 2585349469e0..d1ba46441053 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c | |||
@@ -485,6 +485,7 @@ static void balance_dirty_pages(struct address_space *mapping) | |||
485 | unsigned long bdi_thresh; | 485 | unsigned long bdi_thresh; |
486 | unsigned long pages_written = 0; | 486 | unsigned long pages_written = 0; |
487 | unsigned long write_chunk = sync_writeback_pages(); | 487 | unsigned long write_chunk = sync_writeback_pages(); |
488 | unsigned long pause = 1; | ||
488 | 489 | ||
489 | struct backing_dev_info *bdi = mapping->backing_dev_info; | 490 | struct backing_dev_info *bdi = mapping->backing_dev_info; |
490 | 491 | ||
@@ -561,7 +562,15 @@ static void balance_dirty_pages(struct address_space *mapping) | |||
561 | if (pages_written >= write_chunk) | 562 | if (pages_written >= write_chunk) |
562 | break; /* We've done our duty */ | 563 | break; /* We've done our duty */ |
563 | 564 | ||
564 | schedule_timeout_interruptible(1); | 565 | schedule_timeout_interruptible(pause); |
566 | |||
567 | /* | ||
568 | * Increase the delay for each loop, up to our previous | ||
569 | * default of taking a 100ms nap. | ||
570 | */ | ||
571 | pause <<= 1; | ||
572 | if (pause > HZ / 10) | ||
573 | pause = HZ / 10; | ||
565 | } | 574 | } |
566 | 575 | ||
567 | if (bdi_nr_reclaimable + bdi_nr_writeback < bdi_thresh && | 576 | if (bdi_nr_reclaimable + bdi_nr_writeback < bdi_thresh && |