Re: [PATCH] sched: put rq's sched_avg under CONFIG_FAIR_GROUP_SCHED

From: bsegall
Date: Wed Feb 26 2014 - 12:53:20 EST


Dietmar Eggemann <dietmar.eggemann@xxxxxxx> writes:

> On 25/02/14 20:52, Peter Zijlstra wrote:
>> On Tue, Feb 25, 2014 at 11:47:42AM +0000, Dietmar Eggemann wrote:
>>> +++ b/kernel/sched/sched.h
>>> @@ -630,7 +630,9 @@ struct rq {
>>> struct llist_head wake_list;
>>> #endif
>>>
>>> +#ifdef CONFIG_FAIR_GROUP_SCHED
>>> struct sched_avg avg;
>>> +#endif
>>> };
>>
>> There is already a CONFIG_FAIR_GROUP_SCHED #ifdef in that structure;
>> does it make sense to move this variable in there instead of adding yet
>> another #ifdef?
>>
>
> I changed the patch accordingly.
>
> -- >8 --
> Subject: [PATCH] sched: put rq's sched_avg under CONFIG_FAIR_GROUP_SCHED
>
> The struct sched_avg of struct rq is only used in case group
> scheduling is enabled inside __update_tg_runnable_avg() to update
> per-cpu representation of a task group. I.e. that there is no need to
> maintain the runnable avg of a rq in the !CONFIG_FAIR_GROUP_SCHED case.
>
> This patch guards struct sched_avg of struct rq and
> update_rq_runnable_avg() with CONFIG_FAIR_GROUP_SCHED.
>
> There is an extra empty definition for update_rq_runnable_avg()
> necessary for the !CONFIG_FAIR_GROUP_SCHED && CONFIG_SMP case.
>
> The function print_cfs_group_stats() which prints out struct sched_avg
> of struct rq is already guarded with CONFIG_FAIR_GROUP_SCHED.
>
> Signed-off-by: Dietmar Eggemann <dietmar.eggemann@xxxxxxx>
Reviewed-by: Ben Segall <bsegall@xxxxxxxxxx>
--
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/