linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Gordeev <agordeev@linux.ibm.com>
To: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: "David Hildenbrand (Arm)" <david@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Gerald Schaefer <gerald.schaefer@linux.ibm.com>,
	Heiko Carstens <hca@linux.ibm.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	linux-s390@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 1/2] mm: make lazy MMU mode context-aware
Date: Sat, 11 Apr 2026 11:31:00 +0200	[thread overview]
Message-ID: <630ce949-2f9c-43ce-9641-b9a4dc729323-agordeev@linux.ibm.com> (raw)
In-Reply-To: <c27cad07-bba4-472d-8853-fc6fc55e951f@arm.com>

On Tue, Mar 31, 2026 at 04:15:23PM +0200, Kevin Brodsky wrote:
> On 25/03/2026 17:20, Alexander Gordeev wrote:
> > On Wed, Mar 25, 2026 at 10:55:23AM +0100, David Hildenbrand (Arm) wrote:
> >
> > Hi David,
> >
> >>> +/**
> >>> + * lazy_mmu_mode_enable_pte() - Enable the lazy MMU mode with parameters
> >> You have to be a lot clearer about implications. For example, what
> >> happens if we would bail out and not process all ptes? What are the
> >> exact semantics.
> > The only implication is "only this address/PTE range could be updated
> > and that range may span one page table at most".
> >
> > Whether all or portion of PTEs were actually updated is not defined,
> > just like in case of lazy_mmu_mode_enable_pte().
> >
> > Makes sense?
> 
> I also feel that the comment needs to be much more specific. From a
> brief glance at patch 2, it seems that __ipte_batch_set_pte() assumes
> that all PTEs processed after this function is called are contiguous.

No, this is actually not the case. __ipte_batch_set_pte() just sets
ceilings for later processing. The PTEs within the range could be
updated in any order and not necessarily all of them.

> This should be documented.

Will do.

> > I will also change arch_enter_lazy_mmu_mode_pte() to
> > arch_enter_lazy_mmu_mode_for_pte_range() then.
> 
> Makes sense. The interface looks reasonable to me with this new name.
> 
> One more comment though: in previous discussions you mentioned the need
> for arch_{pause,resume} hooks, is that no longer necessary simply
> because {pause,resume} are not used on the paths where you make use of
> the new enable function?

Yes. I did implement arch_pause|resume_lazy_mmu_mode() for a custom
KASAN sanitizer to catch direct PTE dereferences - ones that bypass
ptep_get()/set_pte() in lazy mode.

But that code is not upstreamed and therefore there is no need to
introduce the hooks just right now.

> - Kevin

Thanks for the review, Kevin!


  reply	other threads:[~2026-04-11  9:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-25  7:41 [RFC PATCH 0/2] s390/mm: Batch PTE updates in lazy MMU mode Alexander Gordeev
2026-03-25  7:41 ` [RFC PATCH 1/2] mm: make lazy MMU mode context-aware Alexander Gordeev
2026-03-25  9:55   ` David Hildenbrand (Arm)
2026-03-25 16:20     ` Alexander Gordeev
2026-03-25 16:37       ` Alexander Gordeev
2026-03-31 14:15       ` Kevin Brodsky
2026-04-11  9:31         ` Alexander Gordeev [this message]
2026-03-31 21:11       ` David Hildenbrand (Arm)
2026-03-25  7:41 ` [RFC PATCH 2/2] s390/mm: Batch PTE updates in lazy MMU mode Alexander Gordeev

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=630ce949-2f9c-43ce-9641-b9a4dc729323-agordeev@linux.ibm.com \
    --to=agordeev@linux.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=borntraeger@linux.ibm.com \
    --cc=david@kernel.org \
    --cc=gerald.schaefer@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=kevin.brodsky@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-s390@vger.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