]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
mm: compaction: acquire the zone->lock as late as possible
authorMel Gorman <mgorman@suse.de>
Fri, 28 Sep 2012 00:19:46 +0000 (10:19 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 3 Oct 2012 06:49:32 +0000 (16:49 +1000)
commit67feb0689afc768962132761f3b8089e59a97fe2
tree7458d7bc677dd1af1a0380b10977fe08a92dda68
parent6bd0e0d0222a12cb8661b2e455aa4ff57bb933a3
mm: compaction: acquire the zone->lock as late as possible

Compaction's free scanner acquires the zone->lock when checking for
PageBuddy pages and isolating them.  It does this even if there are no
PageBuddy pages in the range.

This patch defers acquiring the zone lock for as long as possible.  In the
event there are no free pages in the pageblock then the lock will not be
acquired at all which reduces contention on zone->lock.

Signed-off-by: Mel Gorman <mgorman@suse.de>
Acked-by: Rik van Riel <riel@redhat.com>
Cc: Richard Davies <richard@arachsys.com>
Cc: Shaohua Li <shli@kernel.org>
Cc: Avi Kivity <avi@redhat.com>
Acked-by: Rafael Aquini <aquini@redhat.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/compaction.c