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:	Thu, 08 Mar 2012 18:49:51 -0800
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	Jiri Slaby <jslaby@...e.cz>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Jiri Slaby <jirislaby@...il.com>,
	Alan Cox <alan@...rguk.ukuu.org.uk>,
	LKML <linux-kernel@...r.kernel.org>,
	Al Viro <viro@...iv.linux.org.uk>,
	Maciej Rutecki <maciej.rutecki@...il.com>
Subject: Re: [PATCH 1/3] sysfs:  Compact sysfs_dirent s_flags into a byte.

Greg Kroah-Hartman <gregkh@...uxfoundation.org> writes:

> On Thu, Mar 08, 2012 at 01:34:22PM -0800, Eric W. Biederman wrote:
>> 
>> In an effort to keep sysfs_dirent small used the smallest
>> basic type I can for sysfs s_flags.
>> 
>> Signed-off-by: Eric W. Biederman <ebiederm@...ssion.com>
>> ---
>>  fs/sysfs/sysfs.h |   10 +++++-----
>>  1 files changed, 5 insertions(+), 5 deletions(-)
>> 
>> diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
>> index 6289a00..c76c932 100644
>> --- a/fs/sysfs/sysfs.h
>> +++ b/fs/sysfs/sysfs.h
>> @@ -76,7 +76,7 @@ struct sysfs_dirent {
>>  		struct sysfs_elem_bin_attr	s_bin_attr;
>>  	};
>>  
>> -	unsigned short		s_flags;
>> +	unsigned char		s_flags;
>>  	umode_t 		s_mode;
>>  	unsigned int		s_ino;
>>  	struct sysfs_inode_attrs *s_iattr;
>
> Are you sure this saved you any real space here?  Have you use pahole (I
> think that's the tool name) to determine if there are holes in the
> structure?  Given that you moved this to a smaller variable, yet there
> are pointers later on, odds are nothing changed at all overall.
>
> Verification would be good to have, to see if this work was really worth
> it, right?

The next patch stuffs an 8bit nlink in the hole.  I was making room so
we don't have to grow sysfs_dirent.

Eric
--
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