From: Michal Hocko <mhocko@kernel.org>
To: David Rientjes <rientjes@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [patch] mm, oom: fix unnecessary killing of additional processes
Date: Fri, 22 Jun 2018 09:42:57 +0200 [thread overview]
Message-ID: <20180622074257.GQ10465@dhcp22.suse.cz> (raw)
In-Reply-To: <alpine.DEB.2.21.1806211347050.213939@chino.kir.corp.google.com>
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 @@ static void vcpu_load_eoi_exitmap(struct kvm_vcpu *vcpu)
> > > > kvm_x86_ops->load_eoi_exitmap(vcpu, eoi_exit_bitmap);
> > > > }
> > > >
> > > > -void kvm_arch_mmu_notifier_invalidate_range(struct kvm *kvm,
> > > > - unsigned long start, unsigned long end)
> > > > +int kvm_arch_mmu_notifier_invalidate_range(struct kvm *kvm,
> > > > + unsigned long start, unsigned long end,
> > > > + bool blockable)
> > > > {
> > > > unsigned long apic_address;
> > > >
> > > > @@ -7215,6 +7216,8 @@ void kvm_arch_mmu_notifier_invalidate_range(struct kvm *kvm,
> > > > apic_address = gfn_to_hva(kvm, APIC_DEFAULT_PHYS_BASE >> PAGE_SHIFT);
> > > > if (start <= apic_address && apic_address < end)
> > > > kvm_make_all_cpus_request(kvm, KVM_REQ_APIC_PAGE_RELOAD);
> > > > +
> > > > + return 0;
> > > > }
> > > >
> > > > void kvm_vcpu_reload_apic_access_page(struct kvm_vcpu *vcpu)
> > >
> > > Auditing the first change in the patch, this is incorrect because
> > > kvm_make_all_cpus_request() for KVM_REQ_APIC_PAGE_RELOAD can block in
> > > kvm_kick_many_cpus() and that is after kvm_make_request() has been done.
> >
> > I would have to check the code closer. But doesn't
> > kvm_make_all_cpus_request call get_cpu which is preempt_disable? I
> > definitely plan to talk to respective maintainers about these changes of
> > course.
> >
>
> 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
> ack_flush().
I will make sure to talk to the maintainer of the respective code to
do the nonblock case correctly.
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2018-06-22 7:43 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-24 21:22 [rfc patch] " David Rientjes
2018-05-25 0:19 ` Tetsuo Handa
2018-05-25 19:44 ` David Rientjes
2018-05-25 7:26 ` Michal Hocko
2018-05-25 19:36 ` David Rientjes
2018-05-28 8:13 ` Michal Hocko
2018-05-30 21:06 ` David Rientjes
2018-05-31 6:32 ` Michal Hocko
2018-05-31 21:16 ` David Rientjes
2018-06-01 7:46 ` Michal Hocko
2018-06-05 4:25 ` David Rientjes
2018-06-05 8:57 ` Michal Hocko
2018-06-13 13:20 ` Tetsuo Handa
2018-06-13 13:29 ` Michal Hocko
2018-06-04 5:48 ` [lkp-robot] [mm, oom] 2d251ff6e6: BUG:unable_to_handle_kernel kernel test robot
2018-06-14 20:42 ` [patch] mm, oom: fix unnecessary killing of additional processes David Rientjes
2018-06-15 6:55 ` Michal Hocko
2018-06-15 23:15 ` David Rientjes
2018-06-19 8:33 ` Michal Hocko
2018-06-20 13:03 ` Michal Hocko
2018-06-20 20:34 ` David Rientjes
2018-06-21 7:45 ` Michal Hocko
2018-06-21 7:54 ` Michal Hocko
2018-06-21 20:50 ` David Rientjes
2018-06-22 7:42 ` Michal Hocko [this message]
2018-06-22 14:29 ` Michal Hocko
2018-06-22 18:49 ` David Rientjes
2018-06-25 9:04 ` Michal Hocko
2018-06-19 0:27 ` Andrew Morton
2018-06-19 8:47 ` Michal Hocko
2018-06-19 20:34 ` David Rientjes
2018-06-20 21:59 ` [patch v2] " David Rientjes
2018-06-21 10:58 ` [RFC PATCH] mm, oom: oom_free_timeout_ms can be static kbuild test robot
2018-06-21 10:58 ` [patch v2] mm, oom: fix unnecessary killing of additional processes kbuild test robot
2018-06-24 2:36 ` [patch] " Tetsuo Handa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180622074257.GQ10465@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=rientjes@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox