[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANpmjNNoDHQOfH+bUqjpHdzYDxLwG7wA9qEywfWFNamt66Ziyg@mail.gmail.com>
Date: Wed, 28 Jan 2026 00:08:10 +0100
From: Marco Elver <elver@...gle.com>
To: Alan Maguire <alan.maguire@...cle.com>
Cc: kees@...nel.org, nathan@...nel.org, peterz@...radead.org, ojeda@...nel.org,
akpm@...ux-foundation.org, ubizjak@...il.com, Jason@...c4.com,
Marc.Herbert@...ux.intel.com, hca@...ux.ibm.com, hpa@...or.com,
namjain@...ux.microsoft.com, paulmck@...nel.org, linux-kernel@...r.kernel.org,
andrii.nakryiko@...il.com, yonghong.song@...ux.dev, ast@...nel.org,
jolsa@...nel.org, daniel@...earbox.net, martin.lau@...ux.dev,
eddyz87@...il.com, song@...nel.org, john.fastabend@...il.com,
kpsingh@...nel.org, sdf@...ichev.me, haoluo@...gle.com, bvanassche@....org,
nilay@...ux.ibm.com, bpf@...r.kernel.org
Subject: Re: [PATCH] kcsan, compiler_types: avoid duplicate type issues in BPF
Type Format
On Fri, 16 Jan 2026 at 11:13, Marco Elver <elver@...gle.com> wrote:
> On Fri, 16 Jan 2026 at 10:17, Alan Maguire <alan.maguire@...cle.com> wrote:
> >
> > Enabling KCSAN is causing a large number of duplicate types
> > in BTF for core kernel structs like task_struct [1].
> > This is due to the definition in include/linux/compiler_types.h
> >
> > `#ifdef __SANITIZE_THREAD__
> > ...
> > `#define __data_racy volatile
> > ..
> > `#else
> > ...
> > `#define __data_racy
> > ...
> > `#endif
> >
> > Because some objects in the kernel are compiled without
> > KCSAN flags (KCSAN_SANITIZE) we sometimes get the empty
> > __data_racy annotation for objects; as a result we get multiple
> > conflicting representations of the associated structs in DWARF,
> > and these lead to multiple instances of core kernel types in
> > BTF since they cannot be deduplicated due to the additional
> > modifier in some instances.
> >
> > Moving the __data_racy definition under CONFIG_KCSAN
> > avoids this problem, since the volatile modifier will
> > be present for both KCSAN and KCSAN_SANITIZE objects
> > in a CONFIG_KCSAN=y kernel.
>
> "KCSAN and KCSAN_SANITIZE objects" doesn't make sense.
> "KCSAN_SANITIZE.. := n" objects?
> Or just "instrumented and uninstrumented source files".
> Anyway, I know what you mean, but others might not. :-)
>
> > Fixes: 31f605a308e6 ("kcsan, compiler_types: Introduce __data_racy type qualifier")
> > Reported-by: Nilay Shroff <nilay@...ux.ibm.com>
> > Suggested-by: Marco Elver <elver@...gle.com>
> > Signed-off-by: Alan Maguire <alan.maguire@...cle.com>
>
> Reviewed-by: Marco Elver <elver@...gle.com>
Which tree do compiler_types.h changes go through these days?
Powered by blists - more mailing lists