All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
	linux-mm@kvack.org, Svetly Todorov <svetly.todorov@memverge.com>
Subject: [PATCH 02/10] xtensa: Remove uses of PG_arch_1 on individual pages
Date: Tue, 26 Mar 2024 17:10:24 +0000	[thread overview]
Message-ID: <20240326171045.410737-3-willy@infradead.org> (raw)
In-Reply-To: <20240326171045.410737-1-willy@infradead.org>

Since switching to the new page table range API, we disregard the
PG_arch_1 (aka dcache dirty) flag on tail pages, and only pay attention
to it on the folio.  Fix these two missed spots where we were setting it
on arbitrary pages.

Reported-by: Svetly Todorov <svetly.todorov@memverge.com>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 arch/xtensa/mm/cache.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/xtensa/mm/cache.c b/arch/xtensa/mm/cache.c
index 7ec66a79f472..23be0e7516ce 100644
--- a/arch/xtensa/mm/cache.c
+++ b/arch/xtensa/mm/cache.c
@@ -87,12 +87,13 @@ static inline void *coherent_kvaddr(struct page *page, unsigned long base,
 
 void clear_user_highpage(struct page *page, unsigned long vaddr)
 {
+	struct folio *folio = page_folio(page);
 	unsigned long paddr;
 	void *kvaddr = coherent_kvaddr(page, TLBTEMP_BASE_1, vaddr, &paddr);
 
 	preempt_disable();
 	kmap_invalidate_coherent(page, vaddr);
-	set_bit(PG_arch_1, &page->flags);
+	set_bit(PG_arch_1, folio_flags(folio, 0));
 	clear_page_alias(kvaddr, paddr);
 	preempt_enable();
 }
@@ -101,6 +102,7 @@ EXPORT_SYMBOL(clear_user_highpage);
 void copy_user_highpage(struct page *dst, struct page *src,
 			unsigned long vaddr, struct vm_area_struct *vma)
 {
+	struct folio *folio = page_folio(dst);
 	unsigned long dst_paddr, src_paddr;
 	void *dst_vaddr = coherent_kvaddr(dst, TLBTEMP_BASE_1, vaddr,
 					  &dst_paddr);
@@ -109,7 +111,7 @@ void copy_user_highpage(struct page *dst, struct page *src,
 
 	preempt_disable();
 	kmap_invalidate_coherent(dst, vaddr);
-	set_bit(PG_arch_1, &dst->flags);
+	set_bit(PG_arch_1, folio_flags(folio, 0));
 	copy_page_alias(dst_vaddr, src_vaddr, dst_paddr, src_paddr);
 	preempt_enable();
 }
-- 
2.43.0



  parent reply	other threads:[~2024-03-26 17:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-26 17:10 [PATCH 00/10] Various page->flags cleanups Matthew Wilcox (Oracle)
2024-03-26 17:10 ` [PATCH 01/10] sh: Remove use of PG_arch_1 on individual pages Matthew Wilcox (Oracle)
2024-03-27 18:45   ` kernel test robot
2024-03-27 18:49     ` Matthew Wilcox
2024-03-26 17:10 ` Matthew Wilcox (Oracle) [this message]
2024-03-28 19:36   ` [PATCH 02/10] xtensa: Remove uses " Svetly Todorov
2024-03-28 19:40     ` Matthew Wilcox
2024-03-26 17:10 ` [PATCH 03/10] mm: Make page_ext_get() take a const argument Matthew Wilcox (Oracle)
2024-03-26 17:10 ` [PATCH 04/10] mm: Make folio_test_idle and folio_test_young " Matthew Wilcox (Oracle)
2024-03-26 17:10 ` [PATCH 05/10] mm: Make is_free_buddy_page() " Matthew Wilcox (Oracle)
2024-03-26 17:10 ` [PATCH 06/10] mm: Make page_mapped() " Matthew Wilcox (Oracle)
2024-03-26 17:10 ` [PATCH 07/10] mm: Convert arch_clear_hugepage_flags to take a folio Matthew Wilcox (Oracle)
2024-03-27 13:02   ` Ryan Roberts
2024-03-27 14:37     ` Matthew Wilcox
2024-03-27 15:48   ` kernel test robot
2024-03-27 17:01   ` kernel test robot
2024-03-26 17:10 ` [PATCH 08/10] slub: Remove use of page->flags Matthew Wilcox (Oracle)
2024-04-04 18:29   ` David Hildenbrand
2024-03-26 17:10 ` [PATCH 09/10] Remove references to page->flags in documentation Matthew Wilcox (Oracle)
2024-03-26 17:10 ` [PATCH 10/10] proc: Rewrite stable_page_flags() Matthew Wilcox (Oracle)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240326171045.410737-3-willy@infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=svetly.todorov@memverge.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.