]> git.baikalelectronics.ru Git - kernel.git/commit
mm: avoid calling pgdat_balanced() needlessly
authorZlatko Calusic <zlatko.calusic@iskon.hr>
Sat, 23 Feb 2013 00:32:34 +0000 (16:32 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 24 Feb 2013 01:50:10 +0000 (17:50 -0800)
commit6c8c3d6b330088f4cdbbe70e6eccade48947eb48
tree407a7710a7c4c6382bb9d415cd8de05430821600
parent78c12d1e8ef6337c055e922c0a03dc8ff0cd7609
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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/vmscan.c