From: Andrea Righi <arighi@nvidia.com>
To: kernel test robot <lkp@intel.com>
Cc: oe-kbuild-all@lists.linux.dev, Tejun Heo <tj@kernel.org>,
Yury Norov <yury.norov@gmail.com>,
Christophe Leroy <christophe.leroy@csgroup.eu>
Subject: Re: [linux-next:master 3203/9634] arch/powerpc/include/asm/bitops.h:126:26: error: constraint 'n' expects an integer constant expression
Date: Sun, 9 Mar 2025 09:37:29 +0100 [thread overview]
Message-ID: <Z81TSQHHaNq_Aj4x@gpd3> (raw)
In-Reply-To: <202503090435.wITkzD2e-lkp@intel.com>
On Sun, Mar 09, 2025 at 04:56:45AM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head: 0a2f889128969dab41861b6e40111aa03dc57014
> commit: 48849271e66114cb980a3bc44218b04d0f8cdcdd [3203/9634] sched_ext: idle: Per-node idle cpumasks
> config: powerpc-randconfig-r112-20250308 (https://download.01.org/0day-ci/archive/20250309/202503090435.wITkzD2e-lkp@intel.com/config)
> compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
> reproduce: (https://download.01.org/0day-ci/archive/20250309/202503090435.wITkzD2e-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/202503090435.wITkzD2e-lkp@intel.com/
>
> All errors (new ones prefixed by >>):
>
> In file included from kernel/sched/build_policy.c:16:
> In file included from include/linux/sched/clock.h:5:
> In file included from include/linux/smp.h:13:
> In file included from include/linux/cpumask.h:11:
> In file included from include/linux/kernel.h:23:
> In file included from include/linux/bitops.h:68:
> >> arch/powerpc/include/asm/bitops.h:126:26: error: constraint 'n' expects an integer constant expression
> 126 | DEFINE_CLROP(clear_bits, "")
> | ^
> 1 error generated.
I've expanded the for_each_node_numadist() macro to better understand
what's going on, it seems that clang isn't happy with a node_clear() inside
the for loop, and it's not complaining about a similar node_clear() outside
the for loop.
Also, it seems to happen only with clang (gcc is always happy).
Here's the relevant code (with the macro expanded and comments removed):
===
static DEFINE_PER_CPU(nodemask_t, per_cpu_unvisited);
static s32 pick_idle_cpu_from_online_nodes(const struct cpumask *cpus_allowed, int node, u64 flags)
{
nodemask_t *unvisited;
s32 cpu = -EBUSY;
preempt_disable();
unvisited = this_cpu_ptr(&per_cpu_unvisited);
nodes_copy(*unvisited, node_states[N_ONLINE]);
node_clear(node, *unvisited);
for (int __start = node,
node = nearest_node_nodemask(__start, unvisited);
node < MAX_NUMNODES;
// node_clear(node, *unvisited), <- clang is happy with this one commented!
node = nearest_node_nodemask(__start, unvisited)) {
cpu = pick_idle_cpu_in_node(cpus_allowed, node, flags);
if (cpu >= 0)
break;
}
preempt_enable();
return cpu;
}
===
The code looks correct to me, but I don't know much about powerpc assembly.
Christophe, maybe you have a better idea of what's happening here?
Thanks,
-Andrea
>
>
> vim +/n +126 arch/powerpc/include/asm/bitops.h
>
> fb350784d8d179 Christophe Leroy 2021-09-21 125
> fb350784d8d179 Christophe Leroy 2021-09-21 @126 DEFINE_CLROP(clear_bits, "")
> fb350784d8d179 Christophe Leroy 2021-09-21 127 DEFINE_CLROP(clear_bits_unlock, PPC_RELEASE_BARRIER)
> fb350784d8d179 Christophe Leroy 2021-09-21 128
>
> :::::: The code at line 126 was first introduced by commit
> :::::: fb350784d8d17952afa93383bb47aaa6b715c459 powerpc/bitops: Use immediate operand when possible
>
> :::::: TO: Christophe Leroy <christophe.leroy@csgroup.eu>
> :::::: CC: Michael Ellerman <mpe@ellerman.id.au>
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2025-03-09 8:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-08 20:56 [linux-next:master 3203/9634] arch/powerpc/include/asm/bitops.h:126:26: error: constraint 'n' expects an integer constant expression kernel test robot
2025-03-09 8:37 ` Andrea Righi [this message]
2025-03-09 18:48 ` Christophe Leroy
2025-03-09 20:47 ` Andrea Righi
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=Z81TSQHHaNq_Aj4x@gpd3 \
--to=arighi@nvidia.com \
--cc=christophe.leroy@csgroup.eu \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=tj@kernel.org \
--cc=yury.norov@gmail.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 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.