]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm: do not sleep in balance_pgdat if there's no i/o congestion
authorZlatko Calusic <zlatko.calusic@iskon.hr>
Wed, 19 Dec 2012 23:25:13 +0000 (00:25 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 20 Dec 2012 15:06:56 +0000 (07:06 -0800)
commitcda73a10eb3f493871ed39f468db50a65ebeddce
treefe486de989b58130ba20d534606f1091e367c8ec
parentf01af9f85855e38fbd601e033a8eac204cc4cc1c
mm: do not sleep in balance_pgdat if there's no i/o congestion

On a 4GB RAM machine, where Normal zone is much smaller than DMA32 zone,
the Normal zone gets fragmented in time.  This requires relatively more
pressure in balance_pgdat to get the zone above the required watermark.
Unfortunately, the congestion_wait() call in there slows it down for a
completely wrong reason, expecting that there's a lot of
writeback/swapout, even when there's none (much more common).  After a
few days, when fragmentation progresses, this flawed logic translates to
a very high CPU iowait times, even though there's no I/O congestion at
all.  If THP is enabled, the problem occurs sooner, but I was able to
see it even on !THP kernels, just by giving it a bit more time to occur.

The proper way to deal with this is to not wait, unless there's
congestion.  Thanks to Mel Gorman, we already have the function that
perfectly fits the job.  The patch was tested on a machine which nicely
revealed the problem after only 1 day of uptime, and it's been working
great.

Signed-off-by: Zlatko Calusic <zlatko.calusic@iskon.hr>
Acked-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/vmscan.c