public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Simon Kagstrom <simon.kagstrom@netinsight.net>,
	Ingo Molnar <mingo@elte.hu>, Don Zickus <dzickus@redhat.com>
Subject: Re: [PATCH] lktdm: Bring support for hardlockup, softlockup and hung task crashes
Date: Sun, 16 May 2010 12:35:08 +0200	[thread overview]
Message-ID: <20100516103506.GD5306@nowhere> (raw)
In-Reply-To: <20100516093636.GE5133@lenovo>

On Sun, May 16, 2010 at 01:36:36PM +0400, Cyrill Gorcunov wrote:
> 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?


It would make the code a bit less clear in that people
might stick on the reason to disable preemption after disabling
irq, especially with a code that already does something rather
unusual ;)


  reply	other threads:[~2010-05-16 10:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-16  5:39 [PATCH] lktdm: Bring support for hardlockup, softlockup and hung task crashes Frederic Weisbecker
2010-05-16  9:36 ` Cyrill Gorcunov
2010-05-16 10:35   ` Frederic Weisbecker [this message]
2010-05-16 10:46     ` Cyrill Gorcunov

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=20100516103506.GD5306@nowhere \
    --to=fweisbec@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dzickus@redhat.com \
    --cc=gorcunov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=simon.kagstrom@netinsight.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox