linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <chao2.yu@samsung.com>
To: 'Changman Lee' <cm224.lee@gmail.com>
Cc: 'Jaegeuk Kim' <jaegeuk@kernel.org>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH v2] f2fs: merge two uchar variable in struct node_info to reduce memory cost
Date: Thu, 18 Dec 2014 14:29:51 +0800	[thread overview]
Message-ID: <004c01d01a96$2b5b3a80$8211af80$@samsung.com> (raw)
In-Reply-To: <CAN863PvqCJJ-m3NimjX7FKeY941rjSgmzupfPEMHm_qXgRBwfQ@mail.gmail.com>

Hi Changman,

> -----Original Message-----
> From: Changman Lee [mailto:cm224.lee@gmail.com]
> Sent: Wednesday, December 17, 2014 11:09 PM
> To: Chao Yu
> Cc: Jaegeuk Kim; Changman Lee; linux-fsdevel@vger.kernel.org; linux-kernel@vger.kernel.org;
> linux-f2fs-devel@lists.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@samsung.com>
> 


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk

  reply	other threads:[~2014-12-18  7:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-15  9:33 [f2fs-dev][PATCH v2] f2fs: merge two uchar variable in struct node_info to reduce memory cost Chao Yu
2014-12-17 15:08 ` [f2fs-dev] [PATCH " Changman Lee
2014-12-18  6:29   ` Chao Yu [this message]
2014-12-18  8:07     ` Changman Lee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='004c01d01a96$2b5b3a80$8211af80$@samsung.com' \
    --to=chao2.yu@samsung.com \
    --cc=cm224.lee@gmail.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).