Re: [PATCH] mm/vma: predicate vma_assert_stabilised() on CONFIG_DEBUG_VM
From: Lorenzo Stoakes (ARM)
Date: Tue Nov 10 2026 - 11:24:25 EST
On Tue, Nov 10, 2026 at 04:07:48PM +0000, Lorenzo Stoakes (ARM) wrote:
> Andrew - could you update as below?
>
> Thanks!
>
> On Tue, Nov 10, 2026 at 03:10:40PM +0000, Lorenzo Stoakes (ARM) wrote:
> [ ... ]
> > diff --git a/include/linux/mmap_lock.h b/include/linux/mmap_lock.h
> > index 9ccbbcbd7aca..9c3a9c6525c1 100644
> > --- a/include/linux/mmap_lock.h
> > +++ b/include/linux/mmap_lock.h
> [ ... ]
> > /**
> > * vma_assert_stabilised() - assert that this VMA cannot be changed from
> > * underneath us either by having a VMA or mmap lock held.
> > @@ -418,9 +423,18 @@ static inline void vma_assert_locked(const struct vm_area_struct *vma)
> > *
> > * With lockdep disabled we may sometimes race with other threads acquiring the
> > * mmap read lock simultaneous with our VMA read lock.
> > + *
> > + * Assert only if CONFIG_DEBUG_VM is set.
Also this should say:
'Assert only if CONFIG_DEBUG_VM or CONFIG_LOCKDEP is set.'
> > */
> > static inline void vma_assert_stabilised(const struct vm_area_struct *vma)
> > {
> > + if (!IS_ENABLED(CONFIG_DEBUG_VM))
>
> Actually I think this should be:
>
> if (!IS_ENABLED(CONFIG_DEBUG_VM) || !IS_ENABLED(CONFIG_LOCKDEP))
Sorry this should be...
if (!IS_ENABLED(CONFIG_DEBUG_VM) && !IS_ENABLED(CONFIG_LOCKDEP))
(I have a bit of a fever today, can you tell? :P)
Thanks!
--
Cheers, Lorenzo