Re: linux-next: Tree for Sep 16 (kernel/sched/core.c)

From: Randy Dunlap
Date: Tue Sep 17 2019 - 11:24:24 EST


On 9/17/19 6:38 AM, Patrick Bellasi wrote:
>
> On Tue, Sep 17, 2019 at 08:52:42 +0100, Ingo Molnar wrote...
>
>> * Randy Dunlap <rdunlap@xxxxxxxxxxxxx> wrote:
>>
>>> On 9/16/19 3:38 PM, Mark Brown wrote:
>>>> Hi all,
>>>>
>>>> Changes since 20190915:
>>>>
>>>
>>> on x86_64:
>>>
>>> when CONFIG_CGROUPS is not set:
>
> Hi Randy,
> thanks for the report.
>
>>> CC kernel/sched/core.o
>>> ../kernel/sched/core.c: In function âuclamp_update_active_tasksâ:
>>> ../kernel/sched/core.c:1081:23: error: storage size of âitâ isnât known
>>> struct css_task_iter it;
>>> ^~
>>> CC kernel/printk/printk_safe.o
>>> ../kernel/sched/core.c:1084:2: error: implicit declaration of function âcss_task_iter_startâ; did you mean â__sg_page_iter_startâ? [-Werror=implicit-function-declaration]
>>> css_task_iter_start(css, 0, &it);
>>> ^~~~~~~~~~~~~~~~~~~
>>> __sg_page_iter_start
>>> ../kernel/sched/core.c:1085:14: error: implicit declaration of function âcss_task_iter_nextâ; did you mean â__sg_page_iter_nextâ? [-Werror=implicit-function-declaration]
>>> while ((p = css_task_iter_next(&it))) {
>>> ^~~~~~~~~~~~~~~~~~
>>> __sg_page_iter_next
>>> ../kernel/sched/core.c:1091:2: error: implicit declaration of function âcss_task_iter_endâ; did you mean âget_task_credâ? [-Werror=implicit-function-declaration]
>>> css_task_iter_end(&it);
>>> ^~~~~~~~~~~~~~~~~
>>> get_task_cred
>>> ../kernel/sched/core.c:1081:23: warning: unused variable âitâ [-Wunused-variable]
>>> struct css_task_iter it;
>>> ^~
>>>
>>
>> I cannot reproduce this build failue: I took Linus's latest which has all
>> the -next scheduler commits included (ad062195731b), and an x86-64 "make
>> defconfig" and a disabling of CONFIG_CGROUPS still resuls in a kernel
>> that builds fine.
>
> Same here Ingo, I cannot reproduce on arm64 and !CONFIG_CGROUPS and
> testing on tip/sched/core.
>
> However, if you like, the following patch can make that code a
> bit more "robust".
>
> Best,
> Patrick
>
> ---8<---
> From 7e17b7bb08dd8dfc57e01c2a7b6875439eb47cbe Mon Sep 17 00:00:00 2001
> From: Patrick Bellasi <patrick.bellasi@xxxxxxx>
> Date: Tue, 17 Sep 2019 14:12:10 +0100
> Subject: [PATCH 1/1] sched/core: uclamp: Fix compile error on !CONFIG_CGROUPS
>
> Randy reported a compiler error on x86_64 and !CONFIG_CGROUPS which is due
> to uclamp_update_active_tasks() using the undefined css_task_iter().
>
> Since uclamp_update_active_tasks() is used only when cgroup support is
> enabled, fix that by properly guarding that function at compile time.
>
> Signed-off-by: Patrick Bellasi <patrick.bellasi@xxxxxxx>
> Link: https://lore.kernel.org/lkml/1898d3c9-1997-17ce-a022-a5e28c8dc115@xxxxxxxxxxxxx/
> Fixes: commit babbe170e05 ("sched/uclamp: Update CPU's refcount on TG's clamp changes")

Acked-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx> # build-tested

Thanks.

> ---
> kernel/sched/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 3c7b90bcbe4e..14873ad4b34a 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -1043,6 +1043,7 @@ static inline void uclamp_rq_dec(struct rq *rq, struct task_struct *p)
> uclamp_rq_dec_id(rq, p, clamp_id);
> }
>
> +#ifdef CONFIG_UCLAMP_TASK_GROUP
> static inline void
> uclamp_update_active(struct task_struct *p, enum uclamp_id clamp_id)
> {
> @@ -1091,7 +1092,6 @@ uclamp_update_active_tasks(struct cgroup_subsys_state *css,
> css_task_iter_end(&it);
> }
>
> -#ifdef CONFIG_UCLAMP_TASK_GROUP
> static void cpu_util_update_eff(struct cgroup_subsys_state *css);
> static void uclamp_update_root_tg(void)
> {
>


--
~Randy