Re: [PATCH] btf: Simplify BTF logic with use of __free(btf_put)

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

 



On Fri, Aug 1, 2025 at 8:19 AM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> On Fri, 1 Aug 2025 08:12:08 -0700
> Alexei Starovoitov <alexei.starovoitov@xxxxxxxxx> wrote:
>
> >
> > You can use it in kernel/trace/trace_output.c, of course,
>
> I guess that means I should just use the DEFINE_FREE() in that file
> directly and not in the btf.h header file?

yes. I don't want this to proliferate and people spam us
with this kind of "cleanups".

> > but I really think it's a step back in maintainability.
> > All this cleanup.h is not a silver bullet. It needs to be used sparingly.
>
> I have my reservations about the cleanup.h code too. But the more I use it,
> the more I like it. My biggest worry is guard() leak. That is, having a
> lock or interrupt/preemption disabled for longer than they need to be,
> because code was added at the end of the function after the protection is
> needed.

guard() is ok. We use it too,
but __free() is imo garbage. It's essence of what's wrong with C++





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux