Commit 25d19d4c authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] reduced context switch rate in writeback

pdflush writes back chunks of ~1000 pages.  It currently takes a short
nap if it writes back no pages at all.  That could cause it to write
back lots of small batches of pages, as it bounces against a congested
queue.

Change it to sleep if it failed to write back the entire batch against
a congested queue.  Ths reduces the context switch rate a little.

The context switch rate is still fairly high (150/sec) - this appears
to be due to add_disk_randomness() scheduling a work function.
parent 8b1f287b
......@@ -229,8 +229,8 @@ static void background_writeout(unsigned long _min_pages)
wbc.nr_to_write = MAX_WRITEBACK_PAGES;
writeback_inodes(&wbc);
min_pages -= MAX_WRITEBACK_PAGES - wbc.nr_to_write;
if (wbc.nr_to_write == MAX_WRITEBACK_PAGES) {
/* Wrote nothing */
if (wbc.nr_to_write > 0) {
/* Wrote less than expected */
if (wbc.encountered_congestion)
blk_congestion_wait(WRITE, HZ/10);
else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment