]> www.infradead.org Git - nvme.git/commitdiff
mm/filemap: reinitialize folio->_mapcount directly
authorDavid Hildenbrand <david@redhat.com>
Wed, 29 May 2024 11:19:03 +0000 (13:19 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 4 Jul 2024 02:30:17 +0000 (19:30 -0700)
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 <david@redhat.com>
Tested-by: Sergey Senozhatsky <senozhatsky@chromium.org> [zram/zsmalloc workloads]
Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Mike Rapoport (IBM) <rppt@kernel.org>
Cc: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/filemap.c

index 876cc64aadd7ce6d76d0301fd8a08c8c05eab198..ea2d44fcd326f0cb0b51e1e362f1331befbb3cf3 100644 (file)
@@ -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);
                        }
                }