Re: [PATCH 5/7] Move idle stat calculation into rebalance_tick()

From: Siddha, Suresh B
Date: Sat Oct 28 2006 - 14:18:55 EST


On Fri, Oct 27, 2006 at 07:41:38PM -0700, Christoph Lameter wrote:
> Index: linux-2.6.19-rc3/kernel/sched.c
> ===================================================================
> --- linux-2.6.19-rc3.orig/kernel/sched.c 2006-10-27 15:43:45.467245352 -0500
> +++ linux-2.6.19-rc3/kernel/sched.c 2006-10-27 15:45:30.794096498 -0500
> @@ -2849,10 +2849,16 @@ static void update_load(struct rq *this_
> * Balancing parameters are set up in arch_init_sched_domains.
> */
> static void
> -rebalance_tick(int this_cpu, struct rq *this_rq, enum idle_type idle)
> +rebalance_tick(int this_cpu, struct rq *this_rq)
> {
> unsigned long interval;
> struct sched_domain *sd;
> + /*
> + * A task is idle if this is the idle queue
> + * and we have no runnable task
> + */
> + enum idle_type idle = (this_rq->idle && !this_rq->nr_running) ?
> + SCHED_IDLE : NOT_IDLE;

this_rq->idle will always be set to idle task. You wanted to check, if
the current task is idle or not, right? Perhaps we can skip that and
just check for nr_running..

comment needs to be fixed and also please mention that in case of SMT nice,
nr_running will determine if the processor is idle or not(rather than
checking for current task is idle)

thanks,
suresh
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/