linux-um.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Gordeev <agordeev@linux.ibm.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org, linux-arch@vger.kernel.org, x86@kernel.org,
	linux-s390@vger.kernel.org, sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org
Subject: Re: [PATCH 1/7] mm: Set the pte dirty if the folio is already dirty
Date: Wed, 19 Feb 2025 08:27:21 +0100	[thread overview]
Message-ID: <Z7WH2VPdFvX6reij@li-008a6a4c-3549-11b2-a85c-c5cc2836eea2.ibm.com> (raw)
In-Reply-To: <Z7S-HgdXls65goJx@casper.infradead.org>

On Tue, Feb 18, 2025 at 05:06:38PM +0000, Matthew Wilcox wrote:
...
> > With the above the implicit dirtifying of hugetlb PTEs (as result of
> > mk_huge_pte() -> mk_pte()) in make_huge_pte() is removed:
> > 
> > static pte_t make_huge_pte(struct vm_area_struct *vma, struct page *page,
> > 		bool try_mkwrite)
> > {
> > 	...
> > 	if (try_mkwrite && (vma->vm_flags & VM_WRITE)) {
> > 		entry = huge_pte_mkwrite(huge_pte_mkdirty(mk_huge_pte(page,
> > 					 vma->vm_page_prot)));
> > 	} else {
> > 		entry = huge_pte_wrprotect(mk_huge_pte(page,
> > 					   vma->vm_page_prot));
> > 	}
> 
> Took me a moment to spot how this was getting invoked; for anyone else
> playing along, it's mk_huge_pte() which calls mk_pte().
> 
> But I'm not sure how you lose out on the PTE being marked dirty.  In
> the first arm that you've quoted, the pte is made dirty anyway.  In the
> second arm, it's being writeprotected, so marking it dirty isn't a
> helpful thing to do because writing to it will cause a fault anyway?
> 
> I know s390 is a little different, so there's probably something I'm
> missing.

No, it is just me missing the obvious.


  reply	other threads:[~2025-02-19  7:28 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-17 19:08 [PATCH 0/7] Add folio_mk_pte() and simplify mk_pte() Matthew Wilcox (Oracle)
2025-02-17 19:08 ` [PATCH 1/7] mm: Set the pte dirty if the folio is already dirty Matthew Wilcox (Oracle)
2025-02-18 10:31   ` David Hildenbrand
2025-02-18 16:20   ` Alexander Gordeev
2025-02-18 17:06     ` Matthew Wilcox
2025-02-19  7:27       ` Alexander Gordeev [this message]
2025-02-19  7:33   ` Alexander Gordeev
2025-02-19  8:46     ` Alexander Gordeev
2025-02-17 19:08 ` [PATCH 2/7] mm: Introduce a common definition of mk_pte() Matthew Wilcox (Oracle)
2025-02-18  8:15   ` Geert Uytterhoeven
2025-02-18 10:32   ` David Hildenbrand
2025-02-19  9:07   ` Alexander Gordeev
2025-02-17 19:08 ` [PATCH 3/7] sparc32: Remove custom " Matthew Wilcox (Oracle)
2025-02-17 19:08 ` [PATCH 4/7] x86: " Matthew Wilcox (Oracle)
2025-02-19 20:53   ` Dave Hansen
2025-02-17 19:08 ` [PATCH 5/7] um: " Matthew Wilcox (Oracle)
2025-02-17 19:08 ` [PATCH 6/7] mm: Make mk_pte() definition unconditional Matthew Wilcox (Oracle)
2025-02-18 10:32   ` David Hildenbrand
2025-02-17 19:08 ` [PATCH 7/7] mm: Add folio_mk_pte() Matthew Wilcox (Oracle)
2025-02-18 10:33   ` David Hildenbrand
2025-02-18 10:29 ` [PATCH 0/7] Add folio_mk_pte() and simplify mk_pte() David Hildenbrand

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=Z7WH2VPdFvX6reij@li-008a6a4c-3549-11b2-a85c-c5cc2836eea2.ibm.com \
    --to=agordeev@linux.ibm.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-um@lists.infradead.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=willy@infradead.org \
    --cc=x86@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).