Skip to contentSkip to conversation

how to hard hang the kernel from userspace?

DISCUSSION Daniel Walker 2 participants 5 messages Dec 7, 2017 – Dec 8, 2017

lore
Share & tools
lore
#0 lore raw

Hi,

I was able to formulate this command,

echo -1 > /proc/sys/kernel/sched_rt_runtime_us
chrt -f 99 yes &> /dev/null

and it works sometimes on UP, but it doesn't work on SMP. I also tried adding in "taskset" to pin multiple version of the "yes" command to each cpu in the system, but that just resulted in lots of rcu warnings.

The goal is to make the watchdog trigger by starving out the watchdog petting process. Anyone have any ideas? I'd rather not make a kernel module.

Thanks,

Daniel

#1 lore raw
Quoted 1 line · Daniel Walker

and it works sometimes on UP, but it doesn't work on SMP. I also tried

Thinking about *why* that hangs a UP should explain why it doesn't work on SMP.

Quoted 2 lines

adding in "taskset" to pin multiple version of the "yes" command to each cpu in the system, but that just resulted in lots of rcu warnings.

That's.... unexpected.

Quoted 2 lines

The goal is to make the watchdog trigger by starving out the watchdog petting process. Anyone have any ideas? I'd rather not make a kernel module.

What are you trying to achieve by doing that?

Have you tried just pointing a 'kill -9' at the watchdog monitor process? Are you using in-kernel watchdogd, or one in userspace?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 486 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20171207/ec60fe15/attachment.bin

#2 lore raw
Quoted 9 lines · valdis.kletnieks at vt.edu
Quoted 1 line · Daniel Walker

and it works sometimes on UP, but it doesn't work on SMP. I also tried

Thinking about *why* that hangs a UP should explain why it doesn't work on SMP.

Quoted 2 lines

adding in "taskset" to pin multiple version of the "yes" command to each cpu in the system, but that just resulted in lots of rcu warnings.

That's.... unexpected.

May have to do with not being able to start them all instantly enough, something like that.

Quoted 6 lines
Quoted 2 lines

The goal is to make the watchdog trigger by starving out the watchdog petting process. Anyone have any ideas? I'd rather not make a kernel module.

What are you trying to achieve by doing that?

Have you tried just pointing a 'kill -9' at the watchdog monitor process? Are you using in-kernel watchdogd, or one in userspace?

So typically you have a process which updates the watchdog periodically which I call a petting process. As I said the purpose is to trigger the watchdog by starving the petting process (i.e. kick process) , then the watchdog reboots the system.

Daniel

#3 lore raw
Quoted 4 lines · Daniel Walker

So typically you have a process which updates the watchdog periodically which I call a petting process. As I said the purpose is to trigger the watchdog by starving the petting process (i.e. kick process) , then the watchdog reboots the system.

If you're doing the updating from userspace, a kill -9 will get the job done.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 486 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20171207/482d6acd/attachment.bin

#4 lore raw
Quoted 8 lines · valdis.kletnieks at vt.edu
Quoted 4 lines · Daniel Walker

So typically you have a process which updates the watchdog periodically which I call a petting process. As I said the purpose is to trigger the watchdog by starving the petting process (i.e. kick process) , then the watchdog reboots the system.

If you're doing the updating from userspace, a kill -9 will get the job done.

True, but that wasn't what I had in mind.. I was more interesting in simulating an actual lockup.

Daniel