]> Git Repo - linux.git/commit
mm: __isolate_lru_page_prepare() in isolate_migratepages_block()
authorHugh Dickins <[email protected]>
Tue, 22 Mar 2022 21:45:41 +0000 (14:45 -0700)
committerLinus Torvalds <[email protected]>
Tue, 22 Mar 2022 22:57:08 +0000 (15:57 -0700)
commit89f6c88a6ab4a11deb14c270f7f1454cda4f73d6
tree4a40f99297ee704712574a369bc262858f719d53
parentb698f0a1773f7df73f2bb4bfe0e597ea1bb3881f
mm: __isolate_lru_page_prepare() in isolate_migratepages_block()

__isolate_lru_page_prepare() conflates two unrelated functions, with the
flags to one disjoint from the flags to the other; and hides some of the
important checks outside of isolate_migratepages_block(), where the
sequence is better to be visible.  It comes from the days of lumpy
reclaim, before compaction, when the combination made more sense.

Move what's needed by mm/compaction.c isolate_migratepages_block() inline
there, and what's needed by mm/vmscan.c isolate_lru_pages() inline there.

Shorten "isolate_mode" to "mode", so the sequence of conditions is easier
to read.  Declare a "mapping" variable, to save one call to page_mapping()
(but not another: calling again after page is locked is necessary).
Simplify isolate_lru_pages() with a "move_to" list pointer.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Hugh Dickins <[email protected]>
Acked-by: David Rientjes <[email protected]>
Reviewed-by: Alex Shi <[email protected]>
Cc: Alexander Duyck <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/swap.h
mm/compaction.c
mm/vmscan.c
This page took 0.059816 seconds and 4 git commands to generate.