From: John Hubbard <jhubbard@nvidia.com>
To: Alistair Popple <apopple@nvidia.com>,
Sean Christopherson <seanjc@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>, <linux-mm@kvack.org>,
<linux-kernel@vger.kernel.org>, <robin.murphy@arm.com>,
<will@kernel.org>, <nicolinc@nvidia.com>,
<linux-arm-kernel@lists.infradead.org>, <kvm@vger.kernel.org>,
<kvmarm@lists.cs.columbia.edu>, <jgg@nvidia.com>
Subject: Re: [PATCH] mmu_notifiers: Notify on pte permission upgrades
Date: Mon, 22 May 2023 18:13:09 -0700 [thread overview]
Message-ID: <b99d20a4-ab1e-4e67-37ae-cb22777317ba@nvidia.com> (raw)
In-Reply-To: <875y8jappz.fsf@nvidia.com>
On 5/22/23 16:50, Alistair Popple wrote:
...
>> Again from include/linux/mmu_notifier.h, not implementing the start()/end() hooks
>> is perfectly valid. And AFAICT, the existing invalidate_range() hook is pretty
>> much a perfect fit for what you want to achieve.
>
> Right, I didn't take that approach because it doesn't allow an event
> type to be passed which would allow them to be filtered on platforms
> which don't require this.
>
> I had also assumed the invalidate_range() callbacks were allowed to
> sleep, hence couldn't be called under PTL. That's certainly true of mmu
> interval notifier callbacks, but Catalin reminded me that calls such as
> ptep_clear_flush_notify() already call invalidate_range() callback under
> PTL so I guess we already assume drivers don't sleep in their
> invalidate_range() callbacks. I will update the comments to reflect
This line of reasoning feels very fragile. The range notifiers generally
do allow sleeping. They are using srcu (sleepable RCU) protection, btw.
The fact that existing callers are calling these under PTL just means
that so far, that has sorta worked. And yes, we can probably make this
all work. That's not really the ideal way to deduce the API rules, though,
and it would be good to clarify what they really are.
Aside from those use cases, I don't see anything justifying a "not allowed
to sleep" rule for .invalidate_range(), right?
thanks,
--
John Hubbard
NVIDIA
next prev parent reply other threads:[~2023-05-23 1:13 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-22 6:37 Alistair Popple
2023-05-22 7:15 ` Qi Zheng
2023-05-22 7:45 ` Alistair Popple
2023-05-22 8:28 ` Qi Zheng
2023-05-22 15:09 ` Catalin Marinas
2023-05-22 23:52 ` Alistair Popple
2023-05-22 18:34 ` Sean Christopherson
2023-05-22 23:50 ` Alistair Popple
2023-05-23 0:06 ` Sean Christopherson
2023-05-23 0:43 ` Alistair Popple
2023-05-23 1:13 ` John Hubbard [this message]
2023-05-23 4:35 ` Alistair Popple
2023-05-23 0:55 ` John Hubbard
2023-05-23 1:12 ` Alistair Popple
2023-05-23 6:45 ` Christoph Hellwig
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=b99d20a4-ab1e-4e67-37ae-cb22777317ba@nvidia.com \
--to=jhubbard@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=jgg@nvidia.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nicolinc@nvidia.com \
--cc=robin.murphy@arm.com \
--cc=seanjc@google.com \
--cc=will@kernel.org \
/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