From: Carlos Bilbao <carlos.bilbao.osdev@gmail.com>
To: Thomas Gleixner <tglx@linutronix.de>,
pmladek@suse.com, Andrew Morton <akpm@linux-foundation.org>,
jani.nikula@intel.com, open list <linux-kernel@vger.kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
takakura@valinux.co.jp, john.ogness@linutronix.de
Subject: Re: [RFC] panic: reduce CPU consumption when finished handling panic
Date: Wed, 26 Mar 2025 10:10:17 -0500 [thread overview]
Message-ID: <ff14a8fc-a2f0-4bad-9687-86a88094151e@gmail.com> (raw)
In-Reply-To: <87wmci1a0j.ffs@tglx>
Hello,
On 3/21/25 14:03, Thomas Gleixner wrote:
> On Mon, Mar 17 2025 at 17:01, Carlos Bilbao wrote:
>> After the kernel has finished handling a panic, it enters a busy-wait loop.
>> But, this unnecessarily consumes CPU power and electricity. Plus, in VMs,
>> this negatively impacts the throughput of other VM guests running on the
>> same hypervisor.
>>
>> I propose introducing a function cpu_halt_end_panic() to halt the CPU
>> during this state while still allowing interrupts to be processed. See my
>> commit below.
> That's not the way how change logs are written. You explain the problem
> and then briefly how it is addressed.
>
> No proposal, no 'see below'. Such wording does not make any sense in a
> git commit. See Documentation/process/
>
>> @@ -276,6 +276,21 @@ static void panic_other_cpus_shutdown(bool crash_kexec)
>> crash_smp_send_stop();
> Your patch is malformed due to white space damage:
>
> patch: **** malformed patch at line 31: crash_smp_send_stop();
>
>> +static void cpu_halt_end_panic(void)
>> +{
>> +#ifdef CONFIG_X86
>> + native_safe_halt();
>> +#elif defined(CONFIG_ARM)
>> + cpu_do_idle();
>> +#else
>> + /*
>> + * Default to a simple busy-wait if no architecture-specific halt is
>> + * defined above
>> + */
>> + mdelay(PANIC_TIMER_STEP);
>> +#endif
> Architecture specific #ifdefs in core code are not the right way to
> go. Split this into three patches:
>
> 1) Add a weak fallback function
>
> void __weak cpu_halt_after_panic(void)
> {
> mdelay(PANIC_TIMER_STEP);
> }
>
> 2) Add non weak implementation in arch/x86
>
> native_safe_halt() is wrong vs. paravirtualization.
>
> safe_halt() is what you want.
>
> 3) Add non weak implementation for arch/arm
>
> Not my playground, so no comment
Sounds good, sending patch set now. Thanks for your time!
>
> Thanks,
>
> tglx
>
>
Thanks,
Carlos
prev parent reply other threads:[~2025-03-26 15:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-17 22:01 [RFC] panic: reduce CPU consumption when finished handling panic Carlos Bilbao
2025-03-18 12:09 ` Carlos Bilbao
2025-03-21 13:01 ` Carlos Bilbao
2025-03-21 19:03 ` Thomas Gleixner
2025-03-26 15:10 ` Carlos Bilbao [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=ff14a8fc-a2f0-4bad-9687-86a88094151e@gmail.com \
--to=carlos.bilbao.osdev@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=gregkh@linuxfoundation.org \
--cc=jani.nikula@intel.com \
--cc=john.ogness@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=pmladek@suse.com \
--cc=takakura@valinux.co.jp \
--cc=tglx@linutronix.de \
/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.