From: David Hildenbrand Date: Wed, 29 May 2024 11:19:03 +0000 (+0200) Subject: mm/filemap: reinitialize folio->_mapcount directly X-Git-Tag: v6.11-rc1~85^2~233 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9bf46441ad86da901c902bf78df2d213cc601185;p=thirdparty%2Fkernel%2Fstable.git mm/filemap: reinitialize folio->_mapcount directly Let's get rid of the page_mapcount_reset() call and simply reinitialize folio->_mapcount directly. Link: https://lkml.kernel.org/r/20240529111904.2069608-6-david@redhat.com Signed-off-by: David Hildenbrand Tested-by: Sergey Senozhatsky [zram/zsmalloc workloads] Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Matthew Wilcox (Oracle) Cc: Mike Rapoport (IBM) Cc: Minchan Kim Signed-off-by: Andrew Morton --- diff --git a/mm/filemap.c b/mm/filemap.c index 876cc64aadd7c..ea2d44fcd326f 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -177,7 +177,7 @@ static void filemap_unaccount_folio(struct address_space *mapping, * and we'd rather not leak it: if we're wrong, * another bad page check should catch it later. */ - page_mapcount_reset(&folio->page); + atomic_set(&folio->_mapcount, -1); folio_ref_sub(folio, mapcount); } }