Thread (68 messages) 68 messages, 3 authors, 2021-06-16

Re: [PATCH v11 09/33] mm: Add folio_try_get_rcu()

From: Christoph Hellwig <hch@infradead.org>
Date: 2021-06-15 06:26:26
Also in: linux-fsdevel, lkml

On Mon, Jun 14, 2021 at 09:14:11PM +0100, Matthew Wilcox (Oracle) wrote:
This is the equivalent of page_cache_get_speculative().  Also add
folio_ref_try_add_rcu (the equivalent of page_cache_add_speculative)
and folio_get_unless_zero() (the equivalent of get_page_unless_zero()).

The new kernel-doc attempts to explain from the user's point of view
when to use folio_try_get_rcu() and when to use folio_get_unless_zero(),
because there seems to be some confusion currently between the users of
page_cache_get_speculative() and get_page_unless_zero().

Reimplement page_cache_add_speculative() and page_cache_get_speculative()
as wrappers around the folio equivalents, but leave get_page_unless_zero()
alone for now.  This commit reduces text size by 3 bytes due to slightly
different register allocation & instruction selections.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Vlastimil Babka <redacted>
Reviewed-by: William Kucharski <redacted>
Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help