Commit 7cbe80f0 authored by Chris Li's avatar Chris Li Committed by Treehugger Robot
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.

Signed-off-by: default avatarChris Li <chrisl@kernel.org>
Link: https://lore.kernel.org/r/20240711-swap-allocator-v4-2-0295a4d4c7aa@kernel.org/


Bug: 313807618
Bug: 351082780
[ Fix trivial conflict in include/linux/swap.h swap_info_struct
    - Kalesh Singh
Signed-off-by: default avatarKalesh Singh <kaleshsingh@google.com>
Change-Id: I48cca8c1bb3d9061587f9217d72b55a6ba14adbd
parent 96836d4f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment