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]
Date:	Tue, 21 Jan 2014 19:43:10 +0100
From:	Oleg Nesterov <oleg@...hat.com>
To:	Dave Jones <davej@...hat.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Alan Stern <stern@...land.harvard.edu>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Ingo Molnar <mingo@...nel.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Paul McKenney <paulmck@...ux.vnet.ibm.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 5/5] lockdep: pack subclass/trylock/read/check into a
	single argument

On 01/21, Dave Jones wrote:
>
> On Tue, Jan 21, 2014 at 03:10:22PM +0100, Peter Zijlstra wrote:
>  >
>  > I tried the below but filed to see my vmlinux shrink, maybe I'm just not
>  > building the right kernel, or otherwise GCC is stupid.
>  >
>  > -extern void lock_acquire(struct lockdep_map *lock, unsigned int subclass,
>  > -			 int trylock, int read, int check,
>  > -			 struct lockdep_map *nest_lock, unsigned long ip);
>  > +struct lockdep_acquire_flags {
>  > +	unsigned long subclass : 3;
>  > +	unsigned long trylock  : 1;
>  > +	unsigned long read     : 2;
>  > +	unsigned long check    : 1;
>  > +};
>
> As it's only 7 bits here, could we pack them into a char ?

Do you mean __attribute__((packed)) ?

Suprizingly it helps a bit. Still "size vmlinux" is worse than with
bitmasks.

But I agreed that the code looks simpler with bitfields, so perhaps
this patch is better.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ