lkml.org 
[lkml]   [2021]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RFC][PATCH] tracing: Define "fake" struct trace_pid_list
On Sat, Oct 2, 2021 at 1:04 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
>
> [ Note, this is on top of my tree in ftrace/core, but wanted to ask if
> this is the proper "fix".

Ugh, please no. This is going to be very confusing, and it's going to
mess with anything that does things based on type (eg traditionally
module signatures etc).

I'd rather you just expose the proper type, if that is what it takes.

> Some compilers give this error:

Only some? Which ones? And what did you do to make it appear? Sounds
like whatever change wasn't worth it.

The advantage of some "opaque type" does _not_ override the
disadvantage of then having to make up these kinds of horrific
workarounds that actively lie to the compiler.

We have tons of structures (and occasionally single structure members)
that we don't want people to access directly, and instead use a
wrapper function. That doesn't mean that they can't be exposed as a
type.

> The reason is that rcu_dereference_sched() has a check that uses
> typeof(*p) of the pointer passed to it.

Sadly, we do that for a reason - we do a

typeof(*p) *__local_p;

to drop the address space specifiers from (or add them to) the pointer.

That said, I wonder how many of them are actually needed. At least
some of them are purely for sparse

So at least some could probably just use

typeof(p) __local_p;

instead, which would avoid the problem with a pointer to an incomplete
type (and keep it as a pointer to an incomplete type).

So one option might be to work on the RCU accessor macros instead.

Linus

\
 
 \ /
  Last update: 2021-10-03 00:41    [W:1.691 / U:0.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site