lkml.org 
[lkml]   [2021]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 1/2] mm/memory-failure: Use a mutex to avoid memory_failure() races
On Tue, 27 Apr 2021 15:29:52 +0900
Naoya Horiguchi <nao.horiguchi@gmail.com> wrote:

> From: Tony Luck <tony.luck@intel.com>
>
> There can be races when multiple CPUs consume poison from the same
> page. The first into memory_failure() atomically sets the HWPoison
> page flag and begins hunting for tasks that map this page. Eventually
> it invalidates those mappings and may send a SIGBUS to the affected
> tasks.
>
> But while all that work is going on, other CPUs see a "success"
> return code from memory_failure() and so they believe the error
> has been handled and continue executing.
>
> Fix by wrapping most of the internal parts of memory_failure() in
> a mutex.
>
> Signed-off-by: Tony Luck <tony.luck@intel.com>
> Signed-off-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
> Reviewed-by: Borislav Petkov <bp@suse.de>

Sorry to interrupt, I just thought one thing:

This mutex seems not been bind to the error page, will there be some core case
like test code or multi-poison case whick will break this mutex?

Thanks!
Aili Yao

\
 
 \ /
  Last update: 2021-05-06 11:39    [W:0.083 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site