[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180625075715.GA28965@dhcp22.suse.cz>
Date: Mon, 25 Jun 2018 09:57:15 +0200
From: Michal Hocko <mhocko@...nel.org>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: LKML <linux-kernel@...r.kernel.org>, kvm@...r.kernel.org,
Radim Krčmář <rkrcmar@...hat.com>,
linux-mm@...ck.org, Andrea Arcangeli <aarcange@...hat.com>,
Jérôme Glisse <jglisse@...hat.com>
Subject: Re: [RFC PATCH] mm, oom: distinguish blockable mode for mmu notifiers
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
Powered by blists - more mailing lists