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

From: xu xin <xu.xin16@zte.com.cn>

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
  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] 5+ messages in thread

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

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-09  9:31 [PATCH v2 0/2] KSM: use linear_page_index in collect_procs_ksm() xu.xin16
2026-07-09  9:32 ` [PATCH v2 1/2] mm/ksm: Initialize the addr only once in collect_procs_ksm xu.xin16
2026-07-09  9:58   ` David Hildenbrand (Arm)
2026-07-09  9:33 ` [PATCH v2 2/2] ksm: Use precise linear_page_index instead of the whole address space xu.xin16
2026-07-09  9:59   ` 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