linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Akira Yokosawa <akiyks@gmail.com>
To: rdunlap@infradead.org, surenb@google.com
Cc: akpm@linux-foundation.org, brauner@kernel.org, corbet@lwn.net,
	dave@stgolabs.net, david@redhat.com, dhowells@redhat.com,
	hannes@cmpxchg.org, hdanton@sina.com, hughd@google.com,
	jannh@google.com, kernel-team@android.com,
	liam.howlett@oracle.com, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	lorenzo.stoakes@oracle.com, mgorman@techsingularity.net,
	mhocko@suse.com, minchan@google.com, mjguzik@gmail.com,
	oleg@redhat.com, oliver.sang@intel.com,
	pasha.tatashin@soleen.com, paulmck@kernel.org, peterx@redhat.com,
	shakeel.butt@linux.dev, souravpanda@google.com, vbabka@suse.cz,
	willy@infradead.org
Subject: Re: [PATCH v5 6/6] docs/mm: document latest changes to vm_lock
Date: Sat, 7 Dec 2024 13:24:00 +0900	[thread overview]
Message-ID: <c7cee2d4-5bbd-4867-ac12-a0a2f73f6c44@gmail.com> (raw)
In-Reply-To: <9baeaab7-61d8-4121-8aa5-cf1c129daa40@infradead.org>

On Fri, 6 Dec 2024 19:23:59 -0800, Randy Dunlap wrote:
> Hi,
> 
> Can someone explain what the (consistent) usage of '!' does in this file?
> This is the only file in Documentation/ that uses this syntax.
> 
> 
> E.g.:
> 
>> diff --git a/Documentation/mm/process_addrs.rst b/Documentation/mm/process_addrs.rst
>> index 81417fa2ed20..92cf497a9e3c 100644
>> --- a/Documentation/mm/process_addrs.rst
>> +++ b/Documentation/mm/process_addrs.rst
>> @@ -716,7 +716,11 @@ calls :c:func:`!rcu_read_lock` to ensure that the VMA is looked up in an RCU
>>  critical section, then attempts to VMA lock it via :c:func:`!vma_start_read`,
>>  before releasing the RCU lock via :c:func:`!rcu_read_unlock`.
>>  
>> -VMA read locks hold the read lock on the :c:member:`!vma->vm_lock` semaphore for
>> +In cases when the user already holds mmap read lock, :c:func:`!vma_start_read_locked`
>> +and :c:func:`!vma_start_read_locked_nested` can be used. These functions always
>> +succeed in acquiring VMA read lock.
> 

Quoting from https://www.sphinx-doc.org/en/master/usage/referencing.html#syntax

  * Suppressed link: Prefixing with an exclamation mark (!) prevents the
    creation of a link but otherwise keeps the visual output of the role.

    For example, writing :py:func:`!target` displays target(), with no link
    generated.

    This is helpful for cases in which the link target does not exist; e.g.
    changelog entries that describe removed functionality, or third-party
    libraries that don’t support intersphinx. Suppressing the link prevents
    warnings in nitpicky mode.

But in kernel documentation, there is a preferred alternative.
Referencing by function names is the way to go.  For example:

  calls rcu_read_lock() to ensure that the VMA is looked up in an RCU
  critical section, then attempts to VMA lock it via vma_start_read(),
  before releasing the RCU lock via rcu_read_unlock().

  In cases when the user already holds mmap read lock, vma_start_read_locked()
  and vma_start_read_locked_nested() can be used. These functions always
  succeed in acquiring VMA read lock.

They work regardless of link target's existence.
Kernel-specific Sphinx extension named "automarkup" does conversions
for you.

HTH, Akira

> thanks.
> -- 
> ~Randy



  reply	other threads:[~2024-12-07  4:24 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-06 22:51 [PATCH v5 0/6] move per-vma lock into vm_area_struct Suren Baghdasaryan
2024-12-06 22:51 ` [PATCH v5 1/6] mm: introduce vma_start_read_locked{_nested} helpers Suren Baghdasaryan
2024-12-10  9:03   ` Vlastimil Babka
2024-12-06 22:51 ` [PATCH v5 2/6] mm: move per-vma lock into vm_area_struct Suren Baghdasaryan
2024-12-10  9:15   ` Vlastimil Babka
2024-12-06 22:52 ` [PATCH v5 3/6] mm: mark vma as detached until it's added into vma tree Suren Baghdasaryan
2024-12-10  9:35   ` Vlastimil Babka
2024-12-10 11:36   ` Vlastimil Babka
2024-12-10 16:28     ` Suren Baghdasaryan
2024-12-06 22:52 ` [PATCH v5 4/6] mm: make vma cache SLAB_TYPESAFE_BY_RCU Suren Baghdasaryan
2024-12-09 17:35   ` Klara Modin
2024-12-09 20:28     ` Suren Baghdasaryan
2024-12-09 22:19       ` Suren Baghdasaryan
2024-12-10 12:06   ` Vlastimil Babka
2024-12-10 16:23     ` Suren Baghdasaryan
2024-12-10 14:21   ` Vlastimil Babka
2024-12-10 16:20     ` Suren Baghdasaryan
2024-12-10 16:32       ` Vlastimil Babka
2024-12-10 17:16         ` Suren Baghdasaryan
2024-12-10 17:25           ` Vlastimil Babka
2024-12-10 18:53             ` Suren Baghdasaryan
2024-12-10 23:01             ` Suren Baghdasaryan
2024-12-11 15:30               ` Suren Baghdasaryan
2024-12-11 16:05                 ` Vlastimil Babka
2024-12-11 16:14                   ` Suren Baghdasaryan
2024-12-06 22:52 ` [PATCH v5 5/6] mm/slab: allow freeptr_offset to be used with ctor Suren Baghdasaryan
2024-12-10 11:01   ` Vlastimil Babka
2024-12-06 22:52 ` [PATCH v5 6/6] docs/mm: document latest changes to vm_lock Suren Baghdasaryan
2024-12-07  3:23   ` Randy Dunlap
2024-12-07  4:24     ` Akira Yokosawa [this message]
2024-12-07 17:33       ` Suren Baghdasaryan
2024-12-07  4:29 ` [PATCH v5 0/6] move per-vma lock into vm_area_struct Andrew Morton

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=c7cee2d4-5bbd-4867-ac12-a0a2f73f6c44@gmail.com \
    --to=akiyks@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=brauner@kernel.org \
    --cc=corbet@lwn.net \
    --cc=dave@stgolabs.net \
    --cc=david@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=hannes@cmpxchg.org \
    --cc=hdanton@sina.com \
    --cc=hughd@google.com \
    --cc=jannh@google.com \
    --cc=kernel-team@android.com \
    --cc=liam.howlett@oracle.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@suse.com \
    --cc=minchan@google.com \
    --cc=mjguzik@gmail.com \
    --cc=oleg@redhat.com \
    --cc=oliver.sang@intel.com \
    --cc=pasha.tatashin@soleen.com \
    --cc=paulmck@kernel.org \
    --cc=peterx@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=shakeel.butt@linux.dev \
    --cc=souravpanda@google.com \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.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