Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm: remove page_ref_sub_return()

With all callers converted to folios, we can act directly on
folio->_refcount.

Link: https://lkml.kernel.org/r/20240424191914.361554-5-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Matthew Wilcox (Oracle) and committed by
Andrew Morton
498aefbc 53e45c4f

+5 -10
+5 -10
include/linux/page_ref.h
··· 139 139 page_ref_sub(&folio->page, nr); 140 140 } 141 141 142 - static inline int page_ref_sub_return(struct page *page, int nr) 143 - { 144 - int ret = atomic_sub_return(nr, &page->_refcount); 145 - 146 - if (page_ref_tracepoint_active(page_ref_mod_and_return)) 147 - __page_ref_mod_and_return(page, -nr, ret); 148 - return ret; 149 - } 150 - 151 142 static inline int folio_ref_sub_return(struct folio *folio, int nr) 152 143 { 153 - return page_ref_sub_return(&folio->page, nr); 144 + int ret = atomic_sub_return(nr, &folio->_refcount); 145 + 146 + if (page_ref_tracepoint_active(page_ref_mod_and_return)) 147 + __page_ref_mod_and_return(&folio->page, -nr, ret); 148 + return ret; 154 149 } 155 150 156 151 static inline void page_ref_inc(struct page *page)