From: Paolo Bonzini <pbonzini@redhat.com>
To: Michal Hocko <mhocko@kernel.org>
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 12:34:43 +0200 [thread overview]
Message-ID: <45e1a12c-280b-635a-fc76-716440f084ec@redhat.com> (raw)
In-Reply-To: <20180625084529.GC28965@dhcp22.suse.cz>
On 25/06/2018 10:45, Michal Hocko wrote:
> On Mon 25-06-18 10:10:18, Paolo Bonzini wrote:
>> On 25/06/2018 09:57, Michal Hocko wrote:
>>> 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.
>>
>> Nevermind, ENOCOFFEE. This is gfn_to_hva, not gfn_to_pfn. It only
>> needs SRCU.
>
> OK, so just the make sure I follow, the change above is correct?
Yes. It's only gfn_to_pfn that calls get_user_pages and therefore can
sleep.
Thanks,
Paolo
next prev parent reply other threads:[~2018-06-25 10:34 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-22 15:02 [RFC PATCH] mm, oom: distinguish blockable mode for mmu notifiers 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
2018-06-25 8:10 ` Paolo Bonzini
2018-06-25 8:45 ` Michal Hocko
2018-06-25 10:34 ` Paolo Bonzini [this message]
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=45e1a12c-280b-635a-fc76-716440f084ec@redhat.com \
--to=pbonzini@redhat.com \
--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=mhocko@kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).