lkml.org 
[lkml]   [2020]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [tip: locking/core] lockdep: Annotate irq_work
On 2020-03-21 17:40:58 [+0100], Frederic Weisbecker wrote:
> > diff --git a/include/linux/irqflags.h b/include/linux/irqflags.h
> > index 9c17f9c..f23f540 100644
> > --- a/include/linux/irqflags.h
> > +++ b/include/linux/irqflags.h
> > @@ -69,6 +69,17 @@ do { \
> > current->irq_config = 0; \
> > } while (0)
> >
> > +# define lockdep_irq_work_enter(__work) \
> > + do { \
> > + if (!(atomic_read(&__work->flags) & IRQ_WORK_HARD_IRQ))\
> > + current->irq_config = 1; \
>
> So, irq_config == 1 means we are in a softirq? Are there other values for
> irq_config? In which case there should be enums or something?
> I can't find the patch that describes this.

0 means as-is, 1 means threaded / sleeping locks are okay.

> > --- a/kernel/time/tick-sched.c
> > +++ b/kernel/time/tick-sched.c
> > @@ -245,6 +245,7 @@ static void nohz_full_kick_func(struct irq_work *work)
> >
> > static DEFINE_PER_CPU(struct irq_work, nohz_full_kick_work) = {
> > .func = nohz_full_kick_func,
> > + .flags = ATOMIC_INIT(IRQ_WORK_HARD_IRQ),
> > };
>
> I get why these need to be in hardirq but some basic explanations for
> ordinary mortals as to why those two specifically and not all the others
> (and there are many) would have been nice.

Is the documentation patch in this series any good?

> Thanks.

Sebastian

\
 
 \ /
  Last update: 2020-03-21 19:13    [W:0.064 / U:0.684 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site