Re: [PATCH] mm/memory-failure: Use a mutex to avoid memory_failure() races

2021-03-08 Thread Aili Yao
On Tue, 9 Mar 2021 06:04:41 + HORIGUCHI NAOYA(堀口 直也) wrote: > ... > > > > If others are OK with this method, then I am OK too. > > But I have two concerns, May you take into account: > > > > 1. The memory_failure with 0 return code for race condition, then the > > kill_me_maybe() goes into

Re: [PATCH] mm/memory-failure: Use a mutex to avoid memory_failure() races

2021-03-08 Thread 堀口 直也
On Tue, Mar 09, 2021 at 10:04:21AM +0800, Aili Yao wrote: > On Mon, 8 Mar 2021 14:55:04 -0800 > "Luck, Tony" wrote: > > > 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

Re: [PATCH] mm/memory-failure: Use a mutex to avoid memory_failure() races

2021-03-08 Thread Aili Yao
On Mon, 8 Mar 2021 14:55:04 -0800 "Luck, Tony" wrote: > 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 a

Re: [PATCH] mm/memory-failure: Use a mutex to avoid memory_failure() races

2021-03-08 Thread 堀口 直也
On Mon, Mar 08, 2021 at 02:55:04PM -0800, Luck, Tony wrote: > 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 mappin

[PATCH] mm/memory-failure: Use a mutex to avoid memory_failure() races

2021-03-08 Thread Luck, Tony
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