The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH RESEND 0/2] KSM: use linear_page_index in collect_procs_ksm()
@ 2026-07-08  3:38 xu.xin16
  2026-07-08  4:19 ` [PATCH 1/2] mm/ksm: Initialize the addr only once in collect_procs_ksm xu.xin16
  2026-07-08  4:22 ` [PATCH RESEND 2/2] mm/ksm: Use precise linear_page_index instead of the whole address space xu.xin16
  0 siblings, 2 replies; 8+ messages in thread
From: xu.xin16 @ 2026-07-08  3:38 UTC (permalink / raw)
  To: akpm, david; +Cc: chengming.zhou, linux-mm, linux-kernel

From 65241f800da589be1981181d1bc3efd69a7d0385 Mon Sep 17 00:00:00 2001
From: xu xin <xu.xin16@zte.com.cn>
Date: Wed, 8 Jul 2026 11:13:47 +0800
Subject: [PATCH 0/2] KSM: use linear_page_index in collect_procs_ksm()

In collect_procs_ksm() which is used to collect processes when the error
hit an ksm page, there is the same issue with rmap_walk_ksm (see the
previous discussion at [1]). So we apply the similar logic changes to
the collect_procs_ksm().

The patch [1/2] move the initializaion of addr from the position inside
loop to the position before the loop, since the variable will not change
in the loop.

The patch [2/2] optimize collect_procs_ksm by passing a suitable page offset
range to the anon_vma_interval_tree_foreach loop to reduce ineffective
checks.

[1] https://lore.kernel.org/all/20260703162253688u8Str9eFLR8TGCmo7nIOF@zte.com.cn/

xu xin (2):
  mm/ksm: Initialize the addr only once in collect_procs_ksm
  mm/ksm: Use precise linear_page_index instead of the whole address
    space

 mm/ksm.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
2.25.1

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-07-09  8:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-08  3:38 [PATCH RESEND 0/2] KSM: use linear_page_index in collect_procs_ksm() xu.xin16
2026-07-08  4:19 ` [PATCH 1/2] mm/ksm: Initialize the addr only once in collect_procs_ksm xu.xin16
2026-07-08  7:50   ` David Hildenbrand (Arm)
2026-07-08  7:53   ` David Hildenbrand (Arm)
2026-07-08  4:22 ` [PATCH RESEND 2/2] mm/ksm: Use precise linear_page_index instead of the whole address space xu.xin16
2026-07-08  7:52   ` David Hildenbrand (Arm)
2026-07-09  3:10     ` xu.xin16
2026-07-09  8:53       ` David Hildenbrand (Arm)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox