From: Alan Maguire <alan.maguire@oracle.com>
To: Peter Zijlstra <peterz@infradead.org>,
Saket Kumar Bhaskar <skb99@linux.ibm.com>
Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
Venkat Rao Bagalkote <venkat88@linux.ibm.com>,
bpf <bpf@vger.kernel.org>, Hari Bathini <hbathini@linux.ibm.com>,
Abhishek Dubey <adubey@linux.ibm.com>,
Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
Madhavan Srinivasan <maddy@linux.ibm.com>,
LKML <linux-kernel@vger.kernel.org>,
Ritesh Harjani <riteshh@linux.ibm.com>
Subject: Re: bpf/selftests: test_access_variable_array breaks due to sched_domain::span removal
Date: Wed, 8 Apr 2026 09:36:13 +0100 [thread overview]
Message-ID: <a4048e68-35fb-4c6e-a92e-89499c9cd460@oracle.com> (raw)
In-Reply-To: <20260408075620.GJ3738010@noisy.programming.kicks-ass.net>
On 08/04/2026 08:56, Peter Zijlstra wrote:
> On Wed, Apr 08, 2026 at 10:21:46AM +0530, Saket Kumar Bhaskar wrote:
>
>> We do have cpumask as [] array in sched_group:
>>
>> struct sched_group {
>> struct sched_group *next; /* Must be a circular list */
>> atomic_t ref;
>>
>> unsigned int group_weight;
>> unsigned int cores;
>> struct sched_group_capacity *sgc;
>> int asym_prefer_cpu; /* CPU of highest priority in group */
>> int flags;
>>
>> /*
>> * The CPUs this group covers.
>> *
>> * NOTE: this field is variable length. (Allocated dynamically
>> * by attaching extra space to the end of the structure,
>> * depending on how many CPUs the kernel has booted up with)
>> */
>> unsigned long cpumask[];
>> };
>
> For now. But given how utterly broken flex arrays are, this thing will
> be gone the second we run into that same thing again.
>
>> Wouldn't be good if it is used as:
>>
>> cpumask0 = sg->cpumask[0];
>
> I'm thinking Alexei's point is that this test should not rely on random
> kernel code.
>
looks like we already have
struct bpf_testmod_struct_arg_3 {
int a;
int b[];
};
and function
int bpf_testmod_test_struct_arg_3(int a, int b, struct bpf_testmod_struct_arg_2 c);
...in selftests/bpf/test_kmods/bpf_testmod.c so we could potentially use that instead.
Alan
prev parent reply other threads:[~2026-04-08 8:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-07 16:12 Venkat Rao Bagalkote
2026-04-07 17:33 ` Alexei Starovoitov
2026-04-08 4:51 ` Saket Kumar Bhaskar
2026-04-08 7:56 ` Peter Zijlstra
2026-04-08 8:36 ` Alan Maguire [this message]
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=a4048e68-35fb-4c6e-a92e-89499c9cd460@oracle.com \
--to=alan.maguire@oracle.com \
--cc=adubey@linux.ibm.com \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=hbathini@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maddy@linux.ibm.com \
--cc=peterz@infradead.org \
--cc=riteshh@linux.ibm.com \
--cc=skb99@linux.ibm.com \
--cc=venkat88@linux.ibm.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
all inboxes | Powered by JetHome®