LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [Patch] panic.c
@ 2007-08-05 15:28 Jörg Hoffmann
  2007-08-05 15:35 ` Jan Engelhardt
  0 siblings, 1 reply; 3+ messages in thread
From: Jörg Hoffmann @ 2007-08-05 15:28 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 896 bytes --]

Hello everybody,
(This is the first time i send in a patch, so correct me if I’m doing
something wrong)
This patch causes the cpu to stop instead of using an endless loop (I’m
not sure if this works with the watchdog so please take a review).
The idea behind this is to keep the power usage on panic’d machines
(without auto-reboot) low. Another point is in an Virtual Machine
environment the process of the VM is using 100% of the host-cpu. This
would stuck other programs or VMs. This patch brings the VM to stop and
keeps the cpu usage below 1%.
 
I have tested the patch in an VM, the only change is mdelay(); to
cpu_idle(); it doesn’t need more libs and should have no special
depencies to consider.
The panic-blink doesn’t work further so it might be removed if there is
no better way.
 
Maybe someone has an better idea for this ‘problem’
 
Greetings
Jörg Hoffmann
 

[-- Attachment #2: panic.c.diff --]
[-- Type: application/octet-stream, Size: 260 bytes --]

10a11,15
> 
> /*
>  * Modification History kernel/panic.c
>  * 05/08/07	The Kernel stops the CPU on panic if the reboot= parameter isn't set to keep the cpu/power usage low.	- JÃrg Hoffmann
>  */
22d26
< 
137c141
< 		mdelay(1);
---
> 		cpu_idle();

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

* Re: [Patch] panic.c
  2007-08-05 15:28 [Patch] panic.c Jörg Hoffmann
@ 2007-08-05 15:35 ` Jan Engelhardt
  2007-08-05 20:14   ` Heiko Carstens
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Engelhardt @ 2007-08-05 15:35 UTC (permalink / raw)
  To: Jörg Hoffmann; +Cc: linux-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1198 bytes --]


On Aug 5 2007 17:28, Jörg Hoffmann wrote:
>Hello everybody,
>(This is the first time i send in a patch, so correct me if I’m doing
>something wrong)

See Documentation/SubmittingPatches. (And perhaps, U+0092 should be replaced by
something visible ;-)

>This patch causes the cpu to stop instead of using an endless loop (I’m
>not sure if this works with the watchdog so please take a review).
>The idea behind this is to keep the power usage on panic’d machines
>(without auto-reboot) low. Another point is in an Virtual Machine
>environment the process of the VM is using 100% of the host-cpu. This
>would stuck other programs or VMs. This patch brings the VM to stop and
>keeps the cpu usage below 1%.
> 
>I have tested the patch in an VM, the only change is mdelay(); to
>cpu_idle(); it doesn’t need more libs and should have no special
>depencies to consider.

cpu_idle() uses quite a lot of variables which may be invalid after a panic.

Something similar has been mentioned previously,
http://lkml.org/lkml/2006/6/19/303

>The panic-blink doesn’t work further so it might be removed if there is
>no better way.
> 
>Maybe someone has an better idea for this ‘problem’
> 

	Jan
-- 

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

* Re: [Patch] panic.c
  2007-08-05 15:35 ` Jan Engelhardt
@ 2007-08-05 20:14   ` Heiko Carstens
  0 siblings, 0 replies; 3+ messages in thread
From: Heiko Carstens @ 2007-08-05 20:14 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Jörg Hoffmann, linux-kernel

> >The idea behind this is to keep the power usage on panic’d machines
> >(without auto-reboot) low. Another point is in an Virtual Machine
> >environment the process of the VM is using 100% of the host-cpu. This
> >would stuck other programs or VMs. This patch brings the VM to stop and
> >keeps the cpu usage below 1%.

For VM environments it would be better to have an interface that tells
the hypervisor that your guest is dead. That's what the disabled_wait()
line in panic() is good for on s390.

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

end of thread, other threads:[~2007-08-05 20:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-05 15:28 [Patch] panic.c Jörg Hoffmann
2007-08-05 15:35 ` Jan Engelhardt
2007-08-05 20:14   ` Heiko Carstens

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).