Linux cgroups development
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: "Michal Koutný" <mkoutny@suse.com>
Cc: Tejun Heo <tj@kernel.org>, Zefan Li <lizefan.x@bytedance.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Yafang Shao <laoar.shao@gmail.com>,
	cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Yosry Ahmed <yosryahmed@google.com>
Subject: Re: [PATCH-cgroup v2] cgroup: Move rcu_head up near the top of cgroup_root
Date: Thu, 7 Dec 2023 12:40:33 -0500	[thread overview]
Message-ID: <5c35f648-88cc-4de2-91d7-fb95ceae15b9@redhat.com> (raw)
In-Reply-To: <65h3s447i3fkygdtilucda2q6uaygtzfpxb6vsjgwoeybwwgtw@6ahmtj47ggzh>

On 12/7/23 11:46, Michal Koutný wrote:
> On Thu, Dec 07, 2023 at 08:46:14AM -0500, Waiman Long <longman@redhat.com> wrote:
>> Commit 77070eeb8821 ("cgroup: Avoid false cacheline sharing of read
>> mostly rstat_cpu") happens to be the last straw that breaks it.
> FTR, when I build kernel from that commit, I can see
>
>> struct cgroup_root {
>> 	struct kernfs_root *       kf_root;              /*     0     8 */
>> 	unsigned int               subsys_mask;          /*     8     4 */
>> 	int                        hierarchy_id;         /*    12     4 */
>>
>> 	/* XXX 48 bytes hole, try to pack */
>>
>> 	/* --- cacheline 1 boundary (64 bytes) --- */
>> 	struct cgroup              cgrp __attribute__((__aligned__(64))); /*    64  2368 */
>>
>> 	/* XXX last struct has 8 bytes of padding */
>>
>> 	/* --- cacheline 38 boundary (2432 bytes) --- */
>> 	struct cgroup *            cgrp_ancestor_storage; /*  2432     8 */
>> 	atomic_t                   nr_cgrps;             /*  2440     4 */
>>
>> 	/* XXX 4 bytes hole, try to pack */
>>
>> 	struct list_head           root_list;            /*  2448    16 */
>> 	struct callback_head       rcu __attribute__((__aligned__(8))); /*  2464    16 */
>> 	unsigned int               flags;                /*  2480     4 */
>> 	char                       release_agent_path[4096]; /*  2484  4096 */
>> 	/* --- cacheline 102 boundary (6528 bytes) was 52 bytes ago --- */
>> 	char                       name[64];             /*  6580    64 */
>>
>> 	/* size: 6656, cachelines: 104, members: 11 */
>> 	/* sum members: 6592, holes: 2, sum holes: 52 */
>> 	/* padding: 12 */
>> 	/* paddings: 1, sum paddings: 8 */
>> 	/* forced alignments: 2, forced holes: 1, sum forced holes: 48 */
>> } __attribute__((__aligned__(64)));
> 2480 has still quite a reserve below 4096. (I can't see an CONFIG_*
> affecting this.)
>
> Perhaps, I missed something from the linux-next merging thread?

CONFIG_LOCKDEP and some other debug configs are enabled with 
allmodconfig. This can greatly increase the size of some of the 
structures. I am not able to use pahole due to missing BTF info so I 
don't the exact size. However, I can reproduce the build failure and the 
patch is  able to fix it.

Cheers,
Longman


  reply	other threads:[~2023-12-07 17:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07 13:46 [PATCH-cgroup v2] cgroup: Move rcu_head up near the top of cgroup_root Waiman Long
2023-12-07 16:46 ` Michal Koutný
2023-12-07 17:40   ` Waiman Long [this message]
2023-12-07 18:04     ` Michal Koutný
2023-12-07 17:52 ` Yosry Ahmed
2023-12-07 22:56 ` Tejun Heo

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=5c35f648-88cc-4de2-91d7-fb95ceae15b9@redhat.com \
    --to=longman@redhat.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=laoar.shao@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan.x@bytedance.com \
    --cc=mkoutny@suse.com \
    --cc=sfr@canb.auug.org.au \
    --cc=tj@kernel.org \
    --cc=yosryahmed@google.com \
    /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