From: David Hildenbrand (Arm) Date: Mon, 27 Apr 2026 11:43:14 +0000 (+0200) Subject: sh: use folio_mapped() instead of page_mapped() in sh4_flush_cache_page() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8803f883310a886e701fa282eaae3a6658b10091;p=thirdparty%2Fkernel%2Fstable.git sh: use folio_mapped() instead of page_mapped() in sh4_flush_cache_page() Patch series "mm: remove page_mapped()". While preparing my slides for an LSF/MM talk, I realized that I did not yet remove page_mapped(). So let's do that. In the BPF arena code it's unclear which memdesc we would want to allocate in the future: certainly something with a refcount, but likely none with a mapcount. So let's just rely on the page refcount instead to decide whether we want to try zapping the page from user page tables. This patch (of 3): We already have the folio in our hands, so let's just use folio_mapped(). Link: https://lore.kernel.org/20260427-page_mapped-v1-0-e89c3592c74c@kernel.org Link: https://lore.kernel.org/20260427-page_mapped-v1-1-e89c3592c74c@kernel.org Signed-off-by: David Hildenbrand (Arm) Reviewed-by: Matthew Wilcox (Oracle) Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Eduard Zingerman Cc: Harry Yoo Cc: Jann Horn Cc: Jiri Olsa Cc: John Paul Adrian Glaubitz Cc: Kumar Kartikeya Dwivedi Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Martin KaFai Lau Cc: Michal Hocko Cc: Mike Rapoport Cc: Rich Felker Cc: Rik van Riel Cc: Song Liu Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Yonghong Song Cc: Yoshinori Sato Signed-off-by: Andrew Morton --- diff --git a/arch/sh/mm/cache-sh4.c b/arch/sh/mm/cache-sh4.c index 83fb34b39ca7c..8bc9ce541c141 100644 --- a/arch/sh/mm/cache-sh4.c +++ b/arch/sh/mm/cache-sh4.c @@ -248,7 +248,7 @@ static void sh4_flush_cache_page(void *args) */ map_coherent = (current_cpu_data.dcache.n_aliases && test_bit(PG_dcache_clean, folio_flags(folio, 0)) && - page_mapped(page)); + folio_mapped(folio)); if (map_coherent) vaddr = kmap_coherent(page, address); else