All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Sebastian Andrzej Siewior" <bigeasy@linutronix.de>
Cc: sched-ext@lists.linux.dev
Subject: Re: [PATCH 1/2] bug: Provide WARN_ON.*DEFERRED() macros for console deferred output
Date: Wed, 24 Jun 2026 14:27:17 +0000	[thread overview]
Message-ID: <20260624142717.B32061F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260623142650.265721-2-bigeasy@linutronix.de>

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] Using guard(preempt) instead of guard(preempt_notrace) risks infinite tracing recursion.
- [Low] Missing semicolons after function/macro calls in the fallback implementation of WARN_ON_DEFERRED.
- [Low] Undeclared dependency on <linux/cleanup.h> and <linux/preempt.h> for guard(preempt).
--

commit 2038be49d63c72765117592b09ef0f46f0eef9d8
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

bug: Provide WARN_ON.*DEFERRED() macros for console deferred output

This commit introduces a deferred version of the WARN_ON() macro to delay
flushing the console until a later context. It implements WARN_ON_DEFERRED
and WARN_ON_ONCE_DEFERRED using printk_deferred_enter/exit() and extends
__report_bug() to handle the deferred case.

> diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
> index 09e8eccee8ed9..1e3ff00f709b8 100644
> --- a/include/asm-generic/bug.h
> +++ b/include/asm-generic/bug.h

[ ... ]

> @@ -159,6 +180,19 @@ extern __printf(1, 2) void __warn_printk(const char *fmt, ...);
>  })
>  #endif
>  
> +#ifndef WARN_ON_DEFERRED
> +#define WARN_ON_DEFERRED(condition) ({					\
> +	int __ret_warn_on = !!(condition);				\
> +	if (unlikely(__ret_warn_on)) {					\
> +		guard(preempt)();					\

[Severity: High]
Does this risk infinite recursion if WARN_ON_DEFERRED() is called from a
tracing context?

guard(preempt) expands to preempt_disable(), which is a traceable function. If
a deferred warning occurs in traced code, disabling preemption will re-trigger
the tracer, which may again trigger the warning.

Should this use guard(preempt_notrace)() to match the preempt_disable_notrace()
used in __report_bug()?

[Severity: Low]
Does this introduce an undeclared dependency on <linux/cleanup.h> and
<linux/preempt.h> for guard()?

Using WARN_ON_DEFERRED() in a file that does not indirectly include these
headers might lead to build failures on architectures using this fallback macro.

> +		printk_deferred_enter()					\
> +		__WARN();						\
> +		printk_deferred_exit()					\

[Severity: Low]
Are there missing semicolons after the printk_deferred_enter() and
printk_deferred_exit() calls?

This looks like it will cause a syntax error on architectures that do not
define __WARN_FLAGS and rely on this fallback macro.

> +	}								\
> +	unlikely(__ret_warn_on);					\
> +})
> +#endif

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260623142650.265721-1-bigeasy@linutronix.de?part=1

  parent reply	other threads:[~2026-06-24 14:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-23 14:26 [PATCH 0/2] sched: Introduce and use deferred WARNs in sched Sebastian Andrzej Siewior
2026-06-23 14:26 ` [PATCH 1/2] bug: Provide WARN_ON.*DEFERRED() macros for console deferred output Sebastian Andrzej Siewior
2026-06-23 14:54   ` K Prateek Nayak
2026-06-24  6:26     ` Sebastian Andrzej Siewior
2026-06-24  9:17       ` Petr Mladek
2026-06-24 15:24         ` Sebastian Andrzej Siewior
2026-06-23 15:12   ` Andrew Morton
2026-06-23 15:49     ` Petr Mladek
2026-06-24  8:37   ` Breno Leitao
2026-06-24 11:03     ` Sebastian Andrzej Siewior
2026-06-24  9:31   ` Peter Zijlstra
2026-06-24 10:08     ` Sebastian Andrzej Siewior
2026-06-24 14:27   ` sashiko-bot [this message]
2026-06-23 14:26 ` [PATCH 2/2] sched: Use WARN_ON.*_DEFERRED() Sebastian Andrzej Siewior
2026-06-24 14:27   ` sashiko-bot
2026-06-24  9:33 ` [PATCH 0/2] sched: Introduce and use deferred WARNs in sched Peter Zijlstra

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=20260624142717.B32061F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bigeasy@linutronix.de \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=sched-ext@lists.linux.dev \
    /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.