Commit 066872d1 authored by Yu Zhao's avatar Yu Zhao Committed by Carlos Llamas
Browse files

FROMLIST: BACKPORT: THP shattering: the reverse of collapsing

In contrast to split, shatter migrates occupied pages in a partially
mapped THP to a bunch of base folios. IOW, unlike split done in place,
shatter is the exact opposite of collapse.

The advantage of shattering is that it keeps the original THP intact.
The cost of copying during the migration is not a side effect, but
rather by design, since splitting is considered a discouraged
behavior. In retail terms, the return of a purchase is charged with a
restocking fee and the original goods can be resold.

THPs from ZONE_NOMERGE can only be shattered, since they cannot be
split or merged. THPs from ZONE_NOSPLIT can be shattered or split (the
latter requires [1]), if they are above the minimum order.

[1] https://lore.kernel.org/20240226205534.1603748-1-zi.yan@sent.com/



Change-Id: I7637124bb1ede775dba7b1d363d53256f337851f
Signed-off-by: default avatarYu Zhao <yuzhao@google.com>
Link: https://lore.kernel.org/r/20240229183436.4110845-3-yuzhao@google.com/


Bug: 313807618
Signed-off-by: default avatarKalesh Singh <kaleshsingh@google.com>
parent c1ff6dcf
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment