* stable-rc: 5.4: cgroup.c:2404:2: error: implicit declaration of function 'cpus_read_lock' [-Werror,-Wimplicit-function-declaration]
@ 2022-09-13 11:18 Naresh Kamboju
2022-09-13 13:58 ` Greg Kroah-Hartman
2022-09-13 13:59 ` Sasha Levin
0 siblings, 2 replies; 5+ messages in thread
From: Naresh Kamboju @ 2022-09-13 11:18 UTC (permalink / raw)
To: linux-stable, lkft-triage
Cc: Greg Kroah-Hartman, Sasha Levin, Tejun Heo, Imran Khan,
Xuewen Yan
On stable-rc 5.4 arm and arm64 builds failed due to following errors / warnings.
kernel/cgroup/cgroup.c:2404:2: error: implicit declaration of function
'cpus_read_lock' [-Werror,-Wimplicit-function-declaration]
cpus_read_lock();
^
kernel/cgroup/cgroup.c:2404:2: note: did you mean 'cpuset_read_lock'?
include/linux/cpuset.h:58:13: note: 'cpuset_read_lock' declared here
extern void cpuset_read_lock(void);
^
kernel/cgroup/cgroup.c:2417:2: error: implicit declaration of function
'cpus_read_unlock' [-Werror,-Wimplicit-function-declaration]
cpus_read_unlock();
^
kernel/cgroup/cgroup.c:2417:2: note: did you mean 'cpuset_read_unlock'?
include/linux/cpuset.h:59:13: note: 'cpuset_read_unlock' declared here
extern void cpuset_read_unlock(void);
^
2 errors generated.
drivers/gpu/drm/drm_lock.c:363:6: warning: misleading indentation;
statement is not part of the previous 'if' [-Wmisleading-indentation]
*/ mutex_lock(&dev->struct_mutex);
^
drivers/gpu/drm/drm_lock.c:357:2: note: previous statement is here
if (!drm_core_check_feature(dev, DRIVER_LEGACY))
^
1 warning generated.
Build link:
- https://builds.tuxbuild.com/2EfrNYbejRQczhhqndawRkHARHZ/
Steps to reproduce:
-------------------
# To install tuxmake on your system globally:
# sudo pip3 install -U tuxmake
#
tuxmake --runtime podman --target-arch arm64 --toolchain clang-nightly
--kconfig defconfig LLVM=1 LLVM_IAS=1
Following patch might be the reason for these build errors:
---
cgroup: Fix threadgroup_rwsem <-> cpus_read_lock() deadlock
[ Upstream commit 4f7e7236435ca0abe005c674ebd6892c6e83aeb3 ]
Bringing up a CPU may involve creating and destroying tasks which requires
read-locking threadgroup_rwsem, so threadgroup_rwsem nests inside
cpus_read_lock(). However, cpuset's ->attach(), which may be called with
thredagroup_rwsem write-locked, also wants to disable CPU hotplug and
acquires cpus_read_lock(), leading to a deadlock.
Fix it by guaranteeing that ->attach() is always called with CPU hotplug
disabled and removing cpus_read_lock() call from cpuset_attach().
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-and-tested-by: Imran Khan <imran.f.khan@oracle.com>
Reported-and-tested-by: Xuewen Yan <xuewen.yan@unisoc.com>
Fixes: 05c7b7a92cc8 ("cgroup/cpuset: Fix a race between
cpuset_attach() and cpu hotplug")
Cc: stable@vger.kernel.org # v5.17+
Signed-off-by: Sasha Levin <sashal@kernel.org>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: stable-rc: 5.4: cgroup.c:2404:2: error: implicit declaration of function 'cpus_read_lock' [-Werror,-Wimplicit-function-declaration]
2022-09-13 11:18 stable-rc: 5.4: cgroup.c:2404:2: error: implicit declaration of function 'cpus_read_lock' [-Werror,-Wimplicit-function-declaration] Naresh Kamboju
@ 2022-09-13 13:58 ` Greg Kroah-Hartman
2022-09-13 13:59 ` Sasha Levin
1 sibling, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2022-09-13 13:58 UTC (permalink / raw)
To: Naresh Kamboju
Cc: linux-stable, lkft-triage, Sasha Levin, Tejun Heo, Imran Khan,
Xuewen Yan
On Tue, Sep 13, 2022 at 04:48:44PM +0530, Naresh Kamboju wrote:
> On stable-rc 5.4 arm and arm64 builds failed due to following errors / warnings.
>
> kernel/cgroup/cgroup.c:2404:2: error: implicit declaration of function
> 'cpus_read_lock' [-Werror,-Wimplicit-function-declaration]
> cpus_read_lock();
> ^
> kernel/cgroup/cgroup.c:2404:2: note: did you mean 'cpuset_read_lock'?
> include/linux/cpuset.h:58:13: note: 'cpuset_read_lock' declared here
> extern void cpuset_read_lock(void);
> ^
> kernel/cgroup/cgroup.c:2417:2: error: implicit declaration of function
> 'cpus_read_unlock' [-Werror,-Wimplicit-function-declaration]
> cpus_read_unlock();
> ^
> kernel/cgroup/cgroup.c:2417:2: note: did you mean 'cpuset_read_unlock'?
> include/linux/cpuset.h:59:13: note: 'cpuset_read_unlock' declared here
> extern void cpuset_read_unlock(void);
> ^
> 2 errors generated.
>
> drivers/gpu/drm/drm_lock.c:363:6: warning: misleading indentation;
> statement is not part of the previous 'if' [-Wmisleading-indentation]
> */ mutex_lock(&dev->struct_mutex);
> ^
> drivers/gpu/drm/drm_lock.c:357:2: note: previous statement is here
> if (!drm_core_check_feature(dev, DRIVER_LEGACY))
> ^
> 1 warning generated.
>
> Build link:
> - https://builds.tuxbuild.com/2EfrNYbejRQczhhqndawRkHARHZ/
>
>
> Steps to reproduce:
> -------------------
> # To install tuxmake on your system globally:
> # sudo pip3 install -U tuxmake
> #
>
> tuxmake --runtime podman --target-arch arm64 --toolchain clang-nightly
> --kconfig defconfig LLVM=1 LLVM_IAS=1
>
> Following patch might be the reason for these build errors:
> ---
> cgroup: Fix threadgroup_rwsem <-> cpus_read_lock() deadlock
> [ Upstream commit 4f7e7236435ca0abe005c674ebd6892c6e83aeb3 ]
>
> Bringing up a CPU may involve creating and destroying tasks which requires
> read-locking threadgroup_rwsem, so threadgroup_rwsem nests inside
> cpus_read_lock(). However, cpuset's ->attach(), which may be called with
> thredagroup_rwsem write-locked, also wants to disable CPU hotplug and
> acquires cpus_read_lock(), leading to a deadlock.
>
> Fix it by guaranteeing that ->attach() is always called with CPU hotplug
> disabled and removing cpus_read_lock() call from cpuset_attach().
>
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Reviewed-and-tested-by: Imran Khan <imran.f.khan@oracle.com>
> Reported-and-tested-by: Xuewen Yan <xuewen.yan@unisoc.com>
> Fixes: 05c7b7a92cc8 ("cgroup/cpuset: Fix a race between
> cpuset_attach() and cpu hotplug")
> Cc: stable@vger.kernel.org # v5.17+
> Signed-off-by: Sasha Levin <sashal@kernel.org>
Thanks, I've added an #include that should resolve this now.
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: stable-rc: 5.4: cgroup.c:2404:2: error: implicit declaration of function 'cpus_read_lock' [-Werror,-Wimplicit-function-declaration]
2022-09-13 11:18 stable-rc: 5.4: cgroup.c:2404:2: error: implicit declaration of function 'cpus_read_lock' [-Werror,-Wimplicit-function-declaration] Naresh Kamboju
2022-09-13 13:58 ` Greg Kroah-Hartman
@ 2022-09-13 13:59 ` Sasha Levin
2022-09-13 14:22 ` Naresh Kamboju
1 sibling, 1 reply; 5+ messages in thread
From: Sasha Levin @ 2022-09-13 13:59 UTC (permalink / raw)
To: Naresh Kamboju
Cc: linux-stable, lkft-triage, Greg Kroah-Hartman, Tejun Heo,
Imran Khan, Xuewen Yan
On Tue, Sep 13, 2022 at 04:48:44PM +0530, Naresh Kamboju wrote:
>On stable-rc 5.4 arm and arm64 builds failed due to following errors / warnings.
>
>kernel/cgroup/cgroup.c:2404:2: error: implicit declaration of function
>'cpus_read_lock' [-Werror,-Wimplicit-function-declaration]
> cpus_read_lock();
> ^
>kernel/cgroup/cgroup.c:2404:2: note: did you mean 'cpuset_read_lock'?
>include/linux/cpuset.h:58:13: note: 'cpuset_read_lock' declared here
>extern void cpuset_read_lock(void);
> ^
>kernel/cgroup/cgroup.c:2417:2: error: implicit declaration of function
>'cpus_read_unlock' [-Werror,-Wimplicit-function-declaration]
> cpus_read_unlock();
> ^
>kernel/cgroup/cgroup.c:2417:2: note: did you mean 'cpuset_read_unlock'?
>include/linux/cpuset.h:59:13: note: 'cpuset_read_unlock' declared here
>extern void cpuset_read_unlock(void);
> ^
>2 errors generated.
>
>drivers/gpu/drm/drm_lock.c:363:6: warning: misleading indentation;
>statement is not part of the previous 'if' [-Wmisleading-indentation]
> */ mutex_lock(&dev->struct_mutex);
> ^
>drivers/gpu/drm/drm_lock.c:357:2: note: previous statement is here
> if (!drm_core_check_feature(dev, DRIVER_LEGACY))
> ^
>1 warning generated.
>
>Build link:
> - https://builds.tuxbuild.com/2EfrNYbejRQczhhqndawRkHARHZ/
>
>
>Steps to reproduce:
>-------------------
># To install tuxmake on your system globally:
># sudo pip3 install -U tuxmake
>#
>
>tuxmake --runtime podman --target-arch arm64 --toolchain clang-nightly
>--kconfig defconfig LLVM=1 LLVM_IAS=1
Hm, I can't reproduce this one, (and can't install tuxmake on the work
machine). What's the actual config that you end up using here?
--
Thanks,
Sasha
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: stable-rc: 5.4: cgroup.c:2404:2: error: implicit declaration of function 'cpus_read_lock' [-Werror,-Wimplicit-function-declaration]
2022-09-13 13:59 ` Sasha Levin
@ 2022-09-13 14:22 ` Naresh Kamboju
2022-09-13 16:16 ` Sasha Levin
0 siblings, 1 reply; 5+ messages in thread
From: Naresh Kamboju @ 2022-09-13 14:22 UTC (permalink / raw)
To: Sasha Levin
Cc: linux-stable, lkft-triage, Greg Kroah-Hartman, Tejun Heo,
Imran Khan, Xuewen Yan
On Tue, 13 Sept 2022 at 19:29, Sasha Levin <sashal@kernel.org> wrote:
>
> On Tue, Sep 13, 2022 at 04:48:44PM +0530, Naresh Kamboju wrote:
> >On stable-rc 5.4 arm and arm64 builds failed due to following errors / warnings.
> >
> >kernel/cgroup/cgroup.c:2404:2: error: implicit declaration of function
> >'cpus_read_lock' [-Werror,-Wimplicit-function-declaration]
> > cpus_read_lock();
> > ^
> >kernel/cgroup/cgroup.c:2404:2: note: did you mean 'cpuset_read_lock'?
> >include/linux/cpuset.h:58:13: note: 'cpuset_read_lock' declared here
> >extern void cpuset_read_lock(void);
> > ^
> >kernel/cgroup/cgroup.c:2417:2: error: implicit declaration of function
> >'cpus_read_unlock' [-Werror,-Wimplicit-function-declaration]
> > cpus_read_unlock();
> > ^
> >kernel/cgroup/cgroup.c:2417:2: note: did you mean 'cpuset_read_unlock'?
> >include/linux/cpuset.h:59:13: note: 'cpuset_read_unlock' declared here
> >extern void cpuset_read_unlock(void);
> > ^
> >2 errors generated.
> >
> >drivers/gpu/drm/drm_lock.c:363:6: warning: misleading indentation;
> >statement is not part of the previous 'if' [-Wmisleading-indentation]
> > */ mutex_lock(&dev->struct_mutex);
> > ^
> >drivers/gpu/drm/drm_lock.c:357:2: note: previous statement is here
> > if (!drm_core_check_feature(dev, DRIVER_LEGACY))
> > ^
> >1 warning generated.
> >
> >Build link:
> > - https://builds.tuxbuild.com/2EfrNYbejRQczhhqndawRkHARHZ/
> >
> >
> >Steps to reproduce:
> >-------------------
> ># To install tuxmake on your system globally:
> ># sudo pip3 install -U tuxmake
> >#
> >
> >tuxmake --runtime podman --target-arch arm64 --toolchain clang-nightly
> >--kconfig defconfig LLVM=1 LLVM_IAS=1
>
> Hm, I can't reproduce this one, (and can't install tuxmake on the work
> machine). What's the actual config that you end up using here?
The "defconfig" for arm64 with clang nightly.
- Naresh
>
> --
> Thanks,
> Sasha
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: stable-rc: 5.4: cgroup.c:2404:2: error: implicit declaration of function 'cpus_read_lock' [-Werror,-Wimplicit-function-declaration]
2022-09-13 14:22 ` Naresh Kamboju
@ 2022-09-13 16:16 ` Sasha Levin
0 siblings, 0 replies; 5+ messages in thread
From: Sasha Levin @ 2022-09-13 16:16 UTC (permalink / raw)
To: Naresh Kamboju
Cc: linux-stable, lkft-triage, Greg Kroah-Hartman, Tejun Heo,
Imran Khan, Xuewen Yan
On Tue, Sep 13, 2022 at 07:52:38PM +0530, Naresh Kamboju wrote:
>On Tue, 13 Sept 2022 at 19:29, Sasha Levin <sashal@kernel.org> wrote:
>>
>> On Tue, Sep 13, 2022 at 04:48:44PM +0530, Naresh Kamboju wrote:
>> >On stable-rc 5.4 arm and arm64 builds failed due to following errors / warnings.
>> >
>> >kernel/cgroup/cgroup.c:2404:2: error: implicit declaration of function
>> >'cpus_read_lock' [-Werror,-Wimplicit-function-declaration]
>> > cpus_read_lock();
>> > ^
>> >kernel/cgroup/cgroup.c:2404:2: note: did you mean 'cpuset_read_lock'?
>> >include/linux/cpuset.h:58:13: note: 'cpuset_read_lock' declared here
>> >extern void cpuset_read_lock(void);
>> > ^
>> >kernel/cgroup/cgroup.c:2417:2: error: implicit declaration of function
>> >'cpus_read_unlock' [-Werror,-Wimplicit-function-declaration]
>> > cpus_read_unlock();
>> > ^
>> >kernel/cgroup/cgroup.c:2417:2: note: did you mean 'cpuset_read_unlock'?
>> >include/linux/cpuset.h:59:13: note: 'cpuset_read_unlock' declared here
>> >extern void cpuset_read_unlock(void);
>> > ^
>> >2 errors generated.
>> >
>> >drivers/gpu/drm/drm_lock.c:363:6: warning: misleading indentation;
>> >statement is not part of the previous 'if' [-Wmisleading-indentation]
>> > */ mutex_lock(&dev->struct_mutex);
>> > ^
>> >drivers/gpu/drm/drm_lock.c:357:2: note: previous statement is here
>> > if (!drm_core_check_feature(dev, DRIVER_LEGACY))
>> > ^
>> >1 warning generated.
>> >
>> >Build link:
>> > - https://builds.tuxbuild.com/2EfrNYbejRQczhhqndawRkHARHZ/
>> >
>> >
>> >Steps to reproduce:
>> >-------------------
>> ># To install tuxmake on your system globally:
>> ># sudo pip3 install -U tuxmake
>> >#
>> >
>> >tuxmake --runtime podman --target-arch arm64 --toolchain clang-nightly
>> >--kconfig defconfig LLVM=1 LLVM_IAS=1
>>
>> Hm, I can't reproduce this one, (and can't install tuxmake on the work
>> machine). What's the actual config that you end up using here?
>
>The "defconfig" for arm64 with clang nightly.
Greg actually ended up fixing it up and I haven't noticed, thanks both
:)
--
Thanks,
Sasha
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-09-13 17:28 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-13 11:18 stable-rc: 5.4: cgroup.c:2404:2: error: implicit declaration of function 'cpus_read_lock' [-Werror,-Wimplicit-function-declaration] Naresh Kamboju
2022-09-13 13:58 ` Greg Kroah-Hartman
2022-09-13 13:59 ` Sasha Levin
2022-09-13 14:22 ` Naresh Kamboju
2022-09-13 16:16 ` Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox