]> 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>
Wed, 26 Sep 2012 01:33:50 +0000 (11:33 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 27 Sep 2012 07:26:50 +0000 (17:26 +1000)
commit2b6a5e8652784290241e92e2075c792a84d98084
tree028e128e88e112888022602aba90371dcbef14eb
parent455e0bcb1db3fc5058084e3f705cf4f1618fa784
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