Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-25 Thread Michal Hocko
On Fri 22-06-18 11:49:14, David Rientjes wrote: > On Fri, 22 Jun 2018, Michal Hocko wrote: > > > > > preempt_disable() is required because it calls kvm_kick_many_cpus() > > > > with > > > > wait == true because KVM_REQ_APIC_PAGE_RELOAD sets KVM_REQUEST_WAIT and > > > > thus the

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-25 Thread Michal Hocko
On Fri 22-06-18 11:49:14, David Rientjes wrote: > On Fri, 22 Jun 2018, Michal Hocko wrote: > > > > > preempt_disable() is required because it calls kvm_kick_many_cpus() > > > > with > > > > wait == true because KVM_REQ_APIC_PAGE_RELOAD sets KVM_REQUEST_WAIT and > > > > thus the

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-23 Thread Tetsuo Handa
On 2018/06/15 5:42, David Rientjes wrote: > Note: I understand there is an objection based on timeout based delays. > This is currently the only possible way to avoid oom killing important > processes completely unnecessarily. If the oom reaper can someday free > all memory, including mlocked

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-23 Thread Tetsuo Handa
On 2018/06/15 5:42, David Rientjes wrote: > Note: I understand there is an objection based on timeout based delays. > This is currently the only possible way to avoid oom killing important > processes completely unnecessarily. If the oom reaper can someday free > all memory, including mlocked

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-22 Thread David Rientjes
On Fri, 22 Jun 2018, Michal Hocko wrote: > > > preempt_disable() is required because it calls kvm_kick_many_cpus() with > > > wait == true because KVM_REQ_APIC_PAGE_RELOAD sets KVM_REQUEST_WAIT and > > > thus the smp_call_function_many() is going to block until all cpus can > > > run > > >

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-22 Thread David Rientjes
On Fri, 22 Jun 2018, Michal Hocko wrote: > > > preempt_disable() is required because it calls kvm_kick_many_cpus() with > > > wait == true because KVM_REQ_APIC_PAGE_RELOAD sets KVM_REQUEST_WAIT and > > > thus the smp_call_function_many() is going to block until all cpus can > > > run > > >

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-22 Thread Michal Hocko
On Fri 22-06-18 09:42:57, Michal Hocko wrote: > On Thu 21-06-18 13:50:53, David Rientjes wrote: > > On Thu, 21 Jun 2018, Michal Hocko wrote: > > > > > > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > > > > > index 6bcecc325e7e..ac08f5d711be 100644 > > > > > --- a/arch/x86/kvm/x86.c > >

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-22 Thread Michal Hocko
On Fri 22-06-18 09:42:57, Michal Hocko wrote: > On Thu 21-06-18 13:50:53, David Rientjes wrote: > > On Thu, 21 Jun 2018, Michal Hocko wrote: > > > > > > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > > > > > index 6bcecc325e7e..ac08f5d711be 100644 > > > > > --- a/arch/x86/kvm/x86.c > >

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-22 Thread Michal Hocko
On Thu 21-06-18 13:50:53, David Rientjes wrote: > On Thu, 21 Jun 2018, Michal Hocko wrote: > > > > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > > > > index 6bcecc325e7e..ac08f5d711be 100644 > > > > --- a/arch/x86/kvm/x86.c > > > > +++ b/arch/x86/kvm/x86.c > > > > @@ -7203,8 +7203,9 @@

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-22 Thread Michal Hocko
On Thu 21-06-18 13:50:53, David Rientjes wrote: > On Thu, 21 Jun 2018, Michal Hocko wrote: > > > > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > > > > index 6bcecc325e7e..ac08f5d711be 100644 > > > > --- a/arch/x86/kvm/x86.c > > > > +++ b/arch/x86/kvm/x86.c > > > > @@ -7203,8 +7203,9 @@

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-21 Thread David Rientjes
On Thu, 21 Jun 2018, Michal Hocko wrote: > > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > > > index 6bcecc325e7e..ac08f5d711be 100644 > > > --- a/arch/x86/kvm/x86.c > > > +++ b/arch/x86/kvm/x86.c > > > @@ -7203,8 +7203,9 @@ static void vcpu_load_eoi_exitmap(struct kvm_vcpu > > >

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-21 Thread David Rientjes
On Thu, 21 Jun 2018, Michal Hocko wrote: > > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > > > index 6bcecc325e7e..ac08f5d711be 100644 > > > --- a/arch/x86/kvm/x86.c > > > +++ b/arch/x86/kvm/x86.c > > > @@ -7203,8 +7203,9 @@ static void vcpu_load_eoi_exitmap(struct kvm_vcpu > > >

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-21 Thread Michal Hocko
On Thu 21-06-18 09:45:37, Michal Hocko wrote: > On Wed 20-06-18 13:34:52, David Rientjes wrote: > > On Wed, 20 Jun 2018, Michal Hocko wrote: [...] > > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > > > index 6bcecc325e7e..ac08f5d711be 100644 > > > --- a/arch/x86/kvm/x86.c > > > +++

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-21 Thread Michal Hocko
On Thu 21-06-18 09:45:37, Michal Hocko wrote: > On Wed 20-06-18 13:34:52, David Rientjes wrote: > > On Wed, 20 Jun 2018, Michal Hocko wrote: [...] > > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > > > index 6bcecc325e7e..ac08f5d711be 100644 > > > --- a/arch/x86/kvm/x86.c > > > +++

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-21 Thread Michal Hocko
On Wed 20-06-18 13:34:52, David Rientjes wrote: > On Wed, 20 Jun 2018, Michal Hocko wrote: > > > On Tue 19-06-18 10:33:16, Michal Hocko wrote: > > [...] > > > As I've said, if you are not willing to work on a proper solution, I > > > will, but my nack holds for this patch until we see no other

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-21 Thread Michal Hocko
On Wed 20-06-18 13:34:52, David Rientjes wrote: > On Wed, 20 Jun 2018, Michal Hocko wrote: > > > On Tue 19-06-18 10:33:16, Michal Hocko wrote: > > [...] > > > As I've said, if you are not willing to work on a proper solution, I > > > will, but my nack holds for this patch until we see no other

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-20 Thread David Rientjes
On Wed, 20 Jun 2018, Michal Hocko wrote: > On Tue 19-06-18 10:33:16, Michal Hocko wrote: > [...] > > As I've said, if you are not willing to work on a proper solution, I > > will, but my nack holds for this patch until we see no other way around > > existing and real world problems. > > OK, so I

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-20 Thread David Rientjes
On Wed, 20 Jun 2018, Michal Hocko wrote: > On Tue 19-06-18 10:33:16, Michal Hocko wrote: > [...] > > As I've said, if you are not willing to work on a proper solution, I > > will, but my nack holds for this patch until we see no other way around > > existing and real world problems. > > OK, so I

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-20 Thread Michal Hocko
On Tue 19-06-18 10:33:16, Michal Hocko wrote: [...] > As I've said, if you are not willing to work on a proper solution, I > will, but my nack holds for this patch until we see no other way around > existing and real world problems. OK, so I gave it a quick try and it doesn't look all that bad to

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-20 Thread Michal Hocko
On Tue 19-06-18 10:33:16, Michal Hocko wrote: [...] > As I've said, if you are not willing to work on a proper solution, I > will, but my nack holds for this patch until we see no other way around > existing and real world problems. OK, so I gave it a quick try and it doesn't look all that bad to

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-19 Thread David Rientjes
On Mon, 18 Jun 2018, Andrew Morton wrote: > > The oom reaper ensures forward progress by setting MMF_OOM_SKIP itself if > > it cannot reap an mm. This can happen for a variety of reasons, > > including: > > > > - the inability to grab mm->mmap_sem in a sufficient amount of time, > > > > -

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-19 Thread David Rientjes
On Mon, 18 Jun 2018, Andrew Morton wrote: > > The oom reaper ensures forward progress by setting MMF_OOM_SKIP itself if > > it cannot reap an mm. This can happen for a variety of reasons, > > including: > > > > - the inability to grab mm->mmap_sem in a sufficient amount of time, > > > > -

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-19 Thread Michal Hocko
On Mon 18-06-18 17:27:33, Andrew Morton wrote: > On Thu, 14 Jun 2018 13:42:59 -0700 (PDT) David Rientjes > wrote: > > > The oom reaper ensures forward progress by setting MMF_OOM_SKIP itself if > > it cannot reap an mm. This can happen for a variety of reasons, > > including: > > > > - the

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-19 Thread Michal Hocko
On Mon 18-06-18 17:27:33, Andrew Morton wrote: > On Thu, 14 Jun 2018 13:42:59 -0700 (PDT) David Rientjes > wrote: > > > The oom reaper ensures forward progress by setting MMF_OOM_SKIP itself if > > it cannot reap an mm. This can happen for a variety of reasons, > > including: > > > > - the

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-19 Thread Michal Hocko
On Fri 15-06-18 16:15:39, David Rientjes wrote: [...] > I'd be happy to make the this timeout configurable, however, and default > it to perhaps one second as the blockable mmu notifier timeout in your own > code does. I find it somewhat sad that we'd need a sysctl for this, but > if that will

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-19 Thread Michal Hocko
On Fri 15-06-18 16:15:39, David Rientjes wrote: [...] > I'd be happy to make the this timeout configurable, however, and default > it to perhaps one second as the blockable mmu notifier timeout in your own > code does. I find it somewhat sad that we'd need a sysctl for this, but > if that will

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-18 Thread Andrew Morton
On Thu, 14 Jun 2018 13:42:59 -0700 (PDT) David Rientjes wrote: > The oom reaper ensures forward progress by setting MMF_OOM_SKIP itself if > it cannot reap an mm. This can happen for a variety of reasons, > including: > > - the inability to grab mm->mmap_sem in a sufficient amount of time, >

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-18 Thread Andrew Morton
On Thu, 14 Jun 2018 13:42:59 -0700 (PDT) David Rientjes wrote: > The oom reaper ensures forward progress by setting MMF_OOM_SKIP itself if > it cannot reap an mm. This can happen for a variety of reasons, > including: > > - the inability to grab mm->mmap_sem in a sufficient amount of time, >

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-15 Thread David Rientjes
On Fri, 15 Jun 2018, Michal Hocko wrote: > > Signed-off-by: David Rientjes > > Nacked-by: Michal Hocko > as already explained elsewhere in this email thread. > I don't find this to be surprising, but I'm not sure that it actually matters if you won't fix a regression that you introduced.

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-15 Thread David Rientjes
On Fri, 15 Jun 2018, Michal Hocko wrote: > > Signed-off-by: David Rientjes > > Nacked-by: Michal Hocko > as already explained elsewhere in this email thread. > I don't find this to be surprising, but I'm not sure that it actually matters if you won't fix a regression that you introduced.

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-15 Thread Michal Hocko
On Thu 14-06-18 13:42:59, David Rientjes wrote: > The oom reaper ensures forward progress by setting MMF_OOM_SKIP itself if > it cannot reap an mm. This can happen for a variety of reasons, > including: > > - the inability to grab mm->mmap_sem in a sufficient amount of time, > > - when the mm

Re: [patch] mm, oom: fix unnecessary killing of additional processes

2018-06-15 Thread Michal Hocko
On Thu 14-06-18 13:42:59, David Rientjes wrote: > The oom reaper ensures forward progress by setting MMF_OOM_SKIP itself if > it cannot reap an mm. This can happen for a variety of reasons, > including: > > - the inability to grab mm->mmap_sem in a sufficient amount of time, > > - when the mm