]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm: compaction: abort compaction loop if lock is contended or run too long
authorShaohua Li <shli@kernel.org>
Fri, 21 Sep 2012 01:00:24 +0000 (11:00 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 21 Sep 2012 05:58:55 +0000 (15:58 +1000)
commit853b4c278cd18b4bcf3971bf795e59599a62e823
tree6a6a167337fb34620ba5f978fb8961648d66ee14
parent96f0ea9f848376705a203dda44dfac74b42b4198
mm: compaction: abort compaction loop if lock is contended or run too long

isolate_migratepages_range() might isolate no pages if for example when
zone->lru_lock is contended and running asynchronous compaction. In this
case, we should abort compaction, otherwise, compact_zone will run a
useless loop and make zone->lru_lock is even contended.

An additional check is added to ensure that cc.migratepages and
cc.freepages get properly drained whan compaction is aborted.

[minchan@kernel.org: Putback pages isolated for migration if aborting]
[akpm@linux-foundation.org: compact_zone_order requires non-NULL arg contended]
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Shaohua Li <shli@fusionio.com>
Signed-off-by: Mel Gorman <mgorman@suse.de>
Cc: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/compaction.c
mm/internal.h