Re: [PATCH v4 04/10] mm/vma: add+use vma lockdep acquire/release defines

From: Lorenzo Stoakes

Date: Wed Jan 28 2026 - 06:46:55 EST


On Wed, Jan 28, 2026 at 12:18:32PM +0100, Sebastian Andrzej Siewior wrote:
> On 2026-01-23 20:12:14 [+0000], Lorenzo Stoakes wrote:
> > The code is littered with inscrutable and duplicative lockdep incantations,
> > replace these with defines which explain what is going on and add
> > commentary to explain what we're doing.
> >
> > If lockdep is disabled these become no-ops. We must use defines so _RET_IP_
> > remains meaningful.
> >
> > These are self-documenting and aid readability of the code.
> >
> > Additionally, instead of using the confusing rwsem_*() form for something
> > that is emphatically not an rwsem, we instead explicitly use
> > lock_[acquired, release]_shared/exclusive() lockdep invocations since we
> > are doing something rather custom here and these make more sense to use.
> >
> > No functional change intended.
>
> This is just "replace rwsem macro with our own macro" which is fine. The
> subject confused me because I expected something new to see ;)

Haha well yeah, I mean it's been a bit of a journey actually, reminding myself
of how we actually use lockdep with the VMA locks and then, in real time,
realising how broken a 'is held' can be, so in general I think we got to a good
place!

>
> Reviewed-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>

Thanks!

>
> Sebastian

Cheers, Lorenzo