[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190313155155.GN13351@linux.ibm.com>
Date: Wed, 13 Mar 2019 08:51:55 -0700
From: "Paul E. McKenney" <paulmck@...ux.ibm.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Joel Fernandes <joel@...lfernandes.org>,
linux-kernel@...r.kernel.org, rcu@...r.kernel.org,
jiangshanlai@...il.com, dipankar@...ibm.com,
mathieu.desnoyers@...icios.com, josh@...htriplett.org,
luto@...nel.org, byungchul.park@....com
Subject: Re: [PATCH tip/core/rcu 06/19] rcu: Add warning to detect
half-interrupts
On Wed, Mar 13, 2019 at 11:27:26AM -0400, Steven Rostedt wrote:
> On Wed, 13 Mar 2019 11:09:48 -0400
> Joel Fernandes <joel@...lfernandes.org> wrote:
>
> > AFAICS, lockdep does not specifically track when we enter an interrupt, but
> > rather only tracks when interrupts are enabled/disabled.
>
> It does:
>
> #define __irq_enter() \
> do { \
> account_irq_enter_time(current); \
> preempt_count_add(HARDIRQ_OFFSET); \
> trace_hardirq_enter(); \
> } while (0)
>
> # define trace_hardirq_enter() \
> do { \
> current->hardirq_context++; \
> } while (0)
>
>
> And if the hardirq_context ever does not match "in_irq()" lockdep will
> complain loudly.
Good to know, thank you!
Does this mean that there is a better approach that Joel's suggestion?
I believe he would end up with something like this:
WARN_ON_ONCE(IS_ENABLED(CONFIG_PROVE_RCU) && !in_irq());
It would be nice if there is something like this:
lockdep_assert_in_irq_handler();
But I haven't seen this. (Not that I have looked particularly hard for
such a thing, mind you!)
Thanx, Paul
Powered by blists - more mailing lists