* [linux-stable-rc:queue/4.19 41/42] kernel/cgroup/cgroup.c:2237:9: error: implicit declaration of function 'get_online_cpus'; did you mean 'get_online_mems'?
@ 2023-03-15 10:50 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-03-15 10:50 UTC (permalink / raw)
To: Tejun Heo; +Cc: oe-kbuild-all, Sasha Levin, Cai Xinchen, Greg Kroah-Hartman
tree: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git queue/4.19
head: c791a62cbcc10c6e2c28ea77fb74b95cd33916e3
commit: 5eaeeca9e096543f6f53c4859aa083b739514d36 [41/42] cgroup: Fix threadgroup_rwsem <-> cpus_read_lock() deadlock
config: riscv-defconfig (https://download.01.org/0day-ci/archive/20230315/202303151816.KSWgiPht-lkp@intel.com/config)
compiler: riscv64-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/commit/?id=5eaeeca9e096543f6f53c4859aa083b739514d36
git remote add linux-stable-rc https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git fetch --no-tags linux-stable-rc queue/4.19
git checkout 5eaeeca9e096543f6f53c4859aa083b739514d36
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=riscv olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash kernel/cgroup/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303151816.KSWgiPht-lkp@intel.com/
All errors (new ones prefixed by >>):
kernel/cgroup/cgroup.c: In function 'cgroup_attach_lock':
>> kernel/cgroup/cgroup.c:2237:9: error: implicit declaration of function 'get_online_cpus'; did you mean 'get_online_mems'? [-Werror=implicit-function-declaration]
2237 | get_online_cpus();
| ^~~~~~~~~~~~~~~
| get_online_mems
kernel/cgroup/cgroup.c: In function 'cgroup_attach_unlock':
>> kernel/cgroup/cgroup.c:2248:9: error: implicit declaration of function 'put_online_cpus'; did you mean 'num_online_cpus'? [-Werror=implicit-function-declaration]
2248 | put_online_cpus();
| ^~~~~~~~~~~~~~~
| num_online_cpus
cc1: some warnings being treated as errors
vim +2237 kernel/cgroup/cgroup.c
2211
2212 /**
2213 * cgroup_attach_lock - Lock for ->attach()
2214 * @lock_threadgroup: whether to down_write cgroup_threadgroup_rwsem
2215 *
2216 * cgroup migration sometimes needs to stabilize threadgroups against forks and
2217 * exits by write-locking cgroup_threadgroup_rwsem. However, some ->attach()
2218 * implementations (e.g. cpuset), also need to disable CPU hotplug.
2219 * Unfortunately, letting ->attach() operations acquire cpus_read_lock() can
2220 * lead to deadlocks.
2221 *
2222 * Bringing up a CPU may involve creating and destroying tasks which requires
2223 * read-locking threadgroup_rwsem, so threadgroup_rwsem nests inside
2224 * cpus_read_lock(). If we call an ->attach() which acquires the cpus lock while
2225 * write-locking threadgroup_rwsem, the locking order is reversed and we end up
2226 * waiting for an on-going CPU hotplug operation which in turn is waiting for
2227 * the threadgroup_rwsem to be released to create new tasks. For more details:
2228 *
2229 * http://lkml.kernel.org/r/20220711174629.uehfmqegcwn2lqzu@wubuntu
2230 *
2231 * Resolve the situation by always acquiring cpus_read_lock() before optionally
2232 * write-locking cgroup_threadgroup_rwsem. This allows ->attach() to assume that
2233 * CPU hotplug is disabled on entry.
2234 */
2235 static void cgroup_attach_lock(void)
2236 {
> 2237 get_online_cpus();
2238 percpu_down_write(&cgroup_threadgroup_rwsem);
2239 }
2240
2241 /**
2242 * cgroup_attach_unlock - Undo cgroup_attach_lock()
2243 * @lock_threadgroup: whether to up_write cgroup_threadgroup_rwsem
2244 */
2245 static void cgroup_attach_unlock(void)
2246 {
2247 percpu_up_write(&cgroup_threadgroup_rwsem);
> 2248 put_online_cpus();
2249 }
2250
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-03-15 10:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-15 10:50 [linux-stable-rc:queue/4.19 41/42] kernel/cgroup/cgroup.c:2237:9: error: implicit declaration of function 'get_online_cpus'; did you mean 'get_online_mems'? kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.