From: kernel test robot <lkp@intel.com>
To: Tejun Heo <tj@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev, Sasha Levin <sashal@kernel.org>,
Cai Xinchen <caixinchen1@huawei.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [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'?
Date: Wed, 15 Mar 2023 18:50:32 +0800 [thread overview]
Message-ID: <202303151816.KSWgiPht-lkp@intel.com> (raw)
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
reply other threads:[~2023-03-15 10:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202303151816.KSWgiPht-lkp@intel.com \
--to=lkp@intel.com \
--cc=caixinchen1@huawei.com \
--cc=gregkh@linuxfoundation.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=sashal@kernel.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.