]> Git Repo - linux.git/commit
mm, compaction: do not recheck suitable_migration_target under lock
authorVlastimil Babka <[email protected]>
Thu, 9 Oct 2014 22:27:07 +0000 (15:27 -0700)
committerLinus Torvalds <[email protected]>
Fri, 10 Oct 2014 02:25:54 +0000 (22:25 -0400)
commitf8224aa5a0a4627926019bba7511926393fbee3b
treeca92929dcf6b8d84382a9e2ccbe3ed2eb7800b25
parent98dd3b48a7b8e8277f14c2b7d879477efc1ed0d0
mm, compaction: do not recheck suitable_migration_target under lock

isolate_freepages_block() rechecks if the pageblock is suitable to be a
target for migration after it has taken the zone->lock.  However, the
check has been optimized to occur only once per pageblock, and
compact_checklock_irqsave() might be dropping and reacquiring lock, which
means somebody else might have changed the pageblock's migratetype
meanwhile.

Furthermore, nothing prevents the migratetype to change right after
isolate_freepages_block() has finished isolating.  Given how imperfect
this is, it's simpler to just rely on the check done in
isolate_freepages() without lock, and not pretend that the recheck under
lock guarantees anything.  It is just a heuristic after all.

Signed-off-by: Vlastimil Babka <[email protected]>
Reviewed-by: Zhang Yanfei <[email protected]>
Acked-by: Minchan Kim <[email protected]>
Acked-by: Mel Gorman <[email protected]>
Cc: Joonsoo Kim <[email protected]>
Cc: Michal Nazarewicz <[email protected]>
Cc: Naoya Horiguchi <[email protected]>
Cc: Christoph Lameter <[email protected]>
Cc: Rik van Riel <[email protected]>
Acked-by: David Rientjes <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/compaction.c
This page took 0.052604 seconds and 4 git commands to generate.