lkml.org 
[lkml]   [2011]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/2] sched: allow SCHED_BATCH to preempt SCHED_IDLE tasks
From
Date
On Tue, 2011-02-22 at 13:04 -0800, Darren Hart wrote:
> Perform the test for SCHED_IDLE before testing for SCHED_BATCH (and ensure idle
> tasks don't preempt idle tasks) so the non-interactive, but still important,
> SCHED_BATCH tasks will run in favor of the very low priority SCHED_IDLE tasks.

Yeah, that could be construed as a fairness fix for light SCHED_BATCH vs
a heavy SCHED_IDLE. It should lower latencies for both when mixed.

Acked-by: Mike Galbraith <efault@gmx.de>

Nit below.

> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
> CC: Peter Zijlstra <peterz@infradead.org>
> CC: Ingo Molnar <mingo@elte.hu>
> CC: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
> kernel/sched_fair.c | 12 +++++++-----
> 1 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
> index 0c26e2d..ff04bbd 100644
> --- a/kernel/sched_fair.c
> +++ b/kernel/sched_fair.c
> @@ -1857,16 +1857,18 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_
> if (test_tsk_need_resched(curr))
> return;
>
> + /* Idle tasks are by definition preempted by non-idle tasks. */
> + if (unlikely(curr->policy == SCHED_IDLE) &&
> + likely(p->policy != SCHED_IDLE))
> + goto preempt;
> +

if (unlikely(curr->policy == SCHED_IDLE && p->policy != curr->policy))
goto preempt;

Looks better to me.

-Mike



\
 
 \ /
  Last update: 2011-02-23 05:23    [W:0.084 / U:1.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site