[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200814205847.GK3982@worktop.programming.kicks-ass.net>
Date: Fri, 14 Aug 2020 22:58:47 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Uriel Guajardo <urielguajardojr@...il.com>
Cc: brendanhiggins@...gle.com, mingo@...hat.com, will@...nel.org,
linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
kunit-dev@...glegroups.com, urielguajardo@...gle.com,
alan.maguire@...cle.com
Subject: Re: [PATCH v3] kunit: added lockdep support
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.
> +
> + 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