From: Peter Zijlstra <peterz@infradead.org>
To: Uriel Guajardo <urielguajardojr@gmail.com>
Cc: brendanhiggins@google.com, mingo@redhat.com, will@kernel.org,
urielguajardo@google.com, linux-kselftest@vger.kernel.org,
kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kunit: added lockdep support
Date: Mon, 10 Aug 2020 23:43:28 +0200 [thread overview]
Message-ID: <20200810214328.GM3982@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <20200810213257.438861-1-urielguajardojr@gmail.com>
On Mon, Aug 10, 2020 at 09:32:57PM +0000, Uriel Guajardo wrote:
> +static inline void kunit_check_locking_bugs(struct kunit *test,
> + unsigned long 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
> +#if IS_ENABLED(CONFIG_LOCKDEP)
> + local_irq_disable();
> + if (!debug_locks) {
> + kunit_set_failure(test);
> + lockdep_reset();
> + }
> + local_irq_enable();
> +#endif
> +}
Unless you can guarantee this runs before SMP brinup, that
lockdep_reset() is terminally broken.
next prev parent reply other threads:[~2020-08-10 21:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-10 21:32 [PATCH] kunit: added lockdep support Uriel Guajardo
2020-08-10 21:43 ` Peter Zijlstra [this message]
2020-08-11 17:03 ` Uriel Guajardo
2020-08-11 19:05 ` peterz
2020-08-11 22:22 ` Uriel Guajardo
-- strict thread matches above, loose matches on Subject: below --
2020-08-06 20:37 Uriel Guajardo
2020-08-06 20:43 ` Uriel Guajardo
2020-08-10 20:35 ` Brendan Higgins
2020-08-10 21:17 ` Uriel Guajardo
2020-08-10 21:25 ` Peter Zijlstra
2020-08-10 20:34 ` Brendan Higgins
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200810214328.GM3982@worktop.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=brendanhiggins@google.com \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=urielguajardo@google.com \
--cc=urielguajardojr@gmail.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox