public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Wessel <jason.wessel@windriver.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	lkml <linux-kernel@vger.kernel.org>,
	"Deng, Dongdong" <Dongdong.Deng@windriver.com>
Subject: Re: [PATCH] softlockup: fix problem with long kernel pauses fromkgdb
Date: Tue, 04 Aug 2009 09:53:44 -0500	[thread overview]
Message-ID: <4A784B78.2020801@windriver.com> (raw)
In-Reply-To: <20090804141623.GD7746@elte.hu>

Ingo Molnar wrote:
> * Jason Wessel <jason.wessel@windriver.com> wrote:
> 
>> -----
>> From: Jason Wessel <jason.wessel@windriver.com>
>> Subject: [PATCH] softlockup: add sched_clock_tick() to avoid kernel warning on kgdb resume
>>
>> When CONFIG_HAVE_UNSTABLE_SCHED_CLOCK is set sched_clock() gets the
>> time from hardware, such as from TSC.  In this configuration kgdb will
>> report a softlock warning messages on resuming or detaching from a
>> debug session.
>>
> 
> Hm, this looks quite ugly. Peter, Thomas, can you think of a cleaner 
> solution?
> 

Below was a more specific test case I received from Dongdong Deng
which did not require kgdb.  The test case is not something to merge,
it is just a simple module to build to demonstrate the problem outside
of kgdb.

The patch I submitted might have been on the "ugly" side, but there
was not an obvious way to solve the problem without making changes in
kernel/sched*.  I opted for something that was entirely self contained
to the softlockup code.

Jason.

============= test case ================
/* Information about this test case.
 * -------------------------------------
 * 1: CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
 * 
 * 2: export clocksource_touch_watchdog for this test case to build.
 *
 * 
 * diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
 * index 7466cb8..c81f9a3 100644
 * --- a/kernel/time/clocksource.c
 * +++ b/kernel/time/clocksource.c
 * @@ -319,6 +319,7 @@ void clocksource_touch_watchdog(void)
 *  {
 * 	    clocksource_resume_watchdog();
 *  }
 * +EXPORT_SYMBOL(clocksource_touch_watchdog);
 * 
 * 3: build following module, insmod and observe the softlockup
 *    warning or watch your system reboot if you have reboot
 *    on softlockup set.
 * 
 */

#include <linux/module.h>
#include <linux/init.h>
#include <linux/irqflags.h>
#include <linux/delay.h>
#include <linux/sched.h>
#include <linux/clocksource.h>



static int example_init(void)
{
	unsigned long flags;
	unsigned i;

	printk(KERN_NOTICE"softlockup test init\n");

	local_irq_save(flags);

	for (i = 0; i < 70; i++)
		mdelay(1000);

	touch_softlockup_watchdog();
	clocksource_touch_watchdog();

	local_irq_restore(flags);

	return 0;
}

static void example_exit(void)
{
	printk(KERN_NOTICE"softlockup test exit\n");
}

module_init(example_init);
module_exit(example_exit);
MODULE_LICENSE("GPL");


  reply	other threads:[~2009-08-04 14:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-27 20:03 [PATCH] softlockup: fix problem with long kernel pauses from kgdb Jason Wessel
2009-07-27 20:18 ` Peter Zijlstra
2009-07-27 21:25   ` Jason Wessel
2009-07-28 15:05   ` Jason Wessel
2009-08-04 14:16     ` Ingo Molnar
2009-08-04 14:53       ` Jason Wessel [this message]
2009-08-04 14:59         ` [PATCH] softlockup: fix problem with long kernel pauses fromkgdb Ingo Molnar
2009-08-21 12:42           ` [PATCH] softlockup: fix problem with long kernel pauses from kgdb DDD
2009-09-26  3:01       ` Yong Zhang

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=4A784B78.2020801@windriver.com \
    --to=jason.wessel@windriver.com \
    --cc=Dongdong.Deng@windriver.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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