From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: kunit: Add backtrace suppression self-tests
Date: Sat, 16 May 2026 09:18:00 +1000 [thread overview]
Message-ID: <review-patch2-20260515-kunit_add_support-v13-2-18ee42f96e7b@redhat.com> (raw)
In-Reply-To: <20260515-kunit_add_support-v13-2-18ee42f96e7b@redhat.com>
Patch Review
Good test coverage. Tests exercise:
- Direct WARN with message (`backtrace_suppression_test_warn_direct`)
- Indirect WARN through a helper (`backtrace_suppression_test_warn_indirect`)
- Multiple warnings in one scope (`backtrace_suppression_test_warn_multi`)
- WARN_ON (no format string) (`backtrace_suppression_test_warn_on_direct/indirect`)
- Incremental counting (`backtrace_suppression_test_count`)
- Active state transitions (`backtrace_suppression_test_active_state`)
- Sequential independent scopes via direct API (`backtrace_suppression_test_multi_scope`)
- Cross-kthread isolation (`backtrace_suppression_test_cross_kthread`)
**Cross-kthread test:**
```c
+static void backtrace_suppression_test_cross_kthread(struct kunit *test)
+{
+ struct cross_kthread_data data;
+ struct task_struct *task;
+
+ data.was_active = false;
+ init_completion(&data.done);
+
+ kunit_warning_suppress(test) {
+ task = kthread_run(cross_kthread_fn, &data, "kunit-cross-test");
+ KUNIT_ASSERT_FALSE(test, IS_ERR(task));
+ wait_for_completion(&data.done);
+ kthread_stop(task);
+ }
+
+ KUNIT_EXPECT_FALSE(test, data.was_active);
+}
```
This is well-structured. The `kthread_stop()` is inside the suppress block so the kthread is guaranteed to be stopped before the suppression scope exits. The `while (!kthread_should_stop()) schedule();` loop in the kthread function ensures the kthread stays alive until `kthread_stop()` is called, avoiding use-after-free.
**Minor observation:** The helper functions `trigger_backtrace_warn()` and `trigger_backtrace_warn_on()` are marked `noinline`, which is important — without this, the compiler could inline them into the test function, and on some architectures the WARN path might behave differently with regard to the return address. Good.
**No issues found.**
---
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-15 23:18 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-15 12:29 [PATCH v13 0/4] kunit: Add support for suppressing warning backtraces Albert Esteve
2026-05-15 12:29 ` [PATCH v13 1/4] bug/kunit: Core " Albert Esteve
2026-05-15 13:36 ` Albert Esteve
2026-05-15 23:18 ` Claude review: " Claude Code Review Bot
2026-05-15 12:29 ` [PATCH v13 2/4] kunit: Add backtrace suppression self-tests Albert Esteve
2026-05-15 14:14 ` Albert Esteve
2026-05-15 23:18 ` Claude Code Review Bot [this message]
2026-05-15 12:29 ` [PATCH v13 3/4] drm: Suppress intentional warning backtraces in scaling unit tests Albert Esteve
2026-05-15 23:18 ` Claude review: " Claude Code Review Bot
2026-05-15 12:29 ` [PATCH v13 4/4] kunit: Add documentation for warning backtrace suppression API Albert Esteve
2026-05-15 23:18 ` Claude review: " Claude Code Review Bot
2026-05-15 13:51 ` [PATCH v13 0/4] kunit: Add support for suppressing warning backtraces Guenter Roeck
2026-05-15 14:25 ` Albert Esteve
2026-05-15 23:18 ` Claude review: " Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-05-15 8:52 [PATCH v12 0/4] " Albert Esteve
2026-05-15 8:52 ` [PATCH v12 2/4] kunit: Add backtrace suppression self-tests Albert Esteve
2026-05-15 23:36 ` Claude review: " Claude Code Review Bot
2026-05-14 11:06 [PATCH v11 0/4] kunit: Add support for suppressing warning backtraces Albert Esteve
2026-05-14 11:06 ` [PATCH v11 2/4] kunit: Add backtrace suppression self-tests Albert Esteve
2026-05-16 0:56 ` Claude review: " Claude Code Review Bot
2026-05-13 7:30 [PATCH v10 0/4] kunit: Add support for suppressing warning backtraces Albert Esteve
2026-05-13 7:30 ` [PATCH v10 2/4] kunit: Add backtrace suppression self-tests Albert Esteve
2026-05-16 2:29 ` Claude review: " Claude Code Review Bot
2026-05-04 7:41 [PATCH v8 0/4] kunit: Add support for suppressing warning backtraces Albert Esteve
2026-05-04 7:41 ` [PATCH v8 2/4] kunit: Add backtrace suppression self-tests Albert Esteve
2026-05-04 22:33 ` Claude review: " Claude Code Review Bot
2026-04-20 12:28 [PATCH v7 0/5] kunit: Add support for suppressing warning backtraces Albert Esteve
2026-04-20 12:28 ` [PATCH v7 3/5] kunit: Add backtrace suppression self-tests Albert Esteve
2026-04-22 23:52 ` Claude review: " Claude Code Review Bot
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=review-patch2-20260515-kunit_add_support-v13-2-18ee42f96e7b@redhat.com \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox