diff options
author | 2024-06-21 15:54:31 +0800 | |
---|---|---|
committer | 2024-07-04 18:05:51 -0700 | |
commit | a0b856b617c585b86a077aae5176c946e1462b7d (patch) | |
tree | f34a2a729e3e0c741243dd9ec4821b5fcff7a997 /include/linux/compiler_types.h | |
parent | mm/ksm: don't waste time searching stable tree for fast changing page (diff) | |
download | linux-rng-a0b856b617c585b86a077aae5176c946e1462b7d.tar.xz linux-rng-a0b856b617c585b86a077aae5176c946e1462b7d.zip |
mm/ksm: optimize the chain()/chain_prune() interfaces
Now the implementation of stable_node_dup() causes chain()/chain_prune()
interfaces and usages are overcomplicated.
Why? stable_node_dup() only find and return a candidate stable_node for
sharing, so the users have to recheck using stable_node_dup_any() if any
non-candidate stable_node exist. And try to ksm_get_folio() from it
again.
Actually, stable_node_dup() can just return a best stable_node as it can,
then the users can check if it's a candidate for sharing or not.
The code is simplified too and fewer corner cases: such as stable_node and
stable_node_dup can't be NULL if returned tree_folio is not NULL.
Link: https://lkml.kernel.org/r/20240621-b4-ksm-scan-optimize-v2-3-1c328aa9e30b@linux.dev
Signed-off-by: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Stefan Roesch <shr@devkernel.io>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/linux/compiler_types.h')
0 files changed, 0 insertions, 0 deletions