]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm: Add folio_try_get_rcu()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 10 May 2021 20:33:22 +0000 (16:33 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 13 Aug 2021 18:19:13 +0000 (14:19 -0400)
commit02b8405166579c9f9c3a92acb327d5b9cbef96b1
treed6d7f0443cbc01d20b122fa6b50284d0e5aab339
parentad2752ad96b47943301afb7547526db3a4e5b98b
mm: Add folio_try_get_rcu()

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 <vbabka@suse.cz>
Reviewed-by: William Kucharski <william.kucharski@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Mike Rapoport <rppt@linux.ibm.com>
include/linux/page_ref.h
include/linux/pagemap.h
mm/filemap.c