lkml.org 
[lkml]   [2019]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 23/28] locking/lockdep: Update irqsafe lock bitmaps
Thanks for review.

On Fri, 26 Apr 2019 at 03:55, Peter Zijlstra <peterz@infradead.org> wrote:
> > + if (!dir) {
> > + unsigned long *bitmaps[4] = {
> > + lock_classes_hardirq_safe,
> > + lock_classes_hardirq_safe_read,
> > + lock_classes_softirq_safe,
> > + lock_classes_softirq_safe_read
>
> That again should be something CPP magic using lockdep_states.h.

Yes.

> Also, that array can be static const, right? It's just an index into the
> static bitmaps.

Sure.

[...]
> > +static inline void remove_irqsafe_lock_bitmap(struct lock_class *class)
> > +{
> > +#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING)
> > + unsigned long usage = class->usage_mask;
> > +
> > + if (usage & LOCKF_USED_IN_HARDIRQ)
> > + __clear_bit(class - lock_classes, lock_classes_hardirq_safe);
> > + if (usage & LOCKF_USED_IN_HARDIRQ_READ)
> > + __clear_bit(class - lock_classes, lock_classes_hardirq_safe_read);
> > + if (usage & LOCKF_USED_IN_SOFTIRQ)
> > + __clear_bit(class - lock_classes, lock_classes_softirq_safe);
> > + if (usage & LOCKF_USED_IN_SOFTIRQ_READ)
> > + __clear_bit(class - lock_classes, lock_classes_softirq_safe_read);
>
> More CPP foo required here.

Definitely.

> Also, do we really need to test, we could
> just unconditionally clear the bits.

Actually, these tests are used later for another cause: we want to
know which safe usage may be changed by zapping this lock.

\
 
 \ /
  Last update: 2019-04-26 08:46    [W:0.051 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site