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] [day] [month] [year] [list]
Message-ID: <c1c23a29-17a4-43de-9967-f3bca079b860@redhat.com>
Date:   Thu, 16 Nov 2023 07:42:16 -0500
From:   Waiman Long <longman@...hat.com>
To:     Alexey Dobriyan <adobriyan@...il.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
        Boqun Feng <boqun.feng@...il.com>
Cc:     linux-kernel@...r.kernel.org
Subject: Re: [PATCH] lockdep: optimise "struct lock_class" layout

On 11/16/23 06:25, Alexey Dobriyan wrote:
> struct lock_class does
>
> 	const struct lock_trace *	usage_traces[];
> 	int				name_version;
> 	const char *			name;
>
> which wastes 4 bytes after "name_version".
>
> Put pointer after pointers shrinking sizeof from 208 bytes to 200 bytes.
> Space savings are considerable for such a trivial patch:
>
> 	$ ./scripts/bloat-o-meter ../vmlinux-000 ../obj/vmlinux
> 	add/remove: 0/0 grow/shrink: 1/11 up/down: 2/-65640 (-65638)
> 	Function                       old     new   delta
> 	check_irq_usage               2852    2854      +2
> 	reacquire_held_locks           486     484      -2
> 	lock_chain_get_class            41      39      -2
> 	l_start                         34      32      -2
> 	check_noncircular              276     274      -2
> 	print_usage_bug.part           688     683      -5
> 	print_circular_bug            1017    1011      -6
> 	hlock_conflict                 141     135      -6
> 	print_deadlock_bug             944     935      -9
> 	mark_lock                     3791    3769     -22
> 	__lock_acquire                9801    9753     -48
> 	lock_classes               1703936 1638400  -65536
> 	Total: Before=21163908, After=21098270, chg -0.31%
>
> Signed-off-by: Alexey Dobriyan <adobriyan@...il.com>
> ---
>
>   include/linux/lockdep_types.h |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/include/linux/lockdep_types.h
> +++ b/include/linux/lockdep_types.h
> @@ -127,12 +127,12 @@ struct lock_class {
>   	unsigned long			usage_mask;
>   	const struct lock_trace		*usage_traces[LOCK_TRACE_STATES];
>   
> +	const char			*name;
>   	/*
>   	 * Generation counter, when doing certain classes of graph walking,
>   	 * to ensure that we check one node only once:
>   	 */
>   	int				name_version;
> -	const char			*name;
>   
>   	u8				wait_type_inner;
>   	u8				wait_type_outer;
>
LGTM.

Acked-by: Waiman Long <longman@...hat.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ