linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	kvm@vger.kernel.org, "Radim Krčmář" <rkrcmar@redhat.com>,
	linux-mm@kvack.org, "Andrea Arcangeli" <aarcange@redhat.com>,
	"Jérôme Glisse" <jglisse@redhat.com>
Subject: Re: [RFC PATCH] mm, oom: distinguish blockable mode for mmu notifiers
Date: Mon, 25 Jun 2018 09:57:15 +0200	[thread overview]
Message-ID: <20180625075715.GA28965@dhcp22.suse.cz> (raw)
In-Reply-To: <d617fc1d-28a7-3441-7465-bedf4dc69976@redhat.com>

On Sun 24-06-18 10:11:21, Paolo Bonzini wrote:
> On 22/06/2018 17:02, Michal Hocko wrote:
> > @@ -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;
> 
> This is wrong, gfn_to_hva can sleep.

Hmm, I have tried to crawl the call chain and haven't found any
sleepable locks taken. Maybe I am just missing something.
__kvm_memslots has a complex locking assert. I do not see we would take
slots_lock anywhere from the notifier call path. IIUC that means that
users_count has to be zero at that time. I have no idea how that is
guaranteed.
 
> You could do the the kvm_make_all_cpus_request unconditionally, but only
> if !blockable is a really rare thing.  OOM would be fine, since the
> request actually would never be processed, but I'm afraid of more uses
> of !blockable being introduced later.

Well, if this is not generally guaranteed then I have to come up with a
different flag. E.g. OOM_CONTEXT that would be more specific to
contrains for the callback.
-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2018-06-25  7:57 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-22 15:02 Michal Hocko
2018-06-22 15:13 ` Christian König
2018-06-22 15:24   ` Michal Hocko
2018-06-22 20:09     ` Felix Kuehling
2018-06-25  8:01       ` Michal Hocko
2018-06-25 13:31         ` Michal Hocko
2018-06-22 15:36 ` [Intel-gfx] " Chris Wilson
2018-06-22 15:57   ` Michal Hocko
2018-06-22 16:18     ` Jerome Glisse
     [not found]       ` <20180622164026.GA23674@dhcp22.suse.cz>
2018-06-22 16:42         ` Michal Hocko
2018-06-22 17:26           ` Jerome Glisse
     [not found]     ` <152968364170.11773.4392861266443293819@mail.alporthouse.com>
2018-06-22 16:19       ` Michal Hocko
2018-06-24  8:11 ` Paolo Bonzini
2018-06-25  7:57   ` Michal Hocko [this message]
2018-06-25  8:10     ` Paolo Bonzini
2018-06-25  8:45       ` Michal Hocko
2018-06-25 10:34         ` Paolo Bonzini
2018-06-25 11:08           ` Michal Hocko
2018-06-27  7:44 ` Michal Hocko
2018-07-02  9:14   ` Christian König
2018-07-02 11:54     ` Michal Hocko
2018-07-02 12:13       ` Christian König
2018-07-02 12:20         ` Michal Hocko
2018-07-02 12:24           ` Christian König
2018-07-02 12:35             ` Michal Hocko
2018-07-02 12:39               ` Christian König
2018-07-02 12:56                 ` Michal Hocko
2018-07-09 12:29   ` Michal Hocko
2018-07-10 13:40     ` Leon Romanovsky
2018-07-10 14:14       ` Michal Hocko
2018-07-10 16:20         ` Leon Romanovsky
2018-07-11  9:03           ` Michal Hocko
2018-07-11 10:14             ` Leon Romanovsky
2018-07-11 11:13               ` Michal Hocko
2018-07-11 12:08                 ` Leon Romanovsky
2018-07-16  7:59         ` Leon Romanovsky

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=20180625075715.GA28965@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=aarcange@redhat.com \
    --cc=jglisse@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.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