Commit 216c128a authored by Chris Li's avatar Chris Li Committed by Carlos Llamas
Browse files

FROMLIST: BACKPORT: mm: swap: mTHP allocate swap entries from nonfull list



Track the nonfull cluster as well as the empty cluster
on lists. Each order has one nonfull cluster list.

The cluster will remember which order it was used during
new cluster allocation.

When the cluster has free entry, add to the nonfull[order]
list.  When the free cluster list is empty, also allocate
from the nonempty list of that order.

This improves the mTHP swap allocation success rate.

There are limitations if the distribution of numbers of
different orders of mTHP changes a lot. e.g. there are a lot
of nonfull cluster assign to order A while later time there
are a lot of order B allocation while very little allocation
in order A. Currently the cluster used by order A will not
reused by order B unless the cluster is 100% empty.

Change-Id: Ice151dd9b69340b7bc1d24397f66c7c5f38246cd
Signed-off-by: default avatarChris Li <chrisl@kernel.org>
Link: https://lore.kernel.org/r/20240524-swap-allocator-v1-2-47861b423b26@kernel.org/


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