lkml.org 
[lkml]   [2022]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH -next v2] mm: hwposion: support recovery from ksm_might_need_to_copy()
From

On 2022/12/12 10:36, Miaohe Lin wrote:
> On 2022/12/9 15:28, Kefeng Wang wrote:
>> When the kernel copy a page from ksm_might_need_to_copy(), but runs
>> into an uncorrectable error, it will crash since poisoned page is
>> consumed by kernel, this is similar to Copy-on-write poison recovery,
>> When an error is detected during the page copy, return VM_FAULT_HWPOISON,
>> which help us to avoid system crash. Note, memory failure on a KSM
>> page will be skipped, but still call memory_failure_queue() to be
>> consistent with general memory failure process.
...
>
> diff --git a/mm/swapfile.c b/mm/swapfile.c
> index 908a529bca12..d479811bc311 100644
> --- a/mm/swapfile.c
> +++ b/mm/swapfile.c
> @@ -1767,7 +1767,7 @@ static int unuse_pte(struct vm_area_struct *vma, pmd_t *pmd,
>
> swapcache = page;
> page = ksm_might_need_to_copy(page, vma, addr);
> - if (unlikely(!page))
> + if (IS_ERR_OR_NULL(page))
> IMHO, it might be better to install a hwpoison entry here. Or later swapoff ops will trigger
> the uncorrectable error again?
Thanks for you suggestion, will do in v3.
> Thanks,
> Miaohe Lin
>

\
 
 \ /
  Last update: 2022-12-12 12:45    [W:0.055 / U:0.640 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site