Re: [PATCH v2 02/11] mm/memory-failure: Pass addr to __add_to_kill()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/8/2024 12:42 PM, Matthew Wilcox (Oracle) wrote:

Handle anon/file folios the same way as KSM & DAX folios by passing in
the address.

Cc: Longlong Xia <xialonglong1@xxxxxxxxxx>
Acked-by: Miaohe Lin <linmiaohe@xxxxxxxxxx>
Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>
---
  mm/memory-failure.c | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 34b3c8255c9b..f94d85075ec1 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -431,7 +431,7 @@ static void __add_to_kill(struct task_struct *tsk, struct page *p,
  		return;
  	}
- tk->addr = addr ? addr : page_address_in_vma(p, vma);
+	tk->addr = addr;
  	if (is_zone_device_page(p))
  		tk->size_shift = dev_pagemap_mapping_shift(vma, tk->addr);
  	else
@@ -464,7 +464,8 @@ static void add_to_kill_anon_file(struct task_struct *tsk, struct page *p,
  				  struct vm_area_struct *vma,
  				  struct list_head *to_kill)
  {
-	__add_to_kill(tsk, p, vma, to_kill, 0);
+	unsigned long addr = page_address_in_vma(p, vma);
+	__add_to_kill(tsk, p, vma, to_kill, addr);
  }
#ifdef CONFIG_KSM
@@ -480,6 +481,7 @@ static bool task_in_to_kill_list(struct list_head *to_kill,
return false;
  }
+
  void add_to_kill_ksm(struct task_struct *tsk, struct page *p,
  		     struct vm_area_struct *vma, struct list_head *to_kill,
  		     unsigned long addr)

Looks good.

Reviewed-by: Jane Chu <jane.chu@xxxxxxxxxx>

-jane





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux