From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: Wei Yang <richard.weiyang@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Jonathan Corbet <corbet@lwn.net>,
"Liam R . Howlett" <Liam.Howlett@oracle.com>,
Vlastimil Babka <vbabka@suse.cz>, Jann Horn <jannh@google.com>,
Alice Ryhl <aliceryhl@google.com>,
Boqun Feng <boqun.feng@gmail.com>,
Matthew Wilcox <willy@infradead.org>,
Mike Rapoport <rppt@kernel.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
linux-doc@vger.kernel.org, Suren Baghdasaryan <surenb@google.com>,
Hillf Danton <hdanton@sina.com>,
Qi Zheng <zhengqi.arch@bytedance.com>,
SeongJae Park <sj@kernel.org>
Subject: Re: [PATCH] docs/mm: add VMA locks documentation
Date: Mon, 11 Nov 2024 10:39:57 +0000 [thread overview]
Message-ID: <e49519cf-aa58-4241-b362-4c16595560c1@lucifer.local> (raw)
In-Reply-To: <20241111070719.bsgqz4yzxfrruuup@master>
Wei - a side note, when reviewing huuuuge patches like this _please_ remove
irrelevant lines, it's really hard for me to respond and easy for me to
miss stuff scrolling through >600 lines. Thanks!
Also - you're reviewing an out of date series, the new version has changed
a lot, see [0].
[0]:https://lore.kernel.org/all/20241108135708.48567-1-lorenzo.stoakes@oracle.com/
On Mon, Nov 11, 2024 at 07:07:19AM +0000, Wei Yang wrote:
> On Thu, Nov 07, 2024 at 07:01:37PM +0000, Lorenzo Stoakes wrote:
> >+If you want to **write** VMA metadata fields, then things vary depending on the
> >+field (we explore each VMA field in detail below). For the majority you must:
> >+
> >+* Obtain an mmap write lock at the MM granularity via :c:func:`!mmap_write_lock` (or a
> >+ suitable variant), unlocking it with a matching :c:func:`!mmap_write_unlock` when
> >+ you're done with the VMA, *and*
> >+* Obtain a VMA write lock via :c:func:`!vma_start_write` for each VMA you wish to
> >+ modify, which will be released automatically when :c:func:`!mmap_write_unlock` is
> >+ called.
> >+* If you want to be able to write to **any** field, you must also hide the VMA
> >+ from the reverse mapping by obtaining an **rmap write lock**.
>
> Here I am a little confused.
>
> I guess it wants to say mmap write lock and VMA write lock should be obtained,
> while rmap write lock is optional for write operation. And this is what
> illustrated in below section "VMA fields".
>
> But here says 'write to "any" field'. This seems not what it shows below.
>
> Or maybe I misunderstand this part.
It opens with 'for the majority' as in, for the _majority_ you need the
mmap write, VMA write lock.
To able to adjust _all_ you need the rmap write lock too.
I have to trade off with 'summarising' how you get a write lock vs. the
specifics, I mean I literally give a table immediately after this
explicitly listing what is required.
If I gave just that, it'd be confusing and people wouldn't maybe realise
that _mostly_ mmap write, VMA write is enough.
If I don't mention the rmap thing then people might be confused as to why.
Given I give the correct requirements in the table I don't tnink this is a
problem.
[snip]
> >+.. table:: Virtual layout fields
> >+
> >+ ===================== ======================================== ===========
> >+ Field Description Write lock
> >+ ===================== ======================================== ===========
> >+ :c:member:`!vm_start` Inclusive start virtual address of range mmap write,
> >+ VMA describes. VMA write,
> >+ rmap write.
> >+ :c:member:`!vm_end` Exclusive end virtual address of range mmap write,
> >+ VMA describes. VMA write,
> >+ rmap write.
> >+ :c:member:`!vm_pgoff` Describes the page offset into the file, rmap write.
>
> ^
> I am afraid this one is a typo?
This is fixed in v2.
[snip]
prev parent reply other threads:[~2024-11-11 10:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-07 19:01 Lorenzo Stoakes
2024-11-07 21:15 ` Jann Horn
2024-11-08 10:35 ` Lorenzo Stoakes
2024-11-08 8:26 ` Kirill A. Shutemov
2024-11-08 8:59 ` Lorenzo Stoakes
2024-11-08 12:25 ` Bagas Sanjaya
2024-11-08 12:29 ` Lorenzo Stoakes
2024-11-08 12:34 ` Lorenzo Stoakes
2024-11-12 1:12 ` Bagas Sanjaya
2024-11-11 2:42 ` Wei Yang
2024-11-11 10:31 ` Lorenzo Stoakes
2024-11-11 7:07 ` Wei Yang
2024-11-11 10:39 ` Lorenzo Stoakes [this message]
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=e49519cf-aa58-4241-b362-4c16595560c1@lucifer.local \
--to=lorenzo.stoakes@oracle.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=aliceryhl@google.com \
--cc=boqun.feng@gmail.com \
--cc=corbet@lwn.net \
--cc=hdanton@sina.com \
--cc=jannh@google.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=richard.weiyang@gmail.com \
--cc=rppt@kernel.org \
--cc=sj@kernel.org \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
--cc=willy@infradead.org \
--cc=zhengqi.arch@bytedance.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