]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm: avoid calling pgdat_balanced() needlessly
authorZlatko Calusic <zlatko.calusic@iskon.hr>
Wed, 20 Feb 2013 02:14:06 +0000 (13:14 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 20 Feb 2013 05:52:24 +0000 (16:52 +1100)
commitaae90f88e60567121de9896510a80e8b4599f4cf
tree5645bf482e641e6af237a8e7a86137beb928d840
parentd74c2cc4029a6f4f0a66864b41ff3523d9661807
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