| From: David Hildenbrand <david@redhat.com> |
| Subject: mm/filemap: reinitialize folio->_mapcount directly |
| Date: Wed, 29 May 2024 13:19:03 +0200 |
| |
| 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 | 2 +- |
| 1 file changed, 1 insertion(+), 1 deletion(-) |
| |
| --- a/mm/filemap.c~mm-filemap-reinitialize-folio-_mapcount-directly |
| +++ a/mm/filemap.c |
| @@ -177,7 +177,7 @@ static void filemap_unaccount_folio(stru |
| * 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); |
| } |
| } |
| _ |