Re: [PATCH 0/2] --padding option to combine with --with_flexible_array

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

 



Hi Arnaldo!

On Fri, Sep 27, 2024 at 03:59:56PM -0300, Arnaldo Carvalho de Melo wrote:
> From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
> 
> Hi,
> 
> 	This implements --padding, that combined with the already
> available --with_flexible_array option may catch some questionable
> structs.
> 
> 	This comes from a quick discussion I had with Willy Tareau after
> Gustavo's talk at this year's Kernel Recipes.
> 
> 	I have this in the 'next' branch of:
> 
> https://git.kernel.org/pub/scm/devel/pahole/pahole.git
> 
> 	Willy, is that what you had in mind?

Oh that was fast!

I'm looking at the output here:

   http://oldvger.kernel.org/~acme/pahole--padding_ge_1_--with_flexible_array.6.10.10-200.fc40.x86_64.txt

I'm seeing in the output above that mem_cgroup was reported due to 48
bytes padding being caused by extra alignment. I'm not sure what to
think about it to be honest, there could be pros and cons. However it's
true that if this struct is embedded inside another one, it starts to
smell nevertheless, and such a case is not much frequent so it should
be a low rate of false positives in the worst case.

The output is clearly reviewable by hand, that's really cool!

I have not checked the code yet, but based on the result that's definitely
an ack for me!

Acked-by: Willy Tarreau <w@xxxxxx>

Thank you!
Willy




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux