lkml.org 
[lkml]   [2009]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[patch 2/2] Re: [PATCH] scheduler: introduce SCHED_RESET_ON_FORK scheduling policy flag, fourth try
From
Date
commit 50f3ff67c7fbcd37f0a135113ecd56f724d9b081
Author: Mike Galbraith <efault@gmx.de>
Date: Wed Jun 17 10:30:19 2009 +0200

sched: Add SCHED_RESET_ON_FORK functionality for nice < 0 tasks.

Signed-off-by: Mike Galbraith <efault@gmx.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Lennart Poettering <mzxreary@0pointer.de>
LKML-Reference: <new-submission>
---
kernel/sched.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 3c27e44..fe31c2d 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2627,6 +2627,11 @@ void sched_fork(struct task_struct *p, int clone_flags)
if (p->normal_prio < DEFAULT_PRIO)
p->prio = DEFAULT_PRIO;

+ if (PRIO_TO_NICE(p->static_prio) < 0) {
+ p->static_prio = NICE_TO_PRIO(0);
+ set_load_weight(p);
+ }
+
/*
* We don't need the reset flag anymore after the fork. It has
* fulfilled its duty:



\
 
 \ /
  Last update: 2009-06-17 10:51    [W:0.050 / U:0.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site