linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH] f2fs: merge read IOs at ra_nat_pages()
@ 2013-11-21  9:35 Jaegeuk Kim
  2013-11-22  3:41 ` Changman Lee
  0 siblings, 1 reply; 3+ messages in thread
From: Jaegeuk Kim @ 2013-11-21  9:35 UTC (permalink / raw)
  Cc: linux-fsdevel, linux-kernel, linux-f2fs-devel

This patch changes the policy of submitting read bios at ra_nat_pages.

Previously, f2fs submits small read bios with block plugging.
But, with this patch, f2fs itself merges read bios first and then submits a
large bio, which can reduce the bio handling overheads.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
---
 fs/f2fs/node.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index b843a5b..c06871f 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -89,13 +89,10 @@ static void ra_nat_pages(struct f2fs_sb_info *sbi, int nid)
 {
 	struct address_space *mapping = sbi->meta_inode->i_mapping;
 	struct f2fs_nm_info *nm_i = NM_I(sbi);
-	struct blk_plug plug;
 	struct page *page;
 	pgoff_t index;
 	int i;
 
-	blk_start_plug(&plug);
-
 	for (i = 0; i < FREE_NID_PAGES; i++, nid += NAT_ENTRY_PER_BLOCK) {
 		if (nid >= nm_i->max_nid)
 			nid = 0;
@@ -108,12 +105,11 @@ static void ra_nat_pages(struct f2fs_sb_info *sbi, int nid)
 			f2fs_put_page(page, 1);
 			continue;
 		}
-		if (f2fs_readpage(sbi, page, index, READ))
-			continue;
+		submit_read_page(sbi, page, index, READ_SYNC);
 
 		f2fs_put_page(page, 0);
 	}
-	blk_finish_plug(&plug);
+	f2fs_submit_read_bio(sbi, READ_SYNC);
 }
 
 static struct nat_entry *__lookup_nat_cache(struct f2fs_nm_info *nm_i, nid_t n)
-- 
1.8.4.474.g128a96c


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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] f2fs: merge read IOs at ra_nat_pages()
  2013-11-21  9:35 [PATCH] f2fs: merge read IOs at ra_nat_pages() Jaegeuk Kim
@ 2013-11-22  3:41 ` Changman Lee
  2013-11-24  2:46   ` [f2fs-dev] " Jaegeuk Kim
  0 siblings, 1 reply; 3+ messages in thread
From: Changman Lee @ 2013-11-22  3:41 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: linux-fsdevel, linux-kernel, linux-f2fs-devel


How about doing mark_page_accessed(page) in ra_nat_pages like
ra_sit_pages to prevent readahead pages are reclaimed by VM?

On 목, 2013-11-21 at 18:35 +0900, Jaegeuk Kim wrote:
> This patch changes the policy of submitting read bios at ra_nat_pages.
> 
> Previously, f2fs submits small read bios with block plugging.
> But, with this patch, f2fs itself merges read bios first and then submits a
> large bio, which can reduce the bio handling overheads.
> 
> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
> ---
>  fs/f2fs/node.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
> index b843a5b..c06871f 100644
> --- a/fs/f2fs/node.c
> +++ b/fs/f2fs/node.c
> @@ -89,13 +89,10 @@ static void ra_nat_pages(struct f2fs_sb_info *sbi, int nid)
>  {
>  	struct address_space *mapping = sbi->meta_inode->i_mapping;
>  	struct f2fs_nm_info *nm_i = NM_I(sbi);
> -	struct blk_plug plug;
>  	struct page *page;
>  	pgoff_t index;
>  	int i;
>  
> -	blk_start_plug(&plug);
> -
>  	for (i = 0; i < FREE_NID_PAGES; i++, nid += NAT_ENTRY_PER_BLOCK) {
>  		if (nid >= nm_i->max_nid)
>  			nid = 0;
> @@ -108,12 +105,11 @@ static void ra_nat_pages(struct f2fs_sb_info *sbi, int nid)

mark_page_accessed(page);

>  			f2fs_put_page(page, 1);
>  			continue;
>  		}
> -		if (f2fs_readpage(sbi, page, index, READ))
> -			continue;
> +		submit_read_page(sbi, page, index, READ_SYNC);
>  

mark_page_accessed(page);

>  		f2fs_put_page(page, 0);
>  	}
> -	blk_finish_plug(&plug);
> +	f2fs_submit_read_bio(sbi, READ_SYNC);
>  }
>  
>  static struct nat_entry *__lookup_nat_cache(struct f2fs_nm_info *nm_i, nid_t n)



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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: merge read IOs at ra_nat_pages()
  2013-11-22  3:41 ` Changman Lee
@ 2013-11-24  2:46   ` Jaegeuk Kim
  0 siblings, 0 replies; 3+ messages in thread
From: Jaegeuk Kim @ 2013-11-24  2:46 UTC (permalink / raw)
  To: Changman Lee; +Cc: linux-fsdevel, linux-kernel, linux-f2fs-devel

Hi,

2013-11-22 (금), 12:41 +0900, Changman Lee:
> How about doing mark_page_accessed(page) in ra_nat_pages like
> ra_sit_pages to prevent readahead pages are reclaimed by VM?

Agreed.
I'll modify and merge this.
Thanks,

> 
> On 목, 2013-11-21 at 18:35 +0900, Jaegeuk Kim wrote:
> > This patch changes the policy of submitting read bios at ra_nat_pages.
> > 
> > Previously, f2fs submits small read bios with block plugging.
> > But, with this patch, f2fs itself merges read bios first and then submits a
> > large bio, which can reduce the bio handling overheads.
> > 
> > Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
> > ---
> >  fs/f2fs/node.c | 8 ++------
> >  1 file changed, 2 insertions(+), 6 deletions(-)
> > 
> > diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
> > index b843a5b..c06871f 100644
> > --- a/fs/f2fs/node.c
> > +++ b/fs/f2fs/node.c
> > @@ -89,13 +89,10 @@ static void ra_nat_pages(struct f2fs_sb_info *sbi, int nid)
> >  {
> >  	struct address_space *mapping = sbi->meta_inode->i_mapping;
> >  	struct f2fs_nm_info *nm_i = NM_I(sbi);
> > -	struct blk_plug plug;
> >  	struct page *page;
> >  	pgoff_t index;
> >  	int i;
> >  
> > -	blk_start_plug(&plug);
> > -
> >  	for (i = 0; i < FREE_NID_PAGES; i++, nid += NAT_ENTRY_PER_BLOCK) {
> >  		if (nid >= nm_i->max_nid)
> >  			nid = 0;
> > @@ -108,12 +105,11 @@ static void ra_nat_pages(struct f2fs_sb_info *sbi, int nid)
> 
> mark_page_accessed(page);
> 
> >  			f2fs_put_page(page, 1);
> >  			continue;
> >  		}
> > -		if (f2fs_readpage(sbi, page, index, READ))
> > -			continue;
> > +		submit_read_page(sbi, page, index, READ_SYNC);
> >  
> 
> mark_page_accessed(page);
> 
> >  		f2fs_put_page(page, 0);
> >  	}
> > -	blk_finish_plug(&plug);
> > +	f2fs_submit_read_bio(sbi, READ_SYNC);
> >  }
> >  
> >  static struct nat_entry *__lookup_nat_cache(struct f2fs_nm_info *nm_i, nid_t n)
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Jaegeuk Kim
Samsung

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-11-24  2:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-21  9:35 [PATCH] f2fs: merge read IOs at ra_nat_pages() Jaegeuk Kim
2013-11-22  3:41 ` Changman Lee
2013-11-24  2:46   ` [f2fs-dev] " Jaegeuk Kim

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