mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Vernon Mauery <vernux@us.ibm.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Wait to remove active timer when rescheduling hrtimer
Date: Fri, 21 Jan 2011 22:32:48 +0100 (CET)	[thread overview]
Message-ID: <alpine.LFD.2.00.1101212232210.2971@localhost6.localdomain6> (raw)
In-Reply-To: <1295632350-10215-1-git-send-email-vernux@us.ibm.com>



On Fri, 21 Jan 2011, Vernon Mauery wrote:

> In the current hrtimer implementation, when explicitly
> removing a timer, the hrtimer_cancel function waits
> until the timer is not currently running before actually
> calling remove_hrtimer.  But in the __hrtimer_start_range_ns
> function (called by hrtimer_start, among others), it
> calls remove_hrtimer without checking to see if the
> timer is currently running.  This doesn't seem to cause
> much trouble in the vanilla kernel, but in the -RT
> kernel, this causes a silent hang when exercising the
> sch_htb module on a 10GbE interface.
> 
> Signed-off-by: Vernon Mauery <vernux@us.ibm.com>
> ---
>  kernel/hrtimer.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
> index 0c8d7c0..c7e8ba0 100644
> --- a/kernel/hrtimer.c
> +++ b/kernel/hrtimer.c
> @@ -935,6 +935,11 @@ int __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
>  	base = lock_hrtimer_base(timer, &flags);
>  
>  	/* Remove an active timer from the queue: */
> +	while (hrtimer_callback_running(timer)) {
> +		unlock_hrtimer_base(timer, &flags);
> +		hrtimer_wait_for_timer(timer);
> +		base = lock_hrtimer_base(timer, &flags);
> +	}
>  	ret = remove_hrtimer(timer, base);
>  
>  	/* Switch the timer base, if necessary: */

Hmm, why does it hang ?

Thanks,

	tglx

  reply	other threads:[~2011-01-21 21:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-21 17:52 Vernon Mauery
2011-01-21 21:32 ` Thomas Gleixner [this message]
2011-01-21 23:06   ` Vernon Mauery
2011-01-22  9:43     ` Thomas Gleixner

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=alpine.LFD.2.00.1101212232210.2971@localhost6.localdomain6 \
    --to=tglx@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vernux@us.ibm.com \
    /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

all inboxes | Powered by JetHome®