mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
HWPOISON: Use bitmask/action code for try_to_unmap behaviour
try_to_unmap currently has multiple modi (migration, munlock, normal unmap) which are selected by magic flag variables. The logic is not very straight forward, because each of these flag change multiple behaviours (e.g. migration turns off aging, not only sets up migration ptes etc.) Also the different flags interact in magic ways. A later patch in this series adds another mode to try_to_unmap, so this becomes quickly unmanageable. Replace the different flags with a action code (migration, munlock, munmap) and some additional flags as modifiers (ignore mlock, ignore aging). This makes the logic more straight forward and allows easier extension to new behaviours. Change all the caller to declare what they want to do. This patch is supposed to be a nop in behaviour. If anyone can prove it is not that would be a bug. Cc: [email protected] Cc: [email protected] Signed-off-by: Andi Kleen <[email protected]>
This commit is contained in:
parent
a6e04aa929
commit
14fa31b89c
4 changed files with 36 additions and 21 deletions
|
|
@ -669,7 +669,7 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
|
|||
}
|
||||
|
||||
/* Establish migration ptes or remove ptes */
|
||||
try_to_unmap(page, 1);
|
||||
try_to_unmap(page, TTU_MIGRATION|TTU_IGNORE_MLOCK|TTU_IGNORE_ACCESS);
|
||||
|
||||
if (!page_mapped(page))
|
||||
rc = move_to_new_page(newpage, page);
|
||||
|
|
|
|||
Loading…
Reference in a new issue