mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org, Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>
Subject: Re: [PATCH 2/2] Fix SCHED_WARN_ON()
Date: Tue, 28 Oct 2025 19:50:55 +0100	[thread overview]
Message-ID: <20251028185055.GD3419281@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20251028165059.682306-3-bvanassche@acm.org>

On Tue, Oct 28, 2025 at 09:50:58AM -0700, Bart Van Assche wrote:


> +#define SCHED_WARN_ON(x)				\
> +	({						\
> +		bool __ret = (x);			\
> +							\
> +		if (unlikely(__ret)) {			\
> +			unsigned long __flags;		\
> +							\
> +			local_irq_save(__flags);	\
> +			printk_deferred_enter();	\
> +			WARN_ONCE(__ret, #x);		\
> +			printk_deferred_exit();		\
> +			local_irq_restore(__flags);	\
> +		}					\
> +		unlikely(__ret);			\
> +	})

Also, this will generate absolutely atrocious code.

      parent reply	other threads:[~2025-10-28 18:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-28 16:50 [PATCH 0/2] Restore and fix SCHED_WARN_ON() Bart Van Assche
2025-10-28 16:50 ` [PATCH 1/2] Revert "sched/debug: Change SCHED_WARN_ON() to WARN_ON_ONCE()" Bart Van Assche
2025-10-28 16:50 ` [PATCH 2/2] Fix SCHED_WARN_ON() Bart Van Assche
2025-10-28 18:45   ` Peter Zijlstra
2025-10-28 18:50   ` Peter Zijlstra [this message]

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=20251028185055.GD3419281@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bvanassche@acm.org \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=vincent.guittot@linaro.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

all inboxes | Powered by JetHome®