[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210526094722.GA1656@linux>
Date: Wed, 26 May 2021 11:47:27 +0200
From: Oscar Salvador <osalvador@...e.de>
To: Naoya Horiguchi <nao.horiguchi@...il.com>
Cc: linux-mm@...ck.org, Tony Luck <tony.luck@...el.com>,
Aili Yao <yaoaili@...gsoft.com>,
Andrew Morton <akpm@...ux-foundation.org>,
David Hildenbrand <david@...hat.com>,
Borislav Petkov <bp@...en8.de>,
Andy Lutomirski <luto@...nel.org>,
Naoya Horiguchi <naoya.horiguchi@....com>,
Jue Wang <juew@...gle.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 1/3] mm/memory-failure: Use a mutex to avoid
memory_failure() races
On Fri, May 21, 2021 at 12:01:54PM +0900, Naoya Horiguchi wrote:
> From: Tony Luck <tony.luck@...el.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@...el.com>
> Signed-off-by: Naoya Horiguchi <naoya.horiguchi@....com>
> Reviewed-by: Borislav Petkov <bp@...e.de>
Reviewed-by: Oscar Salvador <osalvador@...e.de>
--
Oscar Salvador
SUSE L3
Powered by blists - more mailing lists