]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sh: remove use of PG_arch_1 on individual pages
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 26 Mar 2024 17:10:23 +0000 (17:10 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 26 Apr 2024 03:56:13 +0000 (20:56 -0700)
Patch series "Various page->flags cleanups".

The first two patches are bug fixes, although I'm not sure that either
architecture will have noticed.  There aren't a lot of uses of page->flags
left!  The big build-up here is to reworking stable_page_flags(), which
will definitely be a user-visible change.  I think a welcome one, given
the special case we had to spread the Slab flag into all tail pages.

This patch (of 10):

Since switching to the new page table range API, we do not set the
PG_arch_1 (aka dcache clean) flag on tail pages, only on the folio.  Test
it on the folio.  Also use page_mapped() instead of page_mapcount() as it
is more efficient.

[akpm@linux-foundation.org: fix folio_flags call]
Link: https://lkml.kernel.org/r/20240326171045.410737-1-willy@infradead.org
Link: https://lkml.kernel.org/r/20240326171045.410737-2-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/sh/mm/cache-sh4.c

index 862046f26981b61d4938c490ae0e09dff968cb26..9a1e581cd192d1b9d8f3aef30c38dc5457855c78 100644 (file)
@@ -241,13 +241,14 @@ static void sh4_flush_cache_page(void *args)
        if ((vma->vm_mm == current->active_mm))
                vaddr = NULL;
        else {
+               struct folio *folio = page_folio(page);
                /*
                 * Use kmap_coherent or kmap_atomic to do flushes for
                 * another ASID than the current one.
                 */
                map_coherent = (current_cpu_data.dcache.n_aliases &&
-                       test_bit(PG_dcache_clean, &page->flags) &&
-                       page_mapcount(page));
+                       test_bit(PG_dcache_clean, folio_flags(folio, 0)) &&
+                       page_mapped(page));
                if (map_coherent)
                        vaddr = kmap_coherent(page, address);
                else