All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched: drop all load weight manipulation for RT tasks
@ 2010-10-11 14:36 Linus Walleij
  2010-10-12  9:31 ` Peter Zijlstra
  2010-10-18 19:16 ` [tip:sched/core] sched: Drop " tip-bot for Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Linus Walleij @ 2010-10-11 14:36 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, linux-kernel
  Cc: Linus Walleij, Lennart Poettering, stable

Load weights are for the CFS, they do not belong in the RT
task. This makes all RT scheduling classes leave the
CFS weights alone.

This fixes a real bug as well: I noticed the following
phonomena: a process elevated to SCHED_RR forks with
SCHED_RESET_ON_FORK set, and the child is indeed SCHED_OTHER,
and the niceval is indeed reset to 0. However the
weight inserted by set_load_weight() remains at 0. giving the
task insignificat priority.

With this fix, the weight is reset to what the task had before
being elevated to SCHED_RR/SCHED_FIFO.

Cc: Lennart Poettering <lennart@poettering.net>
Cc: stable@kernel.org
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
---
Note: in 2.6.34 and earlier kernels, the phenomenon is the
inverse: the tasks return from SCHED_RR/SCHED_FIFO with huge
weights. For the stable series the earlier patch inserting
recalculation of load weights at SCHED_RESET_ON_FORK is likely
more desirable.
---
 kernel/sched.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index a04b8e6..07f39b5 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1855,12 +1855,6 @@ static void dec_nr_running(struct rq *rq)
 
 static void set_load_weight(struct task_struct *p)
 {
-	if (task_has_rt_policy(p)) {
-		p->se.load.weight = 0;
-		p->se.load.inv_weight = WMULT_CONST;
-		return;
-	}
-
 	/*
 	 * SCHED_IDLE tasks get minimal weight:
 	 */
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] sched: drop all load weight manipulation for RT tasks
  2010-10-11 14:36 [PATCH] sched: drop all load weight manipulation for RT tasks Linus Walleij
@ 2010-10-12  9:31 ` Peter Zijlstra
  2010-10-18 19:16 ` [tip:sched/core] sched: Drop " tip-bot for Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Zijlstra @ 2010-10-12  9:31 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Ingo Molnar, linux-kernel, Lennart Poettering, stable

On Mon, 2010-10-11 at 16:36 +0200, Linus Walleij wrote:
> Load weights are for the CFS, they do not belong in the RT
> task. This makes all RT scheduling classes leave the
> CFS weights alone.
> 
> This fixes a real bug as well: I noticed the following
> phonomena: a process elevated to SCHED_RR forks with
> SCHED_RESET_ON_FORK set, and the child is indeed SCHED_OTHER,
> and the niceval is indeed reset to 0. However the
> weight inserted by set_load_weight() remains at 0. giving the
> task insignificat priority.
> 
> With this fix, the weight is reset to what the task had before
> being elevated to SCHED_RR/SCHED_FIFO.
> 
> Cc: Lennart Poettering <lennart@poettering.net>
> Cc: stable@kernel.org
> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>

Thanks, queued it up, we'll see if anything explodes ;-)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:sched/core] sched: Drop all load weight manipulation for RT tasks
  2010-10-11 14:36 [PATCH] sched: drop all load weight manipulation for RT tasks Linus Walleij
  2010-10-12  9:31 ` Peter Zijlstra
@ 2010-10-18 19:16 ` tip-bot for Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Linus Walleij @ 2010-10-18 19:16 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, linus.walleij, a.p.zijlstra, lennart,
	tglx, mingo

Commit-ID:  17bdcf949d03306b308c5fb694849cd35f119807
Gitweb:     http://git.kernel.org/tip/17bdcf949d03306b308c5fb694849cd35f119807
Author:     Linus Walleij <linus.walleij@stericsson.com>
AuthorDate: Mon, 11 Oct 2010 16:36:51 +0200
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Mon, 18 Oct 2010 18:41:59 +0200

sched: Drop all load weight manipulation for RT tasks

Load weights are for the CFS, they do not belong in the RT task. This makes all
RT scheduling classes leave the CFS weights alone.

This fixes a real bug as well: I noticed the following phonomena: a process
elevated to SCHED_RR forks with SCHED_RESET_ON_FORK set, and the child is
indeed SCHED_OTHER, and the niceval is indeed reset to 0. However the weight
inserted by set_load_weight() remains at 0, giving the task insignificat
priority.

With this fix, the weight is reset to what the task had before being elevated
to SCHED_RR/SCHED_FIFO.

Cc: Lennart Poettering <lennart@poettering.net>
Cc: stable@kernel.org
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1286807811-10568-1-git-send-email-linus.walleij@stericsson.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 kernel/sched.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 5f64fed..728081a 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1855,12 +1855,6 @@ static void dec_nr_running(struct rq *rq)
 
 static void set_load_weight(struct task_struct *p)
 {
-	if (task_has_rt_policy(p)) {
-		p->se.load.weight = 0;
-		p->se.load.inv_weight = WMULT_CONST;
-		return;
-	}
-
 	/*
 	 * SCHED_IDLE tasks get minimal weight:
 	 */

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-10-18 19:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-11 14:36 [PATCH] sched: drop all load weight manipulation for RT tasks Linus Walleij
2010-10-12  9:31 ` Peter Zijlstra
2010-10-18 19:16 ` [tip:sched/core] sched: Drop " tip-bot for Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.