From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: William Weston <weston@sysex.net>
Cc: Ingo Molnar <mingo@elte.hu>, linux-kernel@vger.kernel.org
Subject: Re: Real-Time Preemption, -RT-2.6.12-final-V0.7.51-12
Date: Sun, 10 Jul 2005 13:18:07 +0200 [thread overview]
Message-ID: <1120994288.14680.0.camel@twins> (raw)
In-Reply-To: <1120944243.12169.3.camel@twins>
On Sat, 2005-07-09 at 23:24 +0200, Peter Zijlstra wrote:
> On Fri, 2005-07-08 at 13:12 -0700, William Weston wrote:
> > On Fri, 8 Jul 2005, Ingo Molnar wrote:
> >
> > > could you check whether the priority leakage happens if you disable SMP?
> > > (if you can reproduce it easily)
> >
> > No priority leakages have been seen with UP configs on any of the
> > machines I've been testing.
> >
> > The leakage is not hard to reproduce under SMT: start up jackd from a
> > text vc with an rt prio of 60 (or some unique prio above the IRQ threads),
> > then restart X and login. After several minutes, X and all of its
> > children will be running at whatever prio jackd was started at (but still
> > SCHED_NORMAL). Eventually, init, a handful of SCHED_NORMAL kernel
> > threads, and other random processes are all running at the same priority.
> > When reset to default priority with chrt or schedtool, these processes
> > eventually revert back to the leaked priority level. When jackd is
> > stopped, the priorities stay in their elevated state. If jackd is not
> > started before logging in to X, then the priority of one of the SCHED_FF
> > kernel threads is leaked to other processes in the same manner.
> >
>
> I can reproduce priority leakage on my SMP system; any userspace process
> chrt'ed up and a lot will follow. This makes the system very
> unresponsive when doing a make -j5. Verified on 51-{6,18,23}.
>
The following patch seems to fix it for me, YMMV.
--- kernel/sched.c~ 2005-07-08 10:27:59.000000000 +0200
+++ kernel/sched.c 2005-07-10 13:00:42.000000000 +0200
@@ -780,7 +780,8 @@ static void recalc_task_prio(task_t *p,
}
}
- p->prio = p->normal_prio = effective_prio(p);
+ p->prio = effective_prio(p);
+ p->normal_prio = unlikely(rt_prio(p->normal_prio)) ? p->prio : __effective_prio(p);
}
/*
@@ -1415,7 +1416,8 @@ void fastcall wake_up_new_task(task_t *
p->sleep_avg = JIFFIES_TO_NS(CURRENT_BONUS(p) *
CHILD_PENALTY / 100 * MAX_SLEEP_AVG / MAX_BONUS);
- p->prio = p->normal_prio = effective_prio(p);
+ p->prio = effective_prio(p);
+ p->normal_prio = unlikely(rt_prio(p->normal_prio)) ? p->prio : __effective_prio(p);
if (likely(cpu == this_cpu)) {
if (!(clone_flags & CLONE_VM)) {
@@ -1427,7 +1429,8 @@ void fastcall wake_up_new_task(task_t *
if (unlikely(!current->array))
__activate_task(p, rq);
else {
- p->prio = p->normal_prio = current->prio;
+ p->prio = current->prio;
+ p->normal_prio = current->normal_prio;
__activate_task_after(p, current, rq);
}
set_need_resched();
@@ -2744,7 +2747,8 @@ void scheduler_tick(void)
if (!--p->time_slice) {
dequeue_task(p, rq->active);
set_tsk_need_resched(p);
- p->prio = p->normal_prio = effective_prio(p);
+ p->prio = effective_prio(p);
+ p->normal_prio = unlikely(rt_prio(p->normal_prio)) ? p->prio : __effective_prio(p);
p->time_slice = task_timeslice(p);
p->first_time_slice = 0;
--
Peter Zijlstra <a.p.zijlstra@chello.nl>
next prev parent reply other threads:[~2005-07-10 11:18 UTC|newest]
Thread overview: 76+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-28 17:27 Real-Time Preemption, -RT-2.6.12-final-V0.7.50-24 Karsten Wiese
2005-06-28 20:21 ` Ingo Molnar
2005-06-28 20:30 ` Ingo Molnar
2005-06-28 23:51 ` Karsten Wiese
2005-06-29 6:34 ` Ingo Molnar
2005-06-29 7:00 ` Ingo Molnar
2005-06-29 9:15 ` William Weston
2005-06-29 12:56 ` Ingo Molnar
2005-06-30 1:50 ` William Weston
2005-06-29 14:48 ` Karsten Wiese
2005-06-29 19:38 ` Ingo Molnar
2005-06-29 23:36 ` Karsten Wiese
2005-06-30 17:52 ` Karsten Wiese
2005-06-30 19:46 ` Real-Time Preemption, -RT-2.6.12-final-V0.7.50-37 William Weston
2005-06-30 19:52 ` Ingo Molnar
2005-06-30 20:48 ` Ingo Molnar
2005-06-30 22:17 ` Gene Heskett
2005-06-30 22:15 ` Gene Heskett
2005-06-30 20:38 ` Real-Time Preemption, -RT-2.6.12-final-V0.7.50-38 Michal Schmidt
2005-06-30 20:47 ` Ingo Molnar
2005-06-30 20:50 ` Real-Time Preemption, -RT-2.6.12-final-V0.7.50-24 Ingo Molnar
2005-06-30 22:27 ` Karsten Wiese
2005-06-30 22:59 ` William Weston
2005-07-01 1:00 ` William Weston
2005-07-01 0:15 ` Karsten Wiese
2005-07-01 7:18 ` Ingo Molnar
2005-07-01 19:34 ` Chuck Harding
2005-07-02 1:46 ` William Weston
2005-07-02 2:02 ` Lee Revell
2005-07-04 8:53 ` William Weston
2005-07-04 11:16 ` Ingo Molnar
2005-07-13 1:18 ` Lee Revell
2005-07-13 1:28 ` Lee Revell
2005-07-13 6:35 ` Ingo Molnar
2005-07-13 17:20 ` Lee Revell
2005-07-03 14:04 ` Ingo Molnar
2005-07-03 18:12 ` Ingo Molnar
2005-07-05 20:43 ` Real-Time Preemption, -RT-2.6.12-final-V0.7.50-45 William Weston
2005-07-06 10:04 ` Ingo Molnar
2005-07-06 21:12 ` William Weston
2005-07-07 14:56 ` Steven Rostedt
2005-07-07 15:31 ` Ingo Molnar
2005-07-07 15:42 ` Steven Rostedt
2005-07-07 16:10 ` Steven Rostedt
2005-07-07 16:48 ` Ingo Molnar
2005-07-08 7:02 ` Steven Rostedt
2005-07-08 9:54 ` Steven Rostedt
2005-07-08 10:00 ` Ingo Molnar
2005-07-08 20:55 ` Bill Davidsen
2005-07-07 17:51 ` Ingo Molnar
2005-07-07 21:18 ` Real-Time Preemption, -RT-2.6.12-final-V0.7.51-12 Chuck Harding
2005-07-08 5:41 ` Ingo Molnar
2005-07-08 8:00 ` Ingo Molnar
2005-07-08 18:06 ` Chuck Harding
2005-07-07 19:05 ` Real-Time Preemption, -RT-2.6.12-final-V0.7.51-08 William Weston
2005-07-07 19:18 ` Ingo Molnar
2005-07-07 19:46 ` William Weston
2005-07-07 19:52 ` Ingo Molnar
2005-07-08 9:23 ` Ingo Molnar
2005-07-08 9:29 ` Ingo Molnar
2005-07-08 9:45 ` Ingo Molnar
2005-07-08 20:30 ` Real-Time Preemption, -RT-2.6.12-final-V0.7.51-17 William Weston
2005-07-07 1:26 ` Real-Time Preemption, -RT-2.6.12-final-V0.7.50-24 William Weston
2005-07-07 10:48 ` Ingo Molnar
2005-07-07 18:49 ` Real-Time Preemption, -RT-2.6.12-final-V0.7.51-06 William Weston
2005-07-07 20:02 ` Real-Time Preemption, -RT-2.6.12-final-V0.7.51-12 William Weston
2005-07-08 8:03 ` Ingo Molnar
2005-07-08 20:12 ` William Weston
2005-07-09 21:24 ` Peter Zijlstra
2005-07-10 11:18 ` Peter Zijlstra [this message]
2005-07-10 15:10 ` Ingo Molnar
2005-07-10 15:43 ` Peter Zijlstra
2005-07-10 16:12 ` Peter Zijlstra
2005-07-10 18:26 ` Ingo Molnar
2005-07-11 18:49 ` William Weston
2005-07-08 22:33 ` Real-Time Preemption, -RT-2.6.12-final-V0.7.51-17 William Weston
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=1120994288.14680.0.camel@twins \
--to=a.p.zijlstra@chello.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=weston@sysex.net \
/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