Re: [PATCH RFC 08/24] lockdep: Annotate lockdep assertions for capability analysis

2025-02-11 Thread Marco Elver
On Mon, 10 Feb 2025 at 19:54, Bart Van Assche wrote: > > > On 2/10/25 10:23 AM, Marco Elver wrote: > > If you try to write code where you access a guarded_by variable, but > > the lock is held not in all paths we can write it like this: > > > > struct bar { > >spinlock_t lock; > >bool a; /

Re: [PATCH RFC 08/24] lockdep: Annotate lockdep assertions for capability analysis

2025-02-10 Thread Bart Van Assche
On 2/10/25 10:23 AM, Marco Elver wrote: If you try to write code where you access a guarded_by variable, but the lock is held not in all paths we can write it like this: struct bar { spinlock_t lock; bool a; // true if lock held int counter __var_guarded_by(&lock); }; void foo(struct

Re: [PATCH RFC 08/24] lockdep: Annotate lockdep assertions for capability analysis

2025-02-10 Thread Marco Elver
On Mon, 10 Feb 2025 at 19:10, Bart Van Assche wrote: > > On 2/6/25 10:10 AM, Marco Elver wrote: > > diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h > > index 67964dc4db95..5cea929b2219 100644 > > --- a/include/linux/lockdep.h > > +++ b/include/linux/lockdep.h > > @@ -282,16 +282,16

Re: [PATCH RFC 08/24] lockdep: Annotate lockdep assertions for capability analysis

2025-02-10 Thread Bart Van Assche
On 2/6/25 10:10 AM, Marco Elver wrote: diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index 67964dc4db95..5cea929b2219 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h @@ -282,16 +282,16 @@ extern void lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie)