Re: Linux module for causing a system hard lock-up

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jun 14, 2011, at 9:23 PM, limp wrote:

> Thanks very much for that, it worked great! Would it be possible to give me
> a brief explanation on how this achieves the hard lockup (i.e. what does it
> actually do that leads to a lockup)?

If you look at 'stop_machine' method in kernel/stop_machine.c, as provided in [1], and check it further down the call chain, you'll see it basically calls 'stop_cpus', which will then run your 'func' method on each online cpu.

From the description of 'stop_cpus',

>  * Execute @fn(@arg) on online cpus in @cpumask.  On each target cpu,
>  * @fn is run in a process context with the highest priority
>  * preempting any task on the cpu and monopolizing it.  This function
>  * returns after all executions are complete.

If I understood it correctly, each cpu will be running your method 'func', which is an infinite loop that never sleeps, with the highest priority possible and, quoting, "monopolizing it". Hanging the machine with it seems only logical.

I hope this helps.


Cheers.

[1] - http://lxr.linux.no/#linux+v2.6.37.3/kernel/stop_machine.c#L476
[2] - http://lxr.linux.no/#linux+v2.6.37.3/kernel/stop_machine.c#L170

---
João Eduardo Luís
gpg key: 477C26E5 from pool.keyserver.eu 





Attachment: PGP.sig
Description: This is a digitally signed message part

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux