Re: [PATCH 1/2] locking: Add lock contention tracepoints

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Mathieu and Steve,

On Thu, Mar 17, 2022 at 9:37 AM Mathieu Desnoyers
<mathieu.desnoyers@xxxxxxxxxxxx> wrote:
>
> ----- On Mar 17, 2022, at 12:07 PM, rostedt rostedt@xxxxxxxxxxx wrote:
>
> > On Thu, 17 Mar 2022 09:32:55 -0400 (EDT)
> > Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx> wrote:
> >
> >> Unless there is a particular reason for using preprocessor defines here, the
> >> following form is typically better because it does not pollute the preprocessor
> >> defines, e.g.:
> >>
> >> enum lock_contention_flags {
> >>         LCB_F_SPIN =   1U << 0;
> >>         LCB_F_READ =   1U << 1;
> >>         LCB_F_WRITE =  1U << 2;
> >>         LCB_F_RT =     1U << 3;
> >>         LCB_F_PERCPU = 1U << 4;
> >> };
> >
> > If you do this, then to use the __print_flags(), You'll also need to add:
> >
> > TRACE_DEFINE_ENUM(LCB_F_SPIN);
> > TRACE_DEFINE_ENUM(LCB_F_READ);
> > TRACE_DEFINE_ENUM(LCB_F_WRITE);
> > TRACE_DEFINE_ENUM(LCB_F_RT);
> > TRACE_DEFINE_ENUM(LCB_F_PERCPU);
> >
> > Which does slow down boot up slightly.
>
> So it looks like there is (currently) a good reason for going with the #define.

Thanks for your suggestions, I'd go with define this time and we could
convert it to enum later (hopefully after the boot time is resolved).

Thanks,
Namhyung

>
> As a side-discussion, I keep finding it odd that this adds overhead on boot. I suspect
> this is also implemented as a linked list which needs to be iterated over at boot-time.
>
> With a few changes to these macros, these linked lists could be turned into arrays,
> and thus remove the boot-time overhead.



[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux