lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fcd54618-bed6-4fd4-8438-ff148b7e8b99@unstable.cc>
Date: Wed, 9 Oct 2024 15:53:02 +0200
From: Antonio Quartulli <a@...table.cc>
To: Jiri Pirko <jiri@...nulli.us>, Andrew Lunn <andrew@...n.ch>
Cc: kuba@...nel.org, netdev@...r.kernel.org, donald.hunter@...il.com,
 pabeni@...hat.com, davem@...emloft.net, edumazet@...gle.com
Subject: Re: [PATCH] tools: ynl-gen: include auto-generated uAPI header only
 once

On 09/10/2024 15:37, Jiri Pirko wrote:
> Wed, Oct 09, 2024 at 03:00:42PM CEST, a@...table.cc wrote:
>> On 09/10/2024 14:50, Jiri Pirko wrote:
>>> Wed, Oct 09, 2024 at 02:12:35PM CEST, a@...table.cc wrote:
>>>> The auto-generated uAPI file is currently included in both the
>>>> .h and .c netlink stub files.
>>>> However, the .c file already includes its .h counterpart, thus
>>>> leading to a double inclusion of the uAPI header.
>>>>
>>>> Prevent the double inclusion by including the uAPI header in the
>>>> .h stub file only.
>>>>
>>>> Signed-off-by: Antonio Quartulli <a@...table.cc>
>>>> ---
>>>> drivers/dpll/dpll_nl.c     | 2 --
>>>> drivers/net/team/team_nl.c | 2 --
>>>> fs/nfsd/netlink.c          | 2 --
>>>> net/core/netdev-genl-gen.c | 1 -
>>>> net/devlink/netlink_gen.c  | 2 --
>>>> net/handshake/genl.c       | 2 --
>>>> net/ipv4/fou_nl.c          | 2 --
>>>> net/mptcp/mptcp_pm_gen.c   | 2 --
>>>> tools/net/ynl/ynl-gen-c.py | 4 +++-
>>>> 9 files changed, 3 insertions(+), 16 deletions(-)
>>>>
>>>> diff --git a/drivers/dpll/dpll_nl.c b/drivers/dpll/dpll_nl.c
>>>> index fe9b6893d261..9a739d9dcfbd 100644
>>>> --- a/drivers/dpll/dpll_nl.c
>>>> +++ b/drivers/dpll/dpll_nl.c
>>>> @@ -8,8 +8,6 @@
>>>>
>>>> #include "dpll_nl.h"
>>>>
>>>> -#include <uapi/linux/dpll.h>
>>>
>>> What seems to be the problem? The uapi headers are protected for double
>>> inclusion, no?
>>> #ifndef _UAPI_LINUX_DPLL_H
>>> #define _UAPI_LINUX_DPLL_H
>>
>> There is no problem to fix, this is just a compile-time micro-optimization by
>> reducing the number of includes to follow.
>>
>> I was recently told there is ongoing effort to reduce the amount of useless
>> includes in order to speed up the compilation process.
> 
> Do you have some numbers?
> 
> So far I had impression that the common practise is to include header
> directly when needed and not to depend on indirect include.

That's the same rule I had been following in the past, but Andrew 
advised to do differently here:

<07050ffc-aa8e-417a-b35b-0cf627fc226f@...n.ch>

He also says:
"There is a massive patch series crossing the entire kernel which 
significantly reduces the kernel build time by optimising includes."

I trusted his word and I just assumed this was the wanted direction 
nowadays.

@Andrew: maybe you have a pointer to the series?

Thanks.

Regards,


-- 
Antonio Quartulli

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ