public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [patch] softlockup: do the wakeup from a hrtimer
Date: Mon, 26 Nov 2007 15:26:52 -0800	[thread overview]
Message-ID: <20071126152652.8db2793a.akpm@linux-foundation.org> (raw)
In-Reply-To: <20071120084611.GA18721@elte.hu>

On Tue, 20 Nov 2007 09:46:11 +0100
Ingo Molnar <mingo@elte.hu> wrote:

> Subject: softlockup: do the wakeup from a hrtimer
> From: Ingo Molnar <mingo@elte.hu>
> 
> David Miller reported soft lockup false-positives that trigger on NOHZ 
> due to CPUs idling for more than 10 seconds.
> 
> The solution is to drive the wakeup of the watchdog threads not from the 
> timer tick (which has no guaranteed frequency), but from the watchdog 
> tasks themselves.
> 
> http://bugzilla.kernel.org/show_bug.cgi?id=9409
> 
> Reported-by: David Miller <davem@davemloft.net>
> Signed-off-by: Ingo Molnar <mingo@elte.hu>
> ---
>  kernel/softlockup.c |    6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> Index: linux/kernel/softlockup.c
> ===================================================================
> --- linux.orig/kernel/softlockup.c
> +++ linux/kernel/softlockup.c
> @@ -100,10 +100,6 @@ void softlockup_tick(void)
>  
>  	now = get_timestamp(this_cpu);
>  
> -	/* Wake up the high-prio watchdog task every second: */
> -	if (now > (touch_timestamp + 1))
> -		wake_up_process(per_cpu(watchdog_task, this_cpu));
> -
>  	/* Warn about unreasonable 10+ seconds delays: */
>  	if (now <= (touch_timestamp + softlockup_thresh))
>  		return;
> @@ -141,7 +137,7 @@ static int watchdog(void *__bind_cpu)
>  	while (!kthread_should_stop()) {
>  		set_current_state(TASK_INTERRUPTIBLE);
>  		touch_softlockup_watchdog();
> -		schedule();
> +		msleep(1000);
>  	}
>  
>  	return 0;

I think you wanted msleep_interruptible() there to avoid contributing to
load average?

The set_current_state() can go away.

This will introduce an up-to-one-second delay in responding to
kthread_should_stop().  Is that bad?

  reply	other threads:[~2007-11-26 23:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-20  8:46 [patch] softlockup: do the wakeup from a hrtimer Ingo Molnar
2007-11-26 23:26 ` Andrew Morton [this message]
2007-11-27 10:36   ` Ingo Molnar
2007-11-28 12:56     ` [patch] softlockup: fix false positives on CONFIG_NOHZ Ingo Molnar

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=20071126152652.8db2793a.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@linux-foundation.org \
    /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