Re: [PATCH v8 10/15] s390/mm: Cleanup pXXp_flush_lazy() routines

From: Gerald Schaefer

Date: Tue Oct 13 2026 - 09:54:54 EST


On Wed, 7 Oct 2026 13:41:53 +0200
Alexander Gordeev <agordeev@xxxxxxxxxxxxx> wrote:

> Avoid unnecessary pgtable entry read in ptep_flush_lazy() and
> pmdp_flush_lazy() routines. Use the already obtained value of
> a pgtable entry instead of dereferencing it again.
>
> It might appear that the optimized out second dereferencing happens
> under mm_context_t::flush_count lock and therefore a race condition
> is possible. However, both routines write invalid entry bits to the
> pgtable entries and therefore no reader is allowed to interpret the
> rest of the value afterwards.
>
> Signed-off-by: Alexander Gordeev <agordeev@xxxxxxxxxxxxx>
> ---
> arch/s390/mm/pgtable.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

Looks good to me.

Reviewed-by: Gerald Schaefer <gerald.schaefer@xxxxxxxxxxxxx>