linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/11] x86: WARN() hackery
@ 2025-06-07  9:42 Peter Zijlstra
  2025-06-07  9:42 ` [PATCH 01/11] x86: Provide assembly __bug_table helpers Peter Zijlstra
                   ` (12 more replies)
  0 siblings, 13 replies; 17+ messages in thread
From: Peter Zijlstra @ 2025-06-07  9:42 UTC (permalink / raw)
  To: x86; +Cc: linux-kernel, peterz, kees, acarmina, jpoimboe, mark.rutland,
	torvalds

Hi,

Slightly less mad this time :-)

The primary purpose of all this is to get the WARN() printk() and
__warn() calls into the same context. Notably the current state is that
WARN() ends up doing printk() in-place, then takes an exception and has
the exception do the __warn().

The problem with all this is the ONCE logic. Normal WARN_ON_ONCE()
(without the printk) has the ONCE logic in the exception
(__report_bug()). But because WARN() essentially results in two distinct
actions (printk + trap) this cannot work.  With the result that
additional ONCE logic is sprinkled around for each such site.

Current proposals look to make this worse by adding KUnit checks for all
this, including regular WARN. Making the per-instance code overhead even
worse.

As such, by moving the printk() into the exception, and having the
exception (__report_bug() in fact) do everything, we get rid of the
external ONCE logic and provide a cental place for additional conditions
without need to litter all the instances.


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2025-07-09  9:33 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-07  9:42 [PATCH 00/11] x86: WARN() hackery Peter Zijlstra
2025-06-07  9:42 ` [PATCH 01/11] x86: Provide assembly __bug_table helpers Peter Zijlstra
2025-06-07  9:42 ` [PATCH 02/11] bug: Add BUG_FORMAT infrastructure Peter Zijlstra
2025-06-07  9:42 ` [PATCH 03/11] bug: Clean up CONFIG_GENERIC_BUG_RELATIVE_POINTERS Peter Zijlstra
2025-06-07  9:42 ` [PATCH 04/11] bug: Add BUG_FORMAT_ARGS infrastructure Peter Zijlstra
2025-06-07  9:42 ` [PATCH 05/11] bug: Add report_bug_entry() Peter Zijlstra
2025-06-07  9:42 ` [PATCH 06/11] bug: Allow architectures to provide __WARN_printf() Peter Zijlstra
2025-06-07  9:42 ` [PATCH 07/11] x86_64/bug: Add BUG_FORMAT basics Peter Zijlstra
2025-06-07  9:42 ` [PATCH 08/11] x86_64/bug: Implement __WARN_printf() Peter Zijlstra
2025-06-07 10:08   ` Peter Zijlstra
2025-06-07  9:42 ` [PATCH 09/11] x86/bug: Implement WARN_ONCE() Peter Zijlstra
2025-06-07  9:42 ` [PATCH 10/11] x86: Clean up default rethunk warning Peter Zijlstra
2025-06-07  9:42 ` [PATCH 11/11] x86_64/bug: Inline the UD1 Peter Zijlstra
2025-06-07 14:22 ` [PATCH 00/11] x86: WARN() hackery Linus Torvalds
2025-07-03 13:40 ` Maxime Ripard
2025-07-03 13:47   ` Peter Zijlstra
2025-07-09  9:33     ` Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).