Re: [PATCH v2 1/2] mm: fix race on soft-offlining free huge pages

2018-07-19 Thread Michal Hocko
On Thu 19-07-18 09:22:47, Naoya Horiguchi wrote: > On Thu, Jul 19, 2018 at 10:27:43AM +0200, Michal Hocko wrote: > > On Thu 19-07-18 08:08:05, Naoya Horiguchi wrote: > > > On Thu, Jul 19, 2018 at 09:15:16AM +0200, Michal Hocko wrote: > > > > On Thu 19-07-18 06:19:45, Naoya Horiguchi wrote: > > > >

Re: [PATCH v2 1/2] mm: fix race on soft-offlining free huge pages

2018-07-19 Thread Naoya Horiguchi
On Thu, Jul 19, 2018 at 10:27:43AM +0200, Michal Hocko wrote: > On Thu 19-07-18 08:08:05, Naoya Horiguchi wrote: > > On Thu, Jul 19, 2018 at 09:15:16AM +0200, Michal Hocko wrote: > > > On Thu 19-07-18 06:19:45, Naoya Horiguchi wrote: > > > > On Wed, Jul 18, 2018 at 10:50:32AM +0200, Michal Hocko wr

Re: [PATCH v2 1/2] mm: fix race on soft-offlining free huge pages

2018-07-19 Thread Michal Hocko
On Thu 19-07-18 08:08:05, Naoya Horiguchi wrote: > On Thu, Jul 19, 2018 at 09:15:16AM +0200, Michal Hocko wrote: > > On Thu 19-07-18 06:19:45, Naoya Horiguchi wrote: > > > On Wed, Jul 18, 2018 at 10:50:32AM +0200, Michal Hocko wrote: [...] > > > > Why do we even need HWPoison flag here? Everything

Re: [PATCH v2 1/2] mm: fix race on soft-offlining free huge pages

2018-07-19 Thread Naoya Horiguchi
On Thu, Jul 19, 2018 at 09:15:16AM +0200, Michal Hocko wrote: > On Thu 19-07-18 06:19:45, Naoya Horiguchi wrote: > > On Wed, Jul 18, 2018 at 10:50:32AM +0200, Michal Hocko wrote: > > > On Wed 18-07-18 00:55:29, Naoya Horiguchi wrote: > > > > On Tue, Jul 17, 2018 at 04:27:43PM +0200, Michal Hocko wr

Re: [PATCH v2 1/2] mm: fix race on soft-offlining free huge pages

2018-07-19 Thread Michal Hocko
On Thu 19-07-18 06:19:45, Naoya Horiguchi wrote: > On Wed, Jul 18, 2018 at 10:50:32AM +0200, Michal Hocko wrote: > > On Wed 18-07-18 00:55:29, Naoya Horiguchi wrote: > > > On Tue, Jul 17, 2018 at 04:27:43PM +0200, Michal Hocko wrote: > > > > On Tue 17-07-18 14:32:31, Naoya Horiguchi wrote: > > > >

Re: [PATCH v2 1/2] mm: fix race on soft-offlining free huge pages

2018-07-18 Thread Naoya Horiguchi
On Wed, Jul 18, 2018 at 10:50:32AM +0200, Michal Hocko wrote: > On Wed 18-07-18 00:55:29, Naoya Horiguchi wrote: > > On Tue, Jul 17, 2018 at 04:27:43PM +0200, Michal Hocko wrote: > > > On Tue 17-07-18 14:32:31, Naoya Horiguchi wrote: > > > > There's a race condition between soft offline and hugetlb

Re: [PATCH v2 1/2] mm: fix race on soft-offlining free huge pages

2018-07-18 Thread Michal Hocko
On Wed 18-07-18 00:55:29, Naoya Horiguchi wrote: > On Tue, Jul 17, 2018 at 04:27:43PM +0200, Michal Hocko wrote: > > On Tue 17-07-18 14:32:31, Naoya Horiguchi wrote: > > > There's a race condition between soft offline and hugetlb_fault which > > > causes unexpected process killing and/or hugetlb al

Re: [PATCH v2 1/2] mm: fix race on soft-offlining free huge pages

2018-07-17 Thread Mike Kravetz
On 07/17/2018 06:28 PM, Naoya Horiguchi wrote: > On Tue, Jul 17, 2018 at 01:10:39PM -0700, Mike Kravetz wrote: >> It seems that soft_offline_free_page can be called for in use pages. >> Certainly, that is the case in the first workflow above. With the >> suggested changes, I think this is OK for h

Re: [PATCH v2 1/2] mm: fix race on soft-offlining free huge pages

2018-07-17 Thread Naoya Horiguchi
On Wed, Jul 18, 2018 at 12:55:29AM +, Horiguchi Naoya(堀口 直也) wrote: > On Tue, Jul 17, 2018 at 04:27:43PM +0200, Michal Hocko wrote: > > On Tue 17-07-18 14:32:31, Naoya Horiguchi wrote: > > > There's a race condition between soft offline and hugetlb_fault which > > > causes unexpected process ki

Re: [PATCH v2 1/2] mm: fix race on soft-offlining free huge pages

2018-07-17 Thread Naoya Horiguchi
On Tue, Jul 17, 2018 at 01:10:39PM -0700, Mike Kravetz wrote: > On 07/17/2018 07:27 AM, Michal Hocko wrote: > > On Tue 17-07-18 14:32:31, Naoya Horiguchi wrote: > >> There's a race condition between soft offline and hugetlb_fault which > >> causes unexpected process killing and/or hugetlb allocatio

Re: [PATCH v2 1/2] mm: fix race on soft-offlining free huge pages

2018-07-17 Thread Naoya Horiguchi
On Tue, Jul 17, 2018 at 04:27:43PM +0200, Michal Hocko wrote: > On Tue 17-07-18 14:32:31, Naoya Horiguchi wrote: > > There's a race condition between soft offline and hugetlb_fault which > > causes unexpected process killing and/or hugetlb allocation failure. > > > > The process killing is caused

Re: [PATCH v2 1/2] mm: fix race on soft-offlining free huge pages

2018-07-17 Thread Mike Kravetz
On 07/17/2018 07:27 AM, Michal Hocko wrote: > On Tue 17-07-18 14:32:31, Naoya Horiguchi wrote: >> There's a race condition between soft offline and hugetlb_fault which >> causes unexpected process killing and/or hugetlb allocation failure. >> >> The process killing is caused by the following flow:

Re: [PATCH v2 1/2] mm: fix race on soft-offlining free huge pages

2018-07-17 Thread Michal Hocko
On Tue 17-07-18 14:32:31, Naoya Horiguchi wrote: > There's a race condition between soft offline and hugetlb_fault which > causes unexpected process killing and/or hugetlb allocation failure. > > The process killing is caused by the following flow: > > CPU 0 CPU 1 CPU

[PATCH v2 1/2] mm: fix race on soft-offlining free huge pages

2018-07-16 Thread Naoya Horiguchi
There's a race condition between soft offline and hugetlb_fault which causes unexpected process killing and/or hugetlb allocation failure. The process killing is caused by the following flow: CPU 0 CPU 1 CPU 2 soft offline get_any_page // find the hugetlb i