lkml.org 
[lkml]   [2010]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] lktdm: Bring support for hardlockup, softlockup and hung task crashes
On Sun, May 16, 2010 at 07:39:51AM +0200, Frederic Weisbecker wrote:
...
> static struct jprobe lkdtm;
> @@ -320,6 +326,20 @@ static void lkdtm_do_action(enum ctype which)
> memset(data, 0x78, len);
> break;
> }
> + case SOFTLOCKUP:
> + preempt_disable();
> + for (;;)
> + cpu_relax();
> + break;
> + case HARDLOCKUP:
> + local_irq_disable();
> + for (;;)
> + cpu_relax();
> + break;
> + case HUNG_TASK:
> + set_current_state(TASK_UNINTERRUPTIBLE);
> + schedule();
> + break;
> case NONE:
> default:
> break;

Looks good to me. Btw perhaps we may simplify it a bit:

case HARDLOCKUP:
local_irq_disable();
case SOFTLOCKUP:
preempt_disable();
for (;;)
cpu_relax();
break;

since it'll save a few bytes. What do you think? Did I miss
something?

-- Cyrill


\
 
 \ /
  Last update: 2010-05-16 11:39    [W:0.060 / U:1.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site