From: kernel test robot <lkp@intel.com>
To: Yi Tao <escape@linux.alibaba.com>,
tj@kernel.org, hannes@cmpxchg.org, mkoutny@suse.com
Cc: oe-kbuild-all@lists.linux.dev, cgroups@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/1] cgroup: replace global percpu_rwsem with signal_struct->group_rwsem when writing cgroup.procs/threads
Date: Fri, 5 Sep 2025 21:17:52 +0800 [thread overview]
Message-ID: <202509052150.4GQ04PJn-lkp@intel.com> (raw)
In-Reply-To: <068d58f1f497bc4971c6ac0bae58bf53b98451fd.1756985260.git.escape@linux.alibaba.com>
Hi Yi,
kernel test robot noticed the following build errors:
[auto build test ERROR on tj-cgroup/for-next]
[also build test ERROR on kees/for-next/execve akpm-mm/mm-everything tip/sched/core linus/master v6.17-rc4]
[cannot apply to next-20250905]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Yi-Tao/cgroup-replace-global-percpu_rwsem-with-signal_struct-group_rwsem-when-writing-cgroup-procs-threads/20250904-194505
base: https://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git for-next
patch link: https://lore.kernel.org/r/068d58f1f497bc4971c6ac0bae58bf53b98451fd.1756985260.git.escape%40linux.alibaba.com
patch subject: [PATCH v2 1/1] cgroup: replace global percpu_rwsem with signal_struct->group_rwsem when writing cgroup.procs/threads
config: i386-buildonly-randconfig-004-20250905 (https://download.01.org/0day-ci/archive/20250905/202509052150.4GQ04PJn-lkp@intel.com/config)
compiler: gcc-13 (Debian 13.3.0-16) 13.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250905/202509052150.4GQ04PJn-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202509052150.4GQ04PJn-lkp@intel.com/
All errors (new ones prefixed by >>):
kernel/cgroup/cgroup.c: In function 'cgroup_attach_lock':
>> kernel/cgroup/cgroup.c:2511:28: error: 'favor_dynmods' undeclared (first use in this function); did you mean 'Opt_favordynmods'?
2511 | if (tsk && favor_dynmods)
| ^~~~~~~~~~~~~
| Opt_favordynmods
kernel/cgroup/cgroup.c:2511:28: note: each undeclared identifier is reported only once for each function it appears in
kernel/cgroup/cgroup.c: In function 'cgroup_attach_unlock':
kernel/cgroup/cgroup.c:2526:28: error: 'favor_dynmods' undeclared (first use in this function); did you mean 'Opt_favordynmods'?
2526 | if (tsk && favor_dynmods)
| ^~~~~~~~~~~~~
| Opt_favordynmods
vim +2511 kernel/cgroup/cgroup.c
2482
2483 /**
2484 * cgroup_attach_lock - Lock for ->attach()
2485 * @tsk: thread group to lock
2486 * @lock_threadgroup: whether to down_write rwsem
2487 *
2488 * cgroup migration sometimes needs to stabilize threadgroups against forks and
2489 * exits by write-locking cgroup_threadgroup_rwsem. However, some ->attach()
2490 * implementations (e.g. cpuset), also need to disable CPU hotplug.
2491 * Unfortunately, letting ->attach() operations acquire cpus_read_lock() can
2492 * lead to deadlocks.
2493 *
2494 * Bringing up a CPU may involve creating and destroying tasks which requires
2495 * read-locking threadgroup_rwsem, so threadgroup_rwsem nests inside
2496 * cpus_read_lock(). If we call an ->attach() which acquires the cpus lock while
2497 * write-locking threadgroup_rwsem, the locking order is reversed and we end up
2498 * waiting for an on-going CPU hotplug operation which in turn is waiting for
2499 * the threadgroup_rwsem to be released to create new tasks. For more details:
2500 *
2501 * http://lkml.kernel.org/r/20220711174629.uehfmqegcwn2lqzu@wubuntu
2502 *
2503 * Resolve the situation by always acquiring cpus_read_lock() before optionally
2504 * write-locking cgroup_threadgroup_rwsem. This allows ->attach() to assume that
2505 * CPU hotplug is disabled on entry.
2506 */
2507 void cgroup_attach_lock(struct task_struct *tsk, bool lock_threadgroup)
2508 {
2509 cpus_read_lock();
2510 if (lock_threadgroup) {
> 2511 if (tsk && favor_dynmods)
2512 down_write(&tsk->signal->group_rwsem);
2513 else
2514 percpu_down_write(&cgroup_threadgroup_rwsem);
2515 }
2516 }
2517
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2025-09-05 13:18 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-03 11:11 [PATCH] " Yi Tao
2025-09-03 13:14 ` Waiman Long
2025-09-04 1:35 ` Chen Ridong
2025-09-04 4:59 ` escape
2025-09-04 5:02 ` escape
2025-09-03 16:53 ` Tejun Heo
2025-09-03 20:03 ` Michal Koutný
2025-09-03 20:45 ` Tejun Heo
2025-09-04 1:40 ` Chen Ridong
2025-09-04 6:43 ` escape
2025-09-04 6:52 ` Tejun Heo
2025-09-04 3:15 ` escape
2025-09-04 6:38 ` escape
2025-09-04 7:28 ` Tejun Heo
2025-09-04 8:10 ` escape
2025-09-04 11:39 ` [PATCH v2 0/1] " Yi Tao
2025-09-04 11:39 ` [PATCH v2 1/1] " Yi Tao
2025-09-04 16:31 ` Tejun Heo
2025-09-05 2:16 ` escape
2025-09-05 2:27 ` Tejun Heo
2025-09-05 3:44 ` escape
2025-09-05 3:48 ` Tejun Heo
2025-09-05 4:30 ` escape
2025-09-05 2:02 ` Chen Ridong
2025-09-05 13:17 ` kernel test robot [this message]
2025-09-08 10:20 ` [PATCH v3 0/1] cgroup: replace global percpu_rwsem with per threadgroup resem when writing to cgroup.procs Yi Tao
2025-09-08 10:20 ` [PATCH v3 1/1] " Yi Tao
2025-09-08 16:05 ` Tejun Heo
2025-09-08 19:39 ` Waiman Long
2025-09-09 7:55 ` [PATCH v4 0/3] " Yi Tao
2025-09-09 7:55 ` [PATCH v4 1/3] " Yi Tao
2025-09-09 7:55 ` [PATCH v4 2/3] cgroup: retry find task if threadgroup leader changed Yi Tao
2025-09-09 16:59 ` Tejun Heo
2025-09-09 7:55 ` [PATCH v4 3/3] cgroup: refactor the cgroup_attach_lock code to make it clearer Yi Tao
2025-09-09 17:00 ` Tejun Heo
2025-09-10 6:59 ` [PATCH v5 0/3] cgroup: replace global percpu_rwsem with per threadgroup resem when writing to cgroup.procs Yi Tao
2025-09-10 6:59 ` [PATCH v5 1/3] cgroup: refactor the cgroup_attach_lock code to make it clearer Yi Tao
2025-09-10 17:26 ` Tejun Heo
2025-09-10 6:59 ` [PATCH v5 2/3] cgroup: relocate cgroup_attach_lock within cgroup_procs_write_start Yi Tao
2025-09-10 17:31 ` Tejun Heo
2025-09-11 3:22 ` Waiman Long
2025-09-10 6:59 ` [PATCH v5 3/3] cgroup: replace global percpu_rwsem with per threadgroup resem when writing to cgroup.procs Yi Tao
2025-09-10 17:47 ` Tejun Heo
2025-09-11 1:52 ` Yi Tao
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=202509052150.4GQ04PJn-lkp@intel.com \
--to=lkp@intel.com \
--cc=cgroups@vger.kernel.org \
--cc=escape@linux.alibaba.com \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkoutny@suse.com \
--cc=oe-kbuild-all@lists.linux.dev \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®