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 -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html