Re: [PATCH 1/3] tracing: Remove dependency of saved_cmdlines_buffer on PID_MAX_DEFAULT

From: Michal Koutný
Date: Mon May 13 2024 - 13:31:01 EST


On Tue, Apr 09, 2024 at 11:01:26AM GMT, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
> > - tpid = pid & (PID_MAX_DEFAULT - 1);
> > + tpid = pid % PID_MAP_SIZE;
>
> Does that compile to the same? This is a fast path.

I didn't check.
If fast is the intetion, I would change it to something
like BUILD_BUG_ON(!(PID_MAP_SIZE % 2)) and keep the bit operation
without reliance on compiler optimizations.

Thanks for the response (I may not follow up on this single commit
though).

Michal

Attachment: signature.asc
Description: PGP signature