linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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,
	'谭姝' <shu.tan@samsung.com>
Subject: RE: [f2fs-dev] [PATCH] f2fs: readahead contiguous pages for restore_node_summary
Date: Sat, 30 Nov 2013 14:12:56 +0900	[thread overview]
Message-ID: <1385788376.2417.63.camel@kjgkr> (raw)
In-Reply-To: <003101ceebfe$bab50890$301f19b0$@samsung.com>

Hi,

[snip]
> > > So how about add all pages of page list to node_inode's address space by
> > > add_to_page_cache_lru() with arg sum_entry->nid?
> > 
> > I don't think it's proper way to use add_to_page_cache_lru() directly.
> 
> This is the way used in VM readahead(i.e. read_pages/mpage_readpages/
> read_cache_pages).
> So what you worry about is that using lonely add_to_page_cache_lru()
> may cause exception, is it?

Right, what I meant was that, IMO, we should avoid copy and paste MM
codes, but use its wrappers, exported symbols, as much as possible.

> > > > > >
> > > > > > So how about writing ra_node_pages() which use the node_inode's page
> > > > > > cache?
> > > > >
> > > > > Hmm, so ra_node_pages is introduced for read node_inode's pages which are
> > > > > logical contiguously? and it also could take place of ra_node_page?
> > > >
> > > > Ah. The ra_node_page() read a node page ahead for a given node id.
> > > > So it doesn't match exactly between ra_node_page() and ra_node_pages()
> > > > that I suggested.
> > > > So how about reading node pages and then caching some of them in the
> > > > page cache, node_inode's address space?
> > >
> > > Got it,
> > > If we do not use the method above, we should search the NAT for nid number
> > > as the index of node_inode's page by the specified node page blkaddr, that costs
> > > a lot.
> > > How do you think?
> > 
> > 1. grab_cache_page(node_footer->nid);
> > 2. memcpy();
> > 3. SetPageUptodate();
> > 4. f2fs_put_page();
> 
> It could be.
> 
> This make ra_node_pages() synchronized, because we should read node_footer->nid
> from updated node page before we cache node pages, and we will still use page list to
> pass the updated page.
> 
> Why not introduce f2fs_cache_node_pages() include your code to cache node pages after
> ra_node_pages()?

Ok, right.
I'll test again and then merge this patch. :)

-- 
Jaegeuk Kim
Samsung

      reply	other threads:[~2013-11-30  5:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-22  7:48 [PATCH] f2fs: readahead contiguous pages for restore_node_summary Chao Yu
2013-11-27  5:29 ` [f2fs-dev] " Jaegeuk Kim
2013-11-27  7:58   ` Chao Yu
2013-11-27  8:19     ` [f2fs-dev] " Jaegeuk Kim
2013-11-28  1:26       ` Chao Yu
2013-11-28  3:33         ` [f2fs-dev] " Jaegeuk Kim
2013-11-28  5:56           ` Chao Yu
2013-11-30  5:12             ` Jaegeuk Kim [this message]

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=1385788376.2417.63.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 \
    --cc=shu.tan@samsung.com \
    /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).