* [PATCH 6.1.y] mm/mmu_notifier: convert !CONFIG_MMU_NOTIFIER range_init stubs to inline
@ 2026-12-04 13:19 A. Sverdlin
2026-12-04 13:21 ` David Hildenbrand (Arm)
2026-12-04 19:49 ` Sasha Levin
0 siblings, 2 replies; 3+ messages in thread
From: A. Sverdlin @ 2026-12-04 13:19 UTC (permalink / raw)
To: stable
Cc: Alexander Sverdlin, Greg Kroah-Hartman, Sasha Levin,
David Hildenbrand (Arm), Li Zhe, Andrew Morton, linux-mm
From: Alexander Sverdlin <alexander.sverdlin@siemens.com>
This is a stable-only fix for a 6.1.y build failure, mainline is not
affected.
When backporting upstream commit 92daa8652f88 ("mm/hugetlb: fix mremap
deadlock when PMD sharing is possible") to 6.1.y as 02e932981359, the
MMU notifier calls were moved into the __unmap_hugepage_range() wrapper.
The wrapper's local 'mm' is only passed to mmu_notifier_range_init(),
which without CONFIG_MMU_NOTIFIER is a macro discarding all arguments
except range, start and end. This breaks -Werror builds:
mm/hugetlb.c: In function '__unmap_hugepage_range':
mm/hugetlb.c:5509:27: error: unused variable 'mm' [-Werror=unused-variable]
struct mm_struct *mm = vma->vm_mm;
^~
Turn the !CONFIG_MMU_NOTIFIER mmu_notifier_range_init() and
mmu_notifier_range_init_owner() into static inline functions with the
same prototypes as in the CONFIG_MMU_NOTIFIER=y case, so that all
arguments are consumed and type-checked. No change in generated code.
Fixes: 02e932981359 ("mm/hugetlb: fix mremap deadlock when PMD sharing is possible")
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
---
Upstream 92daa8652f88 has no such variable, so there is nothing to
backport; the same conversion has been proposed for mainline as a
cleanup [1]. As mainline builds are not affected, it will carry neither
Fixes: nor Cc: stable there [2], and it would not apply to 6.1.y anyway,
because 6.1.y still has the vma argument removed upstream by commit
7d4a8be0c4b2 ("mm/mmu_notifier: remove unused
mmu_notifier_range_update_to_read_only export").
Build-tested on top of v6.1.193 with x86_64 defconfig,
CONFIG_MMU_NOTIFIER=n and -Werror, compiling all callers of
mmu_notifier_range_init{,_owner}(); the disassembly of these objects is
identical to v6.1.193. Build-tested for aarch64 as well.
[1] https://lore.kernel.org/all/20261203154538.1660381-1-alexander.sverdlin@siemens.com/
[2] https://lore.kernel.org/all/e088d36a-c052-4c8b-8070-8e7d938c3e79@kernel.org/
include/linux/mmu_notifier.h | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h
index e4ca5dd63bdd0..5e939b293b359 100644
--- a/include/linux/mmu_notifier.h
+++ b/include/linux/mmu_notifier.h
@@ -667,11 +667,21 @@ static inline void _mmu_notifier_range_init(struct mmu_notifier_range *range,
range->end = end;
}
-#define mmu_notifier_range_init(range,event,flags,vma,mm,start,end) \
- _mmu_notifier_range_init(range, start, end)
-#define mmu_notifier_range_init_owner(range, event, flags, vma, mm, start, \
- end, owner) \
- _mmu_notifier_range_init(range, start, end)
+static inline void mmu_notifier_range_init(struct mmu_notifier_range *range,
+ enum mmu_notifier_event event, unsigned int flags,
+ struct vm_area_struct *vma, struct mm_struct *mm,
+ unsigned long start, unsigned long end)
+{
+ _mmu_notifier_range_init(range, start, end);
+}
+
+static inline void mmu_notifier_range_init_owner(struct mmu_notifier_range *range,
+ enum mmu_notifier_event event, unsigned int flags,
+ struct vm_area_struct *vma, struct mm_struct *mm,
+ unsigned long start, unsigned long end, void *owner)
+{
+ _mmu_notifier_range_init(range, start, end);
+}
static inline bool
mmu_notifier_range_blockable(const struct mmu_notifier_range *range)
--
2.56.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH 6.1.y] mm/mmu_notifier: convert !CONFIG_MMU_NOTIFIER range_init stubs to inline
2026-12-04 13:19 [PATCH 6.1.y] mm/mmu_notifier: convert !CONFIG_MMU_NOTIFIER range_init stubs to inline A. Sverdlin
@ 2026-12-04 13:21 ` David Hildenbrand (Arm)
2026-12-04 19:49 ` Sasha Levin
1 sibling, 0 replies; 3+ messages in thread
From: David Hildenbrand (Arm) @ 2026-12-04 13:21 UTC (permalink / raw)
To: A. Sverdlin, stable
Cc: Greg Kroah-Hartman, Sasha Levin, Li Zhe, Andrew Morton, linux-mm
On 12/4/26 14:19, A. Sverdlin wrote:
> From: Alexander Sverdlin <alexander.sverdlin@siemens.com>
>
> This is a stable-only fix for a 6.1.y build failure, mainline is not
> affected.
>
> When backporting upstream commit 92daa8652f88 ("mm/hugetlb: fix mremap
> deadlock when PMD sharing is possible") to 6.1.y as 02e932981359, the
> MMU notifier calls were moved into the __unmap_hugepage_range() wrapper.
> The wrapper's local 'mm' is only passed to mmu_notifier_range_init(),
> which without CONFIG_MMU_NOTIFIER is a macro discarding all arguments
> except range, start and end. This breaks -Werror builds:
>
> mm/hugetlb.c: In function '__unmap_hugepage_range':
> mm/hugetlb.c:5509:27: error: unused variable 'mm' [-Werror=unused-variable]
> struct mm_struct *mm = vma->vm_mm;
> ^~
>
> Turn the !CONFIG_MMU_NOTIFIER mmu_notifier_range_init() and
> mmu_notifier_range_init_owner() into static inline functions with the
> same prototypes as in the CONFIG_MMU_NOTIFIER=y case, so that all
> arguments are consumed and type-checked. No change in generated code.
>
> Fixes: 02e932981359 ("mm/hugetlb: fix mremap deadlock when PMD sharing is possible")
> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
> ---
>
> Upstream 92daa8652f88 has no such variable, so there is nothing to
> backport; the same conversion has been proposed for mainline as a
> cleanup [1]. As mainline builds are not affected, it will carry neither
> Fixes: nor Cc: stable there [2], and it would not apply to 6.1.y anyway,
> because 6.1.y still has the vma argument removed upstream by commit
> 7d4a8be0c4b2 ("mm/mmu_notifier: remove unused
> mmu_notifier_range_update_to_read_only export").
>
> Build-tested on top of v6.1.193 with x86_64 defconfig,
> CONFIG_MMU_NOTIFIER=n and -Werror, compiling all callers of
> mmu_notifier_range_init{,_owner}(); the disassembly of these objects is
> identical to v6.1.193. Build-tested for aarch64 as well.
>
> [1] https://lore.kernel.org/all/20261203154538.1660381-1-alexander.sverdlin@siemens.com/
> [2] https://lore.kernel.org/all/e088d36a-c052-4c8b-8070-8e7d938c3e79@kernel.org/
>
> include/linux/mmu_notifier.h | 20 +++++++++++++++-----
> 1 file changed, 15 insertions(+), 5 deletions(-)
>
> diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h
> index e4ca5dd63bdd0..5e939b293b359 100644
> --- a/include/linux/mmu_notifier.h
> +++ b/include/linux/mmu_notifier.h
> @@ -667,11 +667,21 @@ static inline void _mmu_notifier_range_init(struct mmu_notifier_range *range,
> range->end = end;
> }
>
> -#define mmu_notifier_range_init(range,event,flags,vma,mm,start,end) \
> - _mmu_notifier_range_init(range, start, end)
> -#define mmu_notifier_range_init_owner(range, event, flags, vma, mm, start, \
> - end, owner) \
> - _mmu_notifier_range_init(range, start, end)
> +static inline void mmu_notifier_range_init(struct mmu_notifier_range *range,
> + enum mmu_notifier_event event, unsigned int flags,
> + struct vm_area_struct *vma, struct mm_struct *mm,
> + unsigned long start, unsigned long end)
> +{
> + _mmu_notifier_range_init(range, start, end);
> +}
> +
> +static inline void mmu_notifier_range_init_owner(struct mmu_notifier_range *range,
> + enum mmu_notifier_event event, unsigned int flags,
> + struct vm_area_struct *vma, struct mm_struct *mm,
> + unsigned long start, unsigned long end, void *owner)
> +{
> + _mmu_notifier_range_init(range, start, end);
> +}
>
> static inline bool
> mmu_notifier_range_blockable(const struct mmu_notifier_range *range)
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
--
Cheers,
David
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH 6.1.y] mm/mmu_notifier: convert !CONFIG_MMU_NOTIFIER range_init stubs to inline
2026-12-04 13:19 [PATCH 6.1.y] mm/mmu_notifier: convert !CONFIG_MMU_NOTIFIER range_init stubs to inline A. Sverdlin
2026-12-04 13:21 ` David Hildenbrand (Arm)
@ 2026-12-04 19:49 ` Sasha Levin
1 sibling, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2026-12-04 19:49 UTC (permalink / raw)
To: stable
Cc: Sasha Levin, Alexander Sverdlin, Greg Kroah-Hartman,
David Hildenbrand (Arm), Li Zhe, Andrew Morton, linux-mm
> This is a stable-only fix for a 6.1.y build failure, mainline is not
> affected.
Queued for 6.1, thanks.
--
Thanks,
Sasha
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-12-04 19:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 13:19 [PATCH 6.1.y] mm/mmu_notifier: convert !CONFIG_MMU_NOTIFIER range_init stubs to inline A. Sverdlin
2026-12-04 13:21 ` David Hildenbrand (Arm)
2026-12-04 19:49 ` Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox