mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Guillaume Chazarain" <guichaz@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>,
	"Peter Zijlstra" <a.p.zijlstra@chello.nl>,
	"Ingo Molnar" <mingo@elte.hu>
Subject: Re: Hang in work_resched
Date: Wed, 30 Jan 2008 23:54:46 +0100	[thread overview]
Message-ID: <3d8471ca0801301454l56dd8607g25aad3ac3cd88e75@mail.gmail.com> (raw)
In-Reply-To: <3d8471ca0801291430n68c0a845u1b24a590df8360f4@mail.gmail.com>

On Jan 29, 2008 11:30 PM, Guillaume Chazarain <guichaz@gmail.com> wrote:
>  =======================
> gnome-termina S 00000027     0  2201      1
>        f6711fb0 00200082 cb330d62 00000027 f664105c 00000b1e 00000000 cb331880
>        00000027 f660d780 009e3840 080ab7d8 080ab298 f6711000 c0103e7e 009e3840
>        000e0002 00000002 080ab7d8 080ab298 bfb41be8 080ab7d8 0000007b c010007b
> Call Trace:
>  [<c0103e7e>] work_resched+0x5/0x16
>  =======================
>
> This corresponds to the cli instruction:
> c0103e7e:       fa                      cli

I bisected it, and the resulting commit is appended. Rerverting this
commit applies cleanly on today's git
(dd430ca20c40ecccd6954a7efd13d4398f507728) and makes the hang go away
-:)


commit 37bb6cb4097e29ffee970065b74499cbf10603a3
Author: Peter Zijlstra <a.p.zijlstra@chello.nl>
Date:   Fri Jan 25 21:08:32 2008 +0100

    hrtimer: unlock hrtimer_wakeup

    hrtimer_wakeup creates a

      base->lock
        rq->lock

    lock dependancy. Avoid this by switching to HRTIMER_CB_IRQSAFE_NO_SOFTIRQ
    which doesn't hold base->lock.

    This fully untangles hrtimer locks from the scheduler locks, and allows
    hrtimer usage in the scheduler proper.

    Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 061ae28..bd5d6b5 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -1293,7 +1293,7 @@ void hrtimer_init_sleeper(struct hrtimer_sleeper
*sl, struct task_struct *task)
 	sl->timer.function = hrtimer_wakeup;
 	sl->task = task;
 #ifdef CONFIG_HIGH_RES_TIMERS
-	sl->timer.cb_mode = HRTIMER_CB_IRQSAFE_NO_RESTART;
+	sl->timer.cb_mode = HRTIMER_CB_IRQSAFE_NO_SOFTIRQ;
 #endif
 }

@@ -1304,6 +1304,8 @@ static int __sched do_nanosleep(struct
hrtimer_sleeper *t, enum hrtimer_mode mod
 	do {
 		set_current_state(TASK_INTERRUPTIBLE);
 		hrtimer_start(&t->timer, t->timer.expires, mode);
+		if (!hrtimer_active(&t->timer))
+			t->task = NULL;

 		if (likely(t->task))
 			schedule();


-- 
Guillaume

  reply	other threads:[~2008-01-30 22:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-29 22:30 Guillaume Chazarain
2008-01-30 22:54 ` Guillaume Chazarain [this message]
2008-01-31  8:55   ` Peter Zijlstra
2008-01-31 11:29     ` Guillaume Chazarain
2008-01-31 11:32       ` Peter Zijlstra
2008-01-31 12:12       ` Peter Zijlstra
2008-01-31 12:34         ` Guillaume Chazarain

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=3d8471ca0801301454l56dd8607g25aad3ac3cd88e75@mail.gmail.com \
    --to=guichaz@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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®