linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] mm: ksm: support hwpoison for ksm page
@ 2023-03-30  7:44 Longlong Xia
  2023-03-30  7:45 ` [PATCH 1/2] mm: memory-failure: Refactor add_to_kill() Longlong Xia
  2023-03-30  7:45 ` [PATCH 2/2] mm: ksm: Support hwpoison for ksm page Longlong Xia
  0 siblings, 2 replies; 11+ messages in thread
From: Longlong Xia @ 2023-03-30  7:44 UTC (permalink / raw)
  To: akpm, naoya.horiguchi
  Cc: linmiaohe, wangkefeng.wang, sunnanyong, linux-kernel, linux-mm,
	Longlong Xia

Currently, ksm does not support hwpoison. As ksm is being used more widely
for deduplication at the system level, container level, and process level, 
supporting hwpoison for ksm has become increasingly important. However, ksm
pages were not processed by hwpoison in 2009 [1].

The main method of implementation:
1. Refactor add_to_kill() and add new add_to_kill_*() to better accommodate
the handling of different types of pages.
2. Add collect_procs_ksm() to collect processes when the error hit an ksm 
page.
3. Add task_in_to_kill_list() to avoid duplicate addition of tsk to the 
to_kill list. 
4. Try_to_unmap ksm page (already supported).
5. Handle related processes such as sending SIGBUS.

Tested with poisoning to ksm page from
1) different process
2) one process

and with/without memory_failure_early_kill set, the processes
are killed as expected with the patchset. 

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
commit/?h=01e00f880ca700376e1845cf7a2524ebe68e47d6

Longlong Xia (2):
  mm: memory-failure: Refactor add_to_kill()
  mm: ksm: Support hwpoison for ksm page

 include/linux/ksm.h | 11 ++++++++
 include/linux/mm.h  |  7 +++++
 mm/ksm.c            | 45 ++++++++++++++++++++++++++++++++
 mm/memory-failure.c | 63 +++++++++++++++++++++++++++++++++------------
 4 files changed, 109 insertions(+), 17 deletions(-)

-- 
2.25.1



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

end of thread, other threads:[~2023-04-13  9:30 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-30  7:44 [PATCH 0/2] mm: ksm: support hwpoison for ksm page Longlong Xia
2023-03-30  7:45 ` [PATCH 1/2] mm: memory-failure: Refactor add_to_kill() Longlong Xia
2023-03-31  5:41   ` HORIGUCHI NAOYA(堀口 直也)
2023-04-04 10:36     ` xialonglong
2023-04-13  9:26     ` Kefeng Wang
2023-03-30  7:45 ` [PATCH 2/2] mm: ksm: Support hwpoison for ksm page Longlong Xia
2023-03-31  5:42   ` HORIGUCHI NAOYA(堀口 直也)
2023-04-04 10:42     ` xialonglong
2023-04-13  8:00     ` xialonglong
2023-04-13  9:13       ` HORIGUCHI NAOYA(堀口 直也)
2023-04-13  9:30   ` Kefeng Wang

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