]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm: avoid calling pgdat_balanced() needlessly
authorZlatko Calusic <zlatko.calusic@iskon.hr>
Thu, 7 Feb 2013 01:26:17 +0000 (12:26 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 18 Feb 2013 05:46:20 +0000 (16:46 +1100)
commit5fb17b918367bef8e4cbb9b6bb909e90f711fb1a
tree3a9f35b788d81e21d229f728f8367d7460acea42
parente28f57fc329cee6986e96190fbc09a86d3c3c017
mm: avoid calling pgdat_balanced() needlessly

Now that balance_pgdat() is slightly tidied up, thanks to more capable
pgdat_balanced(), it's become obvious that pgdat_balanced() is called to
check the status, then break the loop if pgdat is balanced, just to be
immediately called again.  The second call is completely unnecessary, of
course.

The patch introduces pgdat_is_balanced boolean, which helps resolve the
above suboptimal behavior, with the added benefit of slightly better
documenting one other place in the function where we jump and skip lots of
code.

Signed-off-by: Zlatko Calusic <zlatko.calusic@iskon.hr>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Hugh Dickins <hughd@google.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/vmscan.c