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, 18 Dec 2014 14:29:51 +0800
From:	Chao Yu <chao2.yu@...sung.com>
To:	'Changman Lee' <cm224.lee@...il.com>
Cc:	'Jaegeuk Kim' <jaegeuk@...nel.org>,
	'Changman Lee' <cm224.lee@...sung.com>,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-f2fs-devel@...ts.sourceforge.net
Subject: RE: [f2fs-dev] [PATCH v2] f2fs: merge two uchar variable in struct
 node_info to reduce memory cost

Hi Changman,

> -----Original Message-----
> From: Changman Lee [mailto:cm224.lee@...il.com]
> Sent: Wednesday, December 17, 2014 11:09 PM
> To: Chao Yu
> Cc: Jaegeuk Kim; Changman Lee; linux-fsdevel@...r.kernel.org; linux-kernel@...r.kernel.org;
> linux-f2fs-devel@...ts.sourceforge.net
> Subject: Re: [f2fs-dev] [PATCH v2] f2fs: merge two uchar variable in struct node_info to reduce
> memory cost
> 
> Hi Yu,
> 
> This patch is effective only in 32 bit machine. In case of 64 bit
> machine, nat_entry will be aligned in 8 bytes due to pointer variable
> (i.e. struct list_head). So it can't get any benefit to reduce memory
> usage. In the case of node_info, however, it will be gain in terms of
> memory usage.
> Hence, I think it's not correct for commit log to describe this patch.
> 

Thanks for your review! :)

AFFIK, in 64 bit machine, size of struct nat_entry is 40 bytes before this patch
apply, the reason is that our compiler will fill 3 bytes pads after flag as
nid's offset should align to type size of nid, and then fill 7 byte pads after
version as size of structure should align to 64 bits when the struct size is bigger
than 64 bits.
layout of struct nat_entry:
|-----8 bytes-----|
|list.next        |
|list.prev        |
|flag    |nid     |
|ino     |blk_addr|
|version          |
After we apply this patch, size of struct nat_entry will be reduced to 32 bytes.
Please correct me if I'm wrong.

Anyway, I agreed that commit log should be uptodate.

Thanks,
Yu

> Thanks,
> 
> Reviewed-by: Changman Lee <cm224.lee@...sung.com>
> 

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