]> git.karo-electronics.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>
Tue, 9 Oct 2012 03:12:33 +0000 (14:12 +1100)
commit365b7b224af4903cdf3ed3764fc78ae1de51ba7e
tree4c80ad1d7164b6b8c4dd0b9834c6b9fc0cfcd5a3
parent02577bcc6818cd420154f36b798c1cfb5ded00bb
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