mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Christian Leber <christian@leber.de>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>
Subject: Re: [BUG] 2.6.18-rc6: hda is allready "IN USE" when booting / pi futex
Date: Tue, 12 Sep 2006 23:55:10 +0200	[thread overview]
Message-ID: <20060912215510.GA14878@elte.hu> (raw)
In-Reply-To: <20060912214822.GA20437@core>


* Christian Leber <christian@leber.de> wrote:

> > The b29739f902ee76a05493fb7d2303490fc75364f4 patch is quite large, so i 
> > have created a finegrained, functional splitup of it:
> > 
> >   sched-cleanups.patch
> >   sched-add-task-rq-lock-ops.patch
> >   sched-add-rt-mutex-setprio.patch
> >   sched-pi-lock.patch
> >   sched-add-new-macros.patch
> >   sched-add-normal-prio.patch
> >   sched-use-has-rt-policy.patch
> 
> until here everthing seems to be ok (20 boots)
> 
> >   sched-set-user-nice-fix.patch
> 
> here we go, that one triggers the problem

ok, great. Could you try the patch below ontop of 2.6.18-rc6, does it 
'fix' your bootup too?

the original patch (which this patch reverses) is harmless: it changes 
the priority calculation of reniced tasks from:

	p->prio = NICE_TO_PRIO(nice);

to:

	p->prio = effective_prio(p);

which is a correct change, because NICE_TO_PRIO() gives a 'static' value 
that is not modified by interactivity bonuses/penalties, while 
effective_prio() is the kind of prio every task should get. I.e. 
sys_nice(1) used to (incorrectly) discard the interactive bias of a 
task, until the end of the timeslice.

so i'm afraid you managed to trigger a race in the IDE driver that used 
to be dormant until now... To debug such races the best method is to 
create a 'trace' by printk-ing key points of the port/disk detection 
mechanism. [another option would be to use the latency tracer to do a 
_really_ finegrained trace of the incident - assuming that the bug does 
not go away due to tracing overhead.]

	Ingo

--------------->
Subject: [patch] revert set_user_nice() change
From: Ingo Molnar <mingo@elte.hu>

revert an otherwise correct fix.

this disturbs dynamic priorities (of user and kernel threads),
so it could have an impact on timing-sensitive races.

NOT-Signed-off-by: Ingo Molnar <mingo@elte.hu>

---
 kernel/sched.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Index: linux/kernel/sched.c
===================================================================
--- linux.orig/kernel/sched.c
+++ linux/kernel/sched.c
@@ -3864,8 +3864,8 @@ void rt_mutex_setprio(struct task_struct
 
 void set_user_nice(struct task_struct *p, long nice)
 {
+	int old_prio, new_prio, delta;
 	struct prio_array *array;
-	int old_prio, delta;
 	unsigned long flags;
 	struct rq *rq;
 
@@ -3892,11 +3892,12 @@ void set_user_nice(struct task_struct *p
 		dec_raw_weighted_load(rq, p);
 	}
 
+	old_prio = p->prio;
+	new_prio = NICE_TO_PRIO(nice);
+	delta = new_prio - old_prio;
 	p->static_prio = NICE_TO_PRIO(nice);
 	set_load_weight(p);
-	old_prio = p->prio;
-	p->prio = effective_prio(p);
-	delta = p->prio - old_prio;
+	p->prio += delta;
 
 	if (array) {
 		enqueue_task(p, array);

  reply	other threads:[~2006-09-12 22:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-07 13:33 [BUG] 2.6.18-rc6: hda is allready "IN USE" when booting (non-deterministic) Christian Leber
2006-09-12 15:39 ` [BUG] 2.6.18-rc6: hda is allready "IN USE" when booting / pi futex Christian Leber
2006-09-12 17:34   ` Ingo Molnar
2006-09-12 21:48     ` Christian Leber
2006-09-12 21:55       ` Ingo Molnar [this message]
2006-09-13  1:24         ` Christian Leber

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=20060912215510.GA14878@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@osdl.org \
    --cc=christian@leber.de \
    --cc=linux-kernel@vger.kernel.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

Powered by JetHome