[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAG30Eef1RBj07_=KCJ5G2J0k3_pgL-hM6PiYba0Vf6O16WhnUQ@mail.gmail.com>
Date: Fri, 14 Aug 2020 16:00:06 -0500
From: Uriel Guajardo <urielguajardo@...gle.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Uriel Guajardo <urielguajardojr@...il.com>,
Brendan Higgins <brendanhiggins@...gle.com>, mingo@...hat.com,
will@...nel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"open list:KERNEL SELFTEST FRAMEWORK"
<linux-kselftest@...r.kernel.org>,
KUnit Development <kunit-dev@...glegroups.com>,
Alan Maguire <alan.maguire@...cle.com>
Subject: Re: [PATCH v3] kunit: added lockdep support
On Fri, Aug 14, 2020 at 3:58 PM Peter Zijlstra <peterz@...radead.org> wrote:
>
> On Fri, Aug 14, 2020 at 08:55:27PM +0000, Uriel Guajardo wrote:
> > +
> > +void kunit_check_lockdep(struct kunit *test, struct kunit_lockdep *lockdep) {
> > + int saved_preempt_count = lockdep->preempt_count;
> > + bool saved_debug_locks = lockdep->debug_locks;
> > +
> > + if (DEBUG_LOCKS_WARN_ON(preempt_count() != saved_preempt_count))
> > + preempt_count_set(saved_preempt_count);
> > +
> > +#ifdef CONFIG_TRACE_IRQFLAGS
> > + if (softirq_count())
> > + current->softirqs_enabled = 0;
> > + else
> > + current->softirqs_enabled = 1;
> > +#endif
>
> This block is pointless. The only way to get softirq tracing out of sync
> is an unbalanced local_bh_disable(), but then the above preempt_count()
> test will trigger and kill IRQ tracing.
Ahh I see. Thank you.
>
> > +
> > + if (saved_debug_locks && !debug_locks) {
> > + kunit_set_failure(test);
> > + kunit_warn(test, "Dynamic analysis tool failure from LOCKDEP.");
> > + kunit_warn(test, "Further tests will have LOCKDEP disabled.");
> > + }
> > +}
Powered by blists - more mailing lists