From: Jaegeuk Kim <jaegeuk.kim@samsung.com>
To: Chao Yu <chao2.yu@samsung.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH V2 2/2 RESEND] f2fs: read contiguous sit entry pages by merging for mount performance
Date: Thu, 21 Nov 2013 13:45:32 +0900 [thread overview]
Message-ID: <1385009132.26319.71.camel@kjgkr> (raw)
In-Reply-To: <000001cee668$872ec6a0$958c53e0$@samsung.com>
Hi,
2013-11-21 (목), 11:18 +0800, Chao Yu:
> Hi,
>
> > -----Original Message-----
> > From: Jaegeuk Kim [mailto:jaegeuk.kim@samsung.com]
> > Sent: Thursday, November 21, 2013 9:32 AM
> > To: Chao Yu
> > Cc: linux-fsdevel@vger.kernel.org; linux-kernel@vger.kernel.org; linux-f2fs-devel@lists.sourceforge.net; 谭姝
> > Subject: Re: [f2fs-dev] [PATCH V2 2/2 RESEND] f2fs: read contiguous sit entry pages by merging for mount performance
> >
> > Hi,
> >
> > It seems that ra_sit_pages() is too tightly coupled with
> > build_sit_entries().
>
> This code could be improved.
>
> > Is there another way not to use *is_order?
>
> Previously the code is like this:
> -build_sit_entries()
> next_setp:
> for(start = 0; start < TOTAL_SEGS(sbi); start++)
> /*step#1 readahead all sit entries blocks*/
> if(start % SIT_ENTRY_PER_BLOCK == 0) {
> blk_addr = current_sit_addr(sbi, start);
> /* grab and submit_read_page */
> }
> if(start == TOTAL_SEGS(sbi) - 1)
> f2fs_submit_read_bio();
> continue;
> /*step#2 fill sit entries info*/
> /*step#3 cover sit entries with journal*/
>
> But I think its weakness is that it will cost lots of memory to read
> ahead all sit entry pages when f2fs mount, and also it's serious waste
> that we read them again after these pages are released by VM when
> out of memory.
>
> >
> > The ra_sit_pages() tries to read consecutive sit pages as many as
> > possible.
> > So then, what about just checking whether its block address is
> > contiguous or not?
> >
> > Something like this:
> > -ra_sit_pages()
> > blkno = start;
> > while (blkno < sit_i->sit_blocks) {
> > blk_addr = current_sit_addr(sbi, blkno);
> > if (blkno != start && prev_blk_addr + 1 != blk_addr)
> > break;
> >
> > /* grab and submit_read_page */
> >
> > prev_blk_addr = blk_addr;
> > blkno++;
> > }
>
> Agreed, this method could remove *order.
> Shouldn't we add nrpages for readahead policy as VM?
Aha, agreed.
We need nrpages to avoid too many reads on sit blocks.
But, still it needs to change the nrpages in its caller.
In your patch, it was sit_i->sit_blocks that is total # of sit blocks.
I think 128 or 256 is quite reasonable number.
Anyway, how about implementing ra_sit_pages() with a blk_plug likewise
ra_node_pages()?
--
Jaegeuk Kim
Samsung
------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next prev parent reply other threads:[~2013-11-21 4:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-20 6:47 [f2fs-dev] [PATCH V2 2/2 RESEND] f2fs: read contiguous sit entry pages by merging for mount performance Chao Yu
2013-11-21 1:31 ` Jaegeuk Kim
2013-11-21 3:18 ` Chao Yu
2013-11-21 4:45 ` Jaegeuk Kim [this message]
2013-11-21 6:37 ` [f2fs-dev] " Chao Yu
2013-11-21 9:35 ` Jaegeuk Kim
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=1385009132.26319.71.camel@kjgkr \
--to=jaegeuk.kim@samsung.com \
--cc=chao2.yu@samsung.com \
--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).