Re: [RFC PATCH 2 1/2] sched: Nominate idle load balancer from a semi-idle package.

Randy Dunlap
2009-04-14T17:32:21Z

Gautham R Shenoy wrote:
> kernel/sched.c | 127 ++++++++++++++++++++++++++++++++++++++++++++++++++++----
> 1 files changed, 118 insertions(+), 9 deletions(-)
>
> diff --git a/kernel/sched.c b/kernel/sched.c
> index 6cc1fd5..d702be7 100644
> --- a/kernel/sched.c
> +++ b/kernel/sched.c
>
> +/**
> + * is_semi_idle_group - Checks if the given sched_group is semi-idle.
> + * @ilb_group: group to be checked for semi-idleness
> + *
> + * Returns: 1 if the group is semi-idle. 0 otherwise.
> + *
> + * We define a sched_group to be semi idle if it has atleast one idle-CPU
> + * and atleast one non-idle CPU. This helper function checks if the given

"at least" (2x)

> + * sched_group is semi-idle or not.
> + */
> +static inline int is_semi_idle_group(struct sched_group *ilb_group)
> +{
> + cpumask_and(nohz.ilb_grp_nohz_mask, nohz.cpu_mask,
> + sched_group_cpus(ilb_group));
> +
> + /*
> + * A sched_group is semi-idle when it has atleast one busy cpu
> + * and atleast one idle cpu.

"at least" (2x)

> + */
> + if (cpumask_empty(nohz.ilb_grp_nohz_mask))
> + return 0;
> +
> + if (cpumask_equal(nohz.ilb_grp_nohz_mask, sched_group_cpus(ilb_group)))
> + return 0;
> +
> + return 1;
> +}

--
~Randy