Commit 87c6a9b253520b66e7f5e8f67a37a701eaa51cee
1 parent
3542a5c0de
Exists in
master
and in
20 other branches
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>
Showing 1 changed file with 10 additions and 1 deletions Side-by-side Diff
mm/page-writeback.c
... | ... | @@ -485,6 +485,7 @@ |
485 | 485 | unsigned long bdi_thresh; |
486 | 486 | unsigned long pages_written = 0; |
487 | 487 | unsigned long write_chunk = sync_writeback_pages(); |
488 | + unsigned long pause = 1; | |
488 | 489 | |
489 | 490 | struct backing_dev_info *bdi = mapping->backing_dev_info; |
490 | 491 | |
... | ... | @@ -561,7 +562,15 @@ |
561 | 562 | if (pages_written >= write_chunk) |
562 | 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 | 576 | if (bdi_nr_reclaimable + bdi_nr_writeback < bdi_thresh && |