]> 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, 28 Sep 2012 00:19:44 +0000 (10:19 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 4 Oct 2012 05:03:28 +0000 (15:03 +1000)
commit544eec35ae51ac5672eceacd41e749dec0ce116a
tree62a3bbb3d317c90b9baf8d6d78010346d4a285c5
parentc100a1f4aeb63d1d014910884159b959671a613d
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>
Acked-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/compaction.c
mm/internal.h