Re: Lockdep question regarding two-level locks

2020-08-22 Thread Michel Lespinasse
On Sat, Aug 22, 2020 at 9:04 AM Michel Lespinasse wrote: > - B's implementation could, when lockdep is enabled, always release > lock A before acquiring lock B. This is not ideal though, since this > would hinder testing of the not-blocked code path in the acquire > sequence. Actually, this may b

Re: Lockdep question regarding two-level locks

2020-08-22 Thread Michel Lespinasse
On Sat, Aug 22, 2020 at 9:39 AM wrote: > On Sat, Aug 22, 2020 at 09:04:09AM -0700, Michel Lespinasse wrote: > > Hi, > > > > I am wondering about how to describe the following situation to lockdep: > > > > - lock A would be something that's already implemented (a mutex or > > possibly a spinlock).

Re: Lockdep question regarding two-level locks

2020-08-22 Thread peterz
On Sat, Aug 22, 2020 at 09:04:09AM -0700, Michel Lespinasse wrote: > Hi, > > I am wondering about how to describe the following situation to lockdep: > > - lock A would be something that's already implemented (a mutex or > possibly a spinlock). > - lock B is a range lock, which I would be writing

Lockdep question regarding two-level locks

2020-08-22 Thread Michel Lespinasse
Hi, I am wondering about how to describe the following situation to lockdep: - lock A would be something that's already implemented (a mutex or possibly a spinlock). - lock B is a range lock, which I would be writing the code for (including lockdep hooks). I do not expect lockdep to know about ra