Re: [PATCH v2 6/6] s390/mm: Allow lazy MMU mode disabling

Heiko Carstens
2026-04-16T05:44:22Z

On Wed, Apr 15, 2026 at 05:01:24PM +0200, Alexander Gordeev wrote:
> Inroduce "lazy_mmu" kernel command line parameter
> to allow disabling of the lazy MMU mode on boot.
>
> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
> ---
> arch/s390/mm/ipte_batch.c | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)

...

> static DEFINE_PER_CPU(struct ipte_batch, ipte_range);
> +static DEFINE_STATIC_KEY_TRUE_RO(lazy_mmu);
> +
> +static int __init setup_lazy_mmu(char *str)
> +{
> + bool enable;
> +
> + if (kstrtobool(str, &enable)) {
> + pr_warn("Failed to setup lazy MMU mode, set to enabled\n");
> + } else if (!enable) {
> + pr_warn("Disabling lazy MMU mode\n");
> + static_key_disable(&lazy_mmu.key);
> + }
> +
> + return 0;
> +}
> +early_param("lazy_mmu", setup_lazy_mmu);
>
> static int count_contiguous(pte_t *start, pte_t *end, bool *valid)
> {
> @@ -169,6 +185,8 @@ void arch_enter_lazy_mmu_mode_for_pte_range(struct mm_struct *mm,
> {
> if (!test_facility(13))
> return;
> + if (!static_branch_likely(&lazy_mmu))
> + return;

Looks like there is an alternative chicken switch available: remove
facility bit 13 from the facility list via kernel command line option.

Unless I am mistaken: that should be sufficient and avoids adding more
code.