[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <71c45f74-0fb5-4ec8-aa67-d700df94b617@lucifer.local>
Date: Wed, 28 Jan 2026 11:48:20 +0000
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
David Hildenbrand <david@...nel.org>,
"Liam R . Howlett" <Liam.Howlett@...cle.com>,
Vlastimil Babka <vbabka@...e.cz>, Mike Rapoport <rppt@...nel.org>,
Suren Baghdasaryan <surenb@...gle.com>, Michal Hocko <mhocko@...e.com>,
Shakeel Butt <shakeel.butt@...ux.dev>, Jann Horn <jannh@...gle.com>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org,
linux-rt-devel@...ts.linux.dev, Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
Boqun Feng <boqun.feng@...il.com>, Waiman Long <longman@...hat.com>,
Clark Williams <clrkwllms@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [PATCH v4 04/10] mm/vma: add+use vma lockdep acquire/release
defines
On Wed, Jan 28, 2026 at 12:37:49PM +0100, Sebastian Andrzej Siewior wrote:
> On 2026-01-23 20:12:14 [+0000], Lorenzo Stoakes wrote:
> > --- a/include/linux/mmap_lock.h
> > +++ b/include/linux/mmap_lock.h
> > @@ -78,6 +78,37 @@ static inline void mmap_assert_write_locked(const struct mm_struct *mm)
> …
> > +/* Only meaningful if CONFIG_LOCK_STAT is defined. */
> > +#define __vma_lockdep_stat_mark_acquired(vma) \
> > + lock_acquired(&vma->vmlock_dep_map, _RET_IP_)
> > +
>
> After going through the remaining series, I don't think I found a
> matching lock_contended(). So perf/ tracing just give you a few
> lock-acquired events. Wouldn't it make sense to also some
> lock_contended() events where the caller had to wait before it could
> acquire the lock?
Yeah I did wonder about this actually. The series really just abstracts this
part, so I think doing something with that should be a follow-up.
Suren - what was your intent with this? I did wonder what we actually really
accomplished with this.
VMA locks are always try-locks.
Write locks can't be contended against one another since VMAs are always a
per-process entity and not obtained remotely, so either a VMA is write-locked by
us or not write-locked, never write-locked by anybody else.
Read locks immediately give up if the VMA is write locked.
Would we want to record a lock_contended() event in that case I guess then?
I don't think we'd want to do that if the VMA were detached, only if it were
write-locked?
>
> Sebastian
Cheers, Lorenzo
Powered by blists - more mailing lists