2022-03-17 06:20:20

by Randy Dunlap

[permalink] [raw]
Subject: Re: mmotm 2022-03-16-17-42 uploaded (uml sub-x86_64, sched/fair, RCU)



On 3/16/22 21:30, Andrew Morton wrote:
> On Wed, 16 Mar 2022 21:21:16 -0700 Randy Dunlap <[email protected]> wrote:
>
>>
>>
>> On 3/16/22 17:43, Andrew Morton wrote:
>>> The mm-of-the-moment snapshot 2022-03-16-17-42 has been uploaded to
>>>
>>> https://www.ozlabs.org/~akpm/mmotm/
>>>
>>> mmotm-readme.txt says
>>>
>>> README for mm-of-the-moment:
>>>
>>> https://www.ozlabs.org/~akpm/mmotm/
>>>
>>> This is a snapshot of my -mm patch queue. Uploaded at random hopefully
>>> more than once a week.
>>>
>>> You will need quilt to apply these patches to the latest Linus release (5.x
>>> or 5.x-rcY). The series file is in broken-out.tar.gz and is duplicated in
>>> https://ozlabs.org/~akpm/mmotm/series
>>
>>
>> UML for x86_64, defconfig:
>>
>> In file included from ./arch/x86/include/generated/asm/rwonce.h:1:0,
>> from ../include/linux/compiler.h:248,
>> from ../include/linux/kernel.h:20,
>> from ../include/linux/cpumask.h:10,
>> from ../include/linux/energy_model.h:4,
>> from ../kernel/sched/fair.c:23:
>> ../include/linux/psi.h: In function ‘cgroup_move_task’:
>> ../include/linux/rcupdate.h:414:36: error: dereferencing pointer to incomplete type ‘struct css_set’
>> #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
>> ^~~~
>
> Works For Me. I tried `make x86_64_defconfig' and `make i386_defconfig' too.
>
> Can you please share that .config, or debug a bit?

$ make ARCH=um SUBARCH=x86_64 defconfig



This fixes the build error for me when CONFIG_PSI=n.

---
include/linux/psi.h | 3 +++
1 file changed, 3 insertions(+)

--- mmotm-2022-0316-1742.orig/include/linux/psi.h
+++ mmotm-2022-0316-1742/include/linux/psi.h
@@ -53,6 +53,9 @@ static inline int psi_cgroup_alloc(struc
static inline void psi_cgroup_free(struct cgroup *cgrp)
{
}
+
+#include <linux/cgroup-defs.h>
+
static inline void cgroup_move_task(struct task_struct *p, struct css_set *to)
{
rcu_assign_pointer(p->cgroups, to);

--
~Randy


2022-03-17 18:53:26

by Paul E. McKenney

[permalink] [raw]
Subject: Re: mmotm 2022-03-16-17-42 uploaded (uml sub-x86_64, sched/fair, RCU)

On Wed, Mar 16, 2022 at 09:52:44PM -0700, Randy Dunlap wrote:
>
>
> On 3/16/22 21:30, Andrew Morton wrote:
> > On Wed, 16 Mar 2022 21:21:16 -0700 Randy Dunlap <[email protected]> wrote:
> >
> >>
> >>
> >> On 3/16/22 17:43, Andrew Morton wrote:
> >>> The mm-of-the-moment snapshot 2022-03-16-17-42 has been uploaded to
> >>>
> >>> https://www.ozlabs.org/~akpm/mmotm/
> >>>
> >>> mmotm-readme.txt says
> >>>
> >>> README for mm-of-the-moment:
> >>>
> >>> https://www.ozlabs.org/~akpm/mmotm/
> >>>
> >>> This is a snapshot of my -mm patch queue. Uploaded at random hopefully
> >>> more than once a week.
> >>>
> >>> You will need quilt to apply these patches to the latest Linus release (5.x
> >>> or 5.x-rcY). The series file is in broken-out.tar.gz and is duplicated in
> >>> https://ozlabs.org/~akpm/mmotm/series
> >>
> >>
> >> UML for x86_64, defconfig:
> >>
> >> In file included from ./arch/x86/include/generated/asm/rwonce.h:1:0,
> >> from ../include/linux/compiler.h:248,
> >> from ../include/linux/kernel.h:20,
> >> from ../include/linux/cpumask.h:10,
> >> from ../include/linux/energy_model.h:4,
> >> from ../kernel/sched/fair.c:23:
> >> ../include/linux/psi.h: In function ‘cgroup_move_task’:
> >> ../include/linux/rcupdate.h:414:36: error: dereferencing pointer to incomplete type ‘struct css_set’
> >> #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
> >> ^~~~
> >
> > Works For Me. I tried `make x86_64_defconfig' and `make i386_defconfig' too.
> >
> > Can you please share that .config, or debug a bit?
>
> $ make ARCH=um SUBARCH=x86_64 defconfig
>
>
>
> This fixes the build error for me when CONFIG_PSI=n.

Looks better than my approach of converting cgroup_move_task() to be
a macro. ;-)

Thanx, Paul

> ---
> include/linux/psi.h | 3 +++
> 1 file changed, 3 insertions(+)
>
> --- mmotm-2022-0316-1742.orig/include/linux/psi.h
> +++ mmotm-2022-0316-1742/include/linux/psi.h
> @@ -53,6 +53,9 @@ static inline int psi_cgroup_alloc(struc
> static inline void psi_cgroup_free(struct cgroup *cgrp)
> {
> }
> +
> +#include <linux/cgroup-defs.h>
> +
> static inline void cgroup_move_task(struct task_struct *p, struct css_set *to)
> {
> rcu_assign_pointer(p->cgroups, to);
>
> --
> ~Randy

2022-03-18 02:18:13

by Andrew Morton

[permalink] [raw]
Subject: Re: mmotm 2022-03-16-17-42 uploaded (uml sub-x86_64, sched/fair, RCU)

On Wed, 16 Mar 2022 21:52:44 -0700 Randy Dunlap <[email protected]> wrote:

> >> In file included from ./arch/x86/include/generated/asm/rwonce.h:1:0,
> >> from ../include/linux/compiler.h:248,
> >> from ../include/linux/kernel.h:20,
> >> from ../include/linux/cpumask.h:10,
> >> from ../include/linux/energy_model.h:4,
> >> from ../kernel/sched/fair.c:23:
> >> ../include/linux/psi.h: In function ‘cgroup_move_task’:
> >> ../include/linux/rcupdate.h:414:36: error: dereferencing pointer to incomplete type ‘struct css_set’
> >> #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
> >> ^~~~
> >
> > Works For Me. I tried `make x86_64_defconfig' and `make i386_defconfig' too.
> >
> > Can you please share that .config, or debug a bit?
>
> $ make ARCH=um SUBARCH=x86_64 defconfig
>

I still can't reproduce this :(

> This fixes the build error for me when CONFIG_PSI=n.

I have CONFIG_PSI=n

> ---
> include/linux/psi.h | 3 +++
> 1 file changed, 3 insertions(+)
>
> --- mmotm-2022-0316-1742.orig/include/linux/psi.h
> +++ mmotm-2022-0316-1742/include/linux/psi.h
> @@ -53,6 +53,9 @@ static inline int psi_cgroup_alloc(struc
> static inline void psi_cgroup_free(struct cgroup *cgrp)
> {
> }
> +
> +#include <linux/cgroup-defs.h>
> +
> static inline void cgroup_move_task(struct task_struct *p, struct css_set *to)
> {
> rcu_assign_pointer(p->cgroups, to);

Nothing in -next touches psi.h so I am unable to determine which patch
needs fixing :(

2022-03-18 02:20:58

by Randy Dunlap

[permalink] [raw]
Subject: Re: mmotm 2022-03-16-17-42 uploaded (uml sub-x86_64, sched/fair, RCU)



On 3/17/22 16:51, Andrew Morton wrote:
> On Wed, 16 Mar 2022 21:52:44 -0700 Randy Dunlap <[email protected]> wrote:
>
>>>> In file included from ./arch/x86/include/generated/asm/rwonce.h:1:0,
>>>> from ../include/linux/compiler.h:248,
>>>> from ../include/linux/kernel.h:20,
>>>> from ../include/linux/cpumask.h:10,
>>>> from ../include/linux/energy_model.h:4,
>>>> from ../kernel/sched/fair.c:23:
>>>> ../include/linux/psi.h: In function ‘cgroup_move_task’:
>>>> ../include/linux/rcupdate.h:414:36: error: dereferencing pointer to incomplete type ‘struct css_set’
>>>> #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
>>>> ^~~~
>>>
>>> Works For Me. I tried `make x86_64_defconfig' and `make i386_defconfig' too.
>>>
>>> Can you please share that .config, or debug a bit?
>>
>> $ make ARCH=um SUBARCH=x86_64 defconfig
>>
>
> I still can't reproduce this :(
>
>> This fixes the build error for me when CONFIG_PSI=n.
>
> I have CONFIG_PSI=n

There was also this report about linux-next, also with CONFIG_PSI=n:

https://lore.kernel.org/all/[email protected]/

but I just tried to build with the .config file supplied there and didn't
have any build errors...

If it was just me & mmotm, I could see it being a problem with applying
patches, but this other report looks the same as my initial report.

I dunno. If it persists, we will track it down and quash it.

>> ---
>> include/linux/psi.h | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> --- mmotm-2022-0316-1742.orig/include/linux/psi.h
>> +++ mmotm-2022-0316-1742/include/linux/psi.h
>> @@ -53,6 +53,9 @@ static inline int psi_cgroup_alloc(struc
>> static inline void psi_cgroup_free(struct cgroup *cgrp)
>> {
>> }
>> +
>> +#include <linux/cgroup-defs.h>
>> +
>> static inline void cgroup_move_task(struct task_struct *p, struct css_set *to)
>> {
>> rcu_assign_pointer(p->cgroups, to);
>
> Nothing in -next touches psi.h so I am unable to determine which patch
> needs fixing :(

--
~Randy

2022-03-18 09:05:05

by Randy Dunlap

[permalink] [raw]
Subject: Re: mmotm 2022-03-16-17-42 uploaded (uml sub-x86_64, sched/fair, RCU)

Andrew-

On 3/17/22 17:10, Randy Dunlap wrote:
>
>
> On 3/17/22 16:51, Andrew Morton wrote:
>> On Wed, 16 Mar 2022 21:52:44 -0700 Randy Dunlap <[email protected]> wrote:
>>
>>>>> In file included from ./arch/x86/include/generated/asm/rwonce.h:1:0,
>>>>> from ../include/linux/compiler.h:248,
>>>>> from ../include/linux/kernel.h:20,
>>>>> from ../include/linux/cpumask.h:10,
>>>>> from ../include/linux/energy_model.h:4,
>>>>> from ../kernel/sched/fair.c:23:
>>>>> ../include/linux/psi.h: In function ‘cgroup_move_task’:
>>>>> ../include/linux/rcupdate.h:414:36: error: dereferencing pointer to incomplete type ‘struct css_set’
>>>>> #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
>>>>> ^~~~
>>>>
>>>> Works For Me. I tried `make x86_64_defconfig' and `make i386_defconfig' too.
>>>>
>>>> Can you please share that .config, or debug a bit?
>>>
>>> $ make ARCH=um SUBARCH=x86_64 defconfig
>>>
>>
>> I still can't reproduce this :(
>>
>>> This fixes the build error for me when CONFIG_PSI=n.
>>
>> I have CONFIG_PSI=n
>
> There was also this report about linux-next, also with CONFIG_PSI=n:
>
> https://lore.kernel.org/all/[email protected]/
>
> but I just tried to build with the .config file supplied there and didn't
> have any build errors...
>
> If it was just me & mmotm, I could see it being a problem with applying
> patches, but this other report looks the same as my initial report.
>
> I dunno. If it persists, we will track it down and quash it.
>
>>> ---
>>> include/linux/psi.h | 3 +++
>>> 1 file changed, 3 insertions(+)
>>>
>>> --- mmotm-2022-0316-1742.orig/include/linux/psi.h
>>> +++ mmotm-2022-0316-1742/include/linux/psi.h
>>> @@ -53,6 +53,9 @@ static inline int psi_cgroup_alloc(struc
>>> static inline void psi_cgroup_free(struct cgroup *cgrp)
>>> {
>>> }
>>> +
>>> +#include <linux/cgroup-defs.h>
>>> +
>>> static inline void cgroup_move_task(struct task_struct *p, struct css_set *to)
>>> {
>>> rcu_assign_pointer(p->cgroups, to);
>>
>> Nothing in -next touches psi.h so I am unable to determine which patch
>> needs fixing :(

I took one i386 config file and tested with it:
linux-next 2022-0317 - fails as above
2022-0216 - fails as above
2022-0315 - builds successfully

I have 5 i386 configs that fail in this manner and 2 x86_64 configs that fail.
(all from mmotm)

I am attaching the first failing i386 config file but will happily provide
the rest of them if anyone wants them.
(just use 'make oldconfig' and press Enter at any kconfig prompts.)

--
~Randy


Attachments:
config-r2566.gz (37.93 kB)

2022-03-18 13:51:39

by Sachin Sant

[permalink] [raw]
Subject: Re: mmotm 2022-03-16-17-42 uploaded (uml sub-x86_64, sched/fair, RCU)


>> I still can't reproduce this :(
>>
>>> This fixes the build error for me when CONFIG_PSI=n.
>>
>> I have CONFIG_PSI=n
>
> There was also this report about linux-next, also with CONFIG_PSI=n:
>
> https://lore.kernel.org/all/[email protected]/

Yes, I can still recreate this build error (against 5.17.0-rc8-next-20220317)

CC kernel/sched/fair.o
In file included from ./arch/powerpc/include/generated/asm/rwonce.h:1,
from ./include/linux/compiler.h:248,
from ./include/linux/kernel.h:20,
from ./include/linux/cpumask.h:10,
from ./include/linux/energy_model.h:4,
from kernel/sched/fair.c:23:
./include/linux/psi.h: In function 'cgroup_move_task':
./include/linux/rcupdate.h:414:36: error: dereferencing pointer to incomplete type 'struct css_set'
#define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
^~~~
./include/asm-generic/rwonce.h:55:33: note: in definition of macro '__WRITE_ONC'
*(volatile typeof(x) *)&(x) = (val); \
^~~
./arch/powerpc/include/asm/barrier.h:74:2: note: in expansion of macro 'WRITE_ONCE'
WRITE_ONCE(*p, v); \
^~~~~~~~~~
./include/asm-generic/barrier.h:164:55: note: in expansion of macro '__smp_store_release'
#define smp_store_release(p, v) do { kcsan_release(); __smp_store_release(p, v); } while (0)
^~~~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:455:3: note: in expansion of macro 'smp_store_releas'
smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
^~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:455:25: note: in expansion of macro 'RCU_INITIALIZER'
smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
^~~~~~~~~~~~~~~
./include/linux/psi.h:58:2: note: in expansion of macro 'rcu_assign_pointer'
rcu_assign_pointer(p->cgroups, to);
^~~~~~~~~~~~~~~~~~
make[2]: *** [scripts/Makefile.build:310: kernel/sched/fair.o] Error 1
make[1]: *** [scripts/Makefile.build:638: kernel/sched] Error 2
make: *** [Makefile:1991: kernel] Error 2

As mentioned by Randy, this build break was introduced in next-20220316.
Git bisect points to:
commit c4ad6fcb67c42d65481c85733c8009c8afdfdf4e (refs/bisect/bad)
sched/headers: Reorganize, clean up and optimize kernel/sched/fair.c dependencies

The change suggested by Randy works for me.

I have attached .config for reference.

-Sachin


Attachments:
config_next.gz (40.43 kB)