RE: [PATCH] mm, oom: fix potential data corruption when oom_reaper races with writer

2017-08-04 Thread 陶文苇
om>; o...@redhat.com; rient...@google.com; > linux-kernel@vger.kernel.org > Subject: Re: [PATCH] mm, oom: fix potential data corruption when > oom_reaper races with writer > > On Fri 04-08-17 13:00:47, Michal Hocko wrote: > > On Fri 04-08-17 19:41:42, Tetsuo Handa wrote: > [...] >

RE: [PATCH] mm, oom: fix potential data corruption when oom_reaper races with writer

2017-08-04 Thread 陶文苇
Subject: Re: [PATCH] mm, oom: fix potential data corruption when > oom_reaper races with writer > > On Fri 04-08-17 13:00:47, Michal Hocko wrote: > > On Fri 04-08-17 19:41:42, Tetsuo Handa wrote: > [...] > > > Yes. Data corruption still happens. > > > > I

Re: [PATCH] mm, oom: fix potential data corruption when oom_reaper races with writer

2017-08-04 Thread Tetsuo Handa
Michal Hocko wrote: > And that's why we still see the corruption. That, however, means that > the MMF_UNSTABLE implementation has to be more complex and we have to > hook into all anonymous memory fault paths which I hoped I could avoid > previously. I don't understand mm internals including

Re: [PATCH] mm, oom: fix potential data corruption when oom_reaper races with writer

2017-08-04 Thread Tetsuo Handa
Michal Hocko wrote: > And that's why we still see the corruption. That, however, means that > the MMF_UNSTABLE implementation has to be more complex and we have to > hook into all anonymous memory fault paths which I hoped I could avoid > previously. I don't understand mm internals including

Re: [PATCH] mm, oom: fix potential data corruption when oom_reaper races with writer

2017-08-04 Thread Michal Hocko
On Fri 04-08-17 13:00:47, Michal Hocko wrote: > On Fri 04-08-17 19:41:42, Tetsuo Handa wrote: [...] > > Yes. Data corruption still happens. > > I guess I managed to reproduce finally. Will investigate further. One limitation of the current MMF_UNSTABLE implementation is that it still keeps the

Re: [PATCH] mm, oom: fix potential data corruption when oom_reaper races with writer

2017-08-04 Thread Michal Hocko
On Fri 04-08-17 13:00:47, Michal Hocko wrote: > On Fri 04-08-17 19:41:42, Tetsuo Handa wrote: [...] > > Yes. Data corruption still happens. > > I guess I managed to reproduce finally. Will investigate further. One limitation of the current MMF_UNSTABLE implementation is that it still keeps the

Re: [PATCH] mm, oom: fix potential data corruption when oom_reaper races with writer

2017-08-04 Thread Michal Hocko
On Fri 04-08-17 19:41:42, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Fri 04-08-17 17:25:46, Tetsuo Handa wrote: > > > Well, while lockdep warning is gone, this problem is remaining. > > > > > > diff --git a/mm/memory.c b/mm/memory.c > > > index edabf6f..1e06c29 100644 > > > ---

Re: [PATCH] mm, oom: fix potential data corruption when oom_reaper races with writer

2017-08-04 Thread Michal Hocko
On Fri 04-08-17 19:41:42, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Fri 04-08-17 17:25:46, Tetsuo Handa wrote: > > > Well, while lockdep warning is gone, this problem is remaining. > > > > > > diff --git a/mm/memory.c b/mm/memory.c > > > index edabf6f..1e06c29 100644 > > > ---

Re: [PATCH] mm, oom: fix potential data corruption when oom_reaper races with writer

2017-08-04 Thread Tetsuo Handa
Michal Hocko wrote: > On Fri 04-08-17 17:25:46, Tetsuo Handa wrote: > > Well, while lockdep warning is gone, this problem is remaining. > > > > diff --git a/mm/memory.c b/mm/memory.c > > index edabf6f..1e06c29 100644 > > --- a/mm/memory.c > > +++ b/mm/memory.c > > @@ -3931,15 +3931,14 @@ int

Re: [PATCH] mm, oom: fix potential data corruption when oom_reaper races with writer

2017-08-04 Thread Tetsuo Handa
Michal Hocko wrote: > On Fri 04-08-17 17:25:46, Tetsuo Handa wrote: > > Well, while lockdep warning is gone, this problem is remaining. > > > > diff --git a/mm/memory.c b/mm/memory.c > > index edabf6f..1e06c29 100644 > > --- a/mm/memory.c > > +++ b/mm/memory.c > > @@ -3931,15 +3931,14 @@ int

Re: Re: [PATCH] mm, oom: fix potential data corruption when oom_reaper races with writer

2017-08-04 Thread Michal Hocko
On Fri 04-08-17 17:25:46, Tetsuo Handa wrote: > Well, while lockdep warning is gone, this problem is remaining. > > diff --git a/mm/memory.c b/mm/memory.c > index edabf6f..1e06c29 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -3931,15 +3931,14 @@ int handle_mm_fault(struct vm_area_struct

Re: Re: [PATCH] mm, oom: fix potential data corruption when oom_reaper races with writer

2017-08-04 Thread Michal Hocko
On Fri 04-08-17 17:25:46, Tetsuo Handa wrote: > Well, while lockdep warning is gone, this problem is remaining. > > diff --git a/mm/memory.c b/mm/memory.c > index edabf6f..1e06c29 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -3931,15 +3931,14 @@ int handle_mm_fault(struct vm_area_struct

Re: Re: [PATCH] mm, oom: fix potential data corruption when oom_reaper races with writer

2017-08-04 Thread Michal Hocko
On Fri 04-08-17 17:25:46, Tetsuo Handa wrote: > Well, while lockdep warning is gone, this problem is remaining. Ohh, I should have been more specific. Both patches have to be applied. I have based this one first because it should go to stable. The later one needs a trivial conflict resolution. I

Re: Re: [PATCH] mm, oom: fix potential data corruption when oom_reaper races with writer

2017-08-04 Thread Michal Hocko
On Fri 04-08-17 17:25:46, Tetsuo Handa wrote: > Well, while lockdep warning is gone, this problem is remaining. Ohh, I should have been more specific. Both patches have to be applied. I have based this one first because it should go to stable. The later one needs a trivial conflict resolution. I

Re: [PATCH] mm, oom: fix potential data corruption when oom_reaper races with writer

2017-08-04 Thread Michal Hocko
On Fri 04-08-17 15:46:46, Tetsuo Handa wrote: > Michal Hocko wrote: > > So there is a race window when some threads > > won't have fatal_signal_pending while the oom_reaper could start > > unmapping the address space. generic_perform_write could then write > > zero page to

Re: [PATCH] mm, oom: fix potential data corruption when oom_reaper races with writer

2017-08-04 Thread Michal Hocko
On Fri 04-08-17 15:46:46, Tetsuo Handa wrote: > Michal Hocko wrote: > > So there is a race window when some threads > > won't have fatal_signal_pending while the oom_reaper could start > > unmapping the address space. generic_perform_write could then write > > zero page to