From: David Gow <david@davidgow.net>
To: Eric Biggers <ebiggers@kernel.org>, linux-crypto@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Ard Biesheuvel <ardb@kernel.org>,
"Jason A . Donenfeld" <Jason@zx2c4.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
kunit-dev@googlegroups.com,
Brendan Higgins <brendan.higgins@linux.dev>,
Rae Moar <raemoar63@gmail.com>
Subject: Re: [PATCH] kunit: irq: Unregister on-stack timer and work from debugobjects
Date: Thu, 6 Aug 2026 19:36:30 +0800 [thread overview]
Message-ID: <dae41fe0-60ff-4fa7-a7dc-2a3947aa08bb@davidgow.net> (raw)
In-Reply-To: <20260806053804.106724-1-ebiggers@kernel.org>
Le 06/08/2026 à 1:38 PM, Eric Biggers a écrit :
> In kunit_run_irq_test(), call destroy_hrtimer_on_stack() and
> destroy_work_on_stack() to unregister the hrtimer and work from the
> debugobjects infrastructure (when CONFIG_DEBUG_OBJECTS_TIMERS=y and
> CONFIG_DEBUG_OBJECTS_WORK=y) before the function returns.
>
> Found via code review; the lack of the unregistrations didn't actually
> cause a warning, since the objects are inactive upon return anyway. But
> they should be there, otherwise debugobjects keeps tracking the objects.
>
> Fixes: 950a81224e8b ("lib/crypto: tests: Add hash-test-template.h and gen-hash-testvecs.py")
> Signed-off-by: Eric Biggers <ebiggers@kernel.org>
> ---
>
> This patch is targeting libcrypto-next
Nice catch, thanks!
Reviewed-by: David Gow <david@davidgow.net>
Cheers,
-- David
>
> include/kunit/run-in-irq-context.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/include/kunit/run-in-irq-context.h b/include/kunit/run-in-irq-context.h
> index 3802b6fb218ed..b46fa1696360c 100644
> --- a/include/kunit/run-in-irq-context.h
> +++ b/include/kunit/run-in-irq-context.h
> @@ -137,6 +137,8 @@ static inline void kunit_run_irq_test(struct kunit *test, bool (*func)(void *),
> /* Cancel the timer and work. */
> hrtimer_cancel(&state.timer);
> flush_work(&state.bh_work);
> + destroy_hrtimer_on_stack(&state.timer);
> + destroy_work_on_stack(&state.bh_work);
>
> /* Sanity check: the timer and BH functions should have been run. */
> KUNIT_EXPECT_GT_MSG(test, atomic_read(&state.hardirq_func_calls), 0,
>
> base-commit: 4bceb5614e0fc0338d6787f39df5472bfd72eaab
next prev parent reply other threads:[~2026-08-06 11:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-06 5:38 [PATCH] kunit: irq: Unregister on-stack timer and work from debugobjects Eric Biggers
2026-08-06 11:36 ` David Gow [this message]
2026-08-07 22:04 ` Eric Biggers
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=dae41fe0-60ff-4fa7-a7dc-2a3947aa08bb@davidgow.net \
--to=david@davidgow.net \
--cc=Jason@zx2c4.com \
--cc=ardb@kernel.org \
--cc=brendan.higgins@linux.dev \
--cc=ebiggers@kernel.org \
--cc=herbert@gondor.apana.org.au \
--cc=kunit-dev@googlegroups.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=raemoar63@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.