linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: Stephen Rothwell <sfr@canb.auug.org.au>, Tejun Heo <tj@kernel.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: Re: linux-next: build failure after merge of the cgroup tree
Date: Wed, 6 Dec 2023 23:18:03 -0500	[thread overview]
Message-ID: <d7e24393-540b-4fcc-84a8-3ad9daf26762@redhat.com> (raw)
In-Reply-To: <20231207143806.114e0a74@canb.auug.org.au>


On 12/6/23 22:38, Stephen Rothwell wrote:
> Hi all,
>
> After merging the cgroup tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
>
> In file included from <command-line>:
> kernel/cgroup/cgroup.c: In function 'cgroup_free_root':
> include/linux/compiler_types.h:435:45: error: call to '__compiletime_assert_1792' declared with attribute error: BUILD_BUG_ON failed: !__is_kvfree_rcu_offset(offsetof(typeof(*(root)), rcu))
>    435 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
>        |                                             ^
> include/linux/compiler_types.h:416:25: note: in definition of macro '__compiletime_assert'
>    416 |                         prefix ## suffix();                             \
>        |                         ^~~~~~
> include/linux/compiler_types.h:435:9: note: in expansion of macro '_compiletime_assert'
>    435 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
>        |         ^~~~~~~~~~~~~~~~~~~
> include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
>     39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
>        |                                     ^~~~~~~~~~~~~~~~~~
> include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
>     50 |         BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
>        |         ^~~~~~~~~~~~~~~~
> include/linux/rcupdate.h:985:17: note: in expansion of macro 'BUILD_BUG_ON'
>    985 |                 BUILD_BUG_ON(!__is_kvfree_rcu_offset(offsetof(typeof(*(ptr)), rhf)));   \

#define __is_kvfree_rcu_offset(offset) ((offset) < 4096)

It looks like commit 77070eeb8821 ("cgroup: Avoid false cacheline 
sharing of read mostly rstat_cpu") has caused the offset of rcu to 
exceed the 4096 limit under such configuration. After I move the rcu 
field up, the compilation error was gone. So any change that makes the 
cgroup structure larger is likely to cause this problem again. The 
simple fix is just to move the rcu field up. I will send a patch to do that.

Cheers,
Longman


>        |                 ^~~~~~~~~~~~
> include/linux/rcupdate.h:957:29: note: in expansion of macro 'kvfree_rcu_arg_2'
>    957 | #define kfree_rcu(ptr, rhf) kvfree_rcu_arg_2(ptr, rhf)
>        |                             ^~~~~~~~~~~~~~~~
> kernel/cgroup/cgroup.c:1318:9: note: in expansion of macro 'kfree_rcu'
>   1318 |         kfree_rcu(root, rcu);
>        |         ^~~~~~~~~
> In function 'cgroup_free_root',
>      inlined from 'cgroup_destroy_root' at kernel/cgroup/cgroup.c:1363:2:
> include/linux/compiler_types.h:435:45: error: call to '__compiletime_assert_1792' declared with attribute error: BUILD_BUG_ON failed: !__is_kvfree_rcu_offset(offsetof(typeof(*(root)), rcu))
>    435 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
>        |                                             ^
> include/linux/compiler_types.h:416:25: note: in definition of macro '__compiletime_assert'
>    416 |                         prefix ## suffix();                             \
>        |                         ^~~~~~
> include/linux/compiler_types.h:435:9: note: in expansion of macro '_compiletime_assert'
>    435 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
>        |         ^~~~~~~~~~~~~~~~~~~
> include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
>     39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
>        |                                     ^~~~~~~~~~~~~~~~~~
> include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
>     50 |         BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
>        |         ^~~~~~~~~~~~~~~~
> include/linux/rcupdate.h:985:17: note: in expansion of macro 'BUILD_BUG_ON'
>    985 |                 BUILD_BUG_ON(!__is_kvfree_rcu_offset(offsetof(typeof(*(ptr)), rhf)));   \
>        |                 ^~~~~~~~~~~~
> include/linux/rcupdate.h:957:29: note: in expansion of macro 'kvfree_rcu_arg_2'
>    957 | #define kfree_rcu(ptr, rhf) kvfree_rcu_arg_2(ptr, rhf)
>        |                             ^~~~~~~~~~~~~~~~
> kernel/cgroup/cgroup.c:1318:9: note: in expansion of macro 'kfree_rcu'
>   1318 |         kfree_rcu(root, rcu);
>        |         ^~~~~~~~~
>
> Possibly caused by commit
>
>    77070eeb8821 ("cgroup: Avoid false cacheline sharing of read mostly rstat_cpu")
>
> I have used the cgroup tree from next-20231206 for today.
>
>
>


  reply	other threads:[~2023-12-07  4:18 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07  3:38 linux-next: build failure after merge of the cgroup tree Stephen Rothwell
2023-12-07  4:18 ` Waiman Long [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-07-17  1:34 Stephen Rothwell
2023-07-17  6:45 ` Miaohe Lin
2022-10-31  2:23 Stephen Rothwell
2022-10-31 17:52 ` Tejun Heo
2022-09-12  6:18 Stephen Rothwell
2022-09-12  7:38 ` Peter Zijlstra
2022-09-12 18:44   ` Tejun Heo
2022-09-12 22:16     ` Tejun Heo
2022-09-15 10:46       ` Peter Zijlstra
2022-10-10 20:57 ` Stephen Rothwell
2022-10-10 20:59   ` Tejun Heo
2022-08-29  3:29 Stephen Rothwell
2021-05-11  0:51 Stephen Rothwell
2021-05-11  1:10 ` Roman Gushchin
2021-05-11  1:31   ` Tejun Heo
2021-04-22  6:31 Stephen Rothwell
2015-09-25  3:26 Stephen Rothwell
2014-02-26  6:46 Stephen Rothwell
2014-02-26 13:44 ` Tejun Heo
2013-04-29  4:04 Stephen Rothwell
2013-04-29 22:55 ` Tejun Heo
2013-04-30  1:51   ` Benjamin Herrenschmidt
2012-09-14  3:17 Stephen Rothwell
2012-09-14  6:56 ` Daniel Wagner
2012-09-14 17:00   ` Tejun Heo
2012-09-14 18:32     ` Sedat Dilek
2012-09-14 18:34       ` Tejun Heo
2012-09-15  7:55         ` Sedat Dilek
2011-11-25  3:50 Stephen Rothwell
2011-11-27 19:33 ` 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=d7e24393-540b-4fcc-84a8-3ad9daf26762@redhat.com \
    --to=longman@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    --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;
as well as URLs for NNTP newsgroup(s).