From: Heiko Carstens <hca@linux.ibm.com>
To: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Claudio Imbrenda <imbrenda@linux.ibm.com>,
Andrey Ryabinin <ryabinin.a.a@gmail.com>,
linux-s390@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com
Subject: Re: [PATCH v7 2/4] s390/mm: Batch PTE updates in lazy MMU mode
Date: Thu, 1 Oct 2026 10:21:43 +0200 [thread overview]
Message-ID: <20261001082143.23106A21-hca@linux.ibm.com> (raw)
In-Reply-To: <b66a61a4-a532-44ba-a1c6-26f02193fb05-agordeev@linux.ibm.com>
On Thu, Oct 01, 2026 at 10:00:55AM +0200, Alexander Gordeev wrote:
> On Mon, Aug 24, 2026 at 12:40:48PM +0200, Heiko Carstens wrote:
> > > +static __always_inline bool is_lazy_mmu_active(void)
> > > +{
> > > + if (__is_defined(__DECOMPRESSOR))
> > > + return false;
> > > + if (!get_lowcore()->lazy_mmu_count)
> > > + return false;
> >
> > I guess there is opportunity to generate better code here using an
> > alternative and using a flag output constraint too.
>
> It is only CY and LT instructions that make sense for me.
> Here is what I came up with:
...
> As result instead of gcc code:
>
> lghi %r8,0
> lt %r1,1032(%r8)
> je ...
>
> We get more or less the same:
>
> lhi %r1,0
> cy %r1,1032
> jne ...
>
> The only benefit is [zero] "d" (0) could sometimes avoid LHI if a
> zeroed register is already around. But also the KASAN coverage is
> not generated.
>
> Does it make sense to go ahead whith the alternative?
Not really. But why is lazy_mmu_count 32 bit? Do you expect a nesting
level of 2^32? :) If you would reduce that to one byte you could use
tmy or cliy.
next prev parent reply other threads:[~2026-10-01 8:21 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 11:32 [PATCH v7 0/4] s390/mm: Batch PTE updates in lazy MMU mode Alexander Gordeev
2026-08-17 11:32 ` [PATCH v7 1/4] mm: Make lazy MMU mode context-aware Alexander Gordeev
2026-08-17 11:49 ` sashiko-bot
2026-08-17 11:33 ` [PATCH v7 2/4] s390/mm: Batch PTE updates in lazy MMU mode Alexander Gordeev
2026-08-17 11:48 ` sashiko-bot
2026-08-24 10:40 ` Heiko Carstens
2026-08-26 12:00 ` Alexander Gordeev
2026-08-26 13:02 ` Heiko Carstens
2026-08-26 14:34 ` Alexander Gordeev
2026-08-27 8:11 ` Heiko Carstens
2026-08-27 11:39 ` Alexander Gordeev
2026-09-01 11:16 ` Alexander Gordeev
2026-09-01 11:21 ` Heiko Carstens
2026-10-01 8:00 ` Alexander Gordeev
2026-10-01 8:21 ` Heiko Carstens [this message]
2026-10-01 9:20 ` Alexander Gordeev
2026-10-01 15:41 ` Heiko Carstens
2026-10-02 8:43 ` Heiko Carstens
2026-10-02 12:30 ` Alexander Gordeev
2026-08-17 11:33 ` [PATCH v7 3/4] mm/kasan: Introduce helpers for lazy MMU mode sanitizer Alexander Gordeev
2026-08-17 11:43 ` sashiko-bot
2026-08-17 22:11 ` Andrey Konovalov
2026-08-18 12:01 ` Alexander Gordeev
2026-08-24 9:56 ` Heiko Carstens
2026-08-25 7:50 ` Alexander Gordeev
2026-08-25 10:08 ` Heiko Carstens
2026-08-17 11:33 ` [PATCH v7 4/4] s390/mm: Lazy " Alexander Gordeev
2026-08-17 11:40 ` sashiko-bot
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=20261001082143.23106A21-hca@linux.ibm.com \
--to=hca@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=gerald.schaefer@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-s390@vger.kernel.org \
--cc=ryabinin.a.a@gmail.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.