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
Subject: Re: [PATCH] f2fs: introduce a new direct_IO write path
Date: Fri, 20 Dec 2013 18:21:52 +0900	[thread overview]
Message-ID: <1387531312.2101.230.camel@kjgkr> (raw)
In-Reply-To: <000b01cefd29$6c1e61e0$445b25a0$@samsung.com>

Hi,

2013-12-20 (금), 10:14 +0800, Chao Yu:
> Hi Kim,
> 
> One comment as following:
> 
> > -----Original Message-----
> > From: Jaegeuk Kim [mailto:jaegeuk.kim@samsung.com]
> > Sent: Wednesday, December 18, 2013 8:12 AM
> > To: linux-fsdevel@vger.kernel.org
> > Cc: linux-kernel@vger.kernel.org; linux-f2fs-devel@lists.sourceforge.net
> > Subject: Re: [f2fs-dev] [PATCH] f2fs: introduce a new direct_IO write path
> > 
> > Change log from v1:
> >  o fix NOSPC error handling
> > 
> > >From b8511a74fe98b67247a9feeed58441e8f5ffd705 Mon Sep 17 00:00:00 2001
> > From: Jaegeuk Kim <jaegeuk.kim@samsung.com>
> > Date: Mon, 16 Dec 2013 19:04:05 +0900
> > Subject: [PATCH] f2fs: introduce a new direct_IO write path
> > Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
> > linux-f2fs-devel@lists.sourceforge.net
> > 
> > Previously, f2fs doesn't support direct IOs with high performance, which
> > throws
> > every write requests via the buffered write path, resulting in highly
> > performance degradation due to memory opeations like copy_from_user.
> > 
> > This patch introduces a new direct IO path in which every write requests
> > are
> > processed by generic blockdev_direct_IO() with enhanced get_block
> > function.
> > 
> > The get_data_block() in f2fs handles:
> > 1. if original data blocks are allocates, then give them to blockdev.
> > 2. otherwise,
> >   a. preallocate requested block addresses
> >   b. do not use extent cache for better performance
> >   c. give the block addresses to blockdev
> > 
> > This policy induces that:
> > - new allocated data are sequentially written to the disk
> > - updated data are randomly written to the disk.
> > - f2fs gives consistency on its file meta, not file data.
> > 
> > Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
> > ---
> >  fs/f2fs/data.c    | 152
> > ++++++++++++++++++++++++++++++++++++++++--------------
> >  fs/f2fs/f2fs.h    |   2 +
> >  fs/f2fs/segment.c |  23 ++++++---
> >  3 files changed, 129 insertions(+), 48 deletions(-)
> > 
> > diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> > index 15956fa..a0950bc 100644
> > --- a/fs/f2fs/data.c
> > +++ b/fs/f2fs/data.c
> > @@ -570,74 +570,151 @@ repeat:
> >  	return page;
> >  }
> > 
> > +static int __allocate_data_block(struct dnode_of_data *dn)
> > +{
> > +	struct f2fs_sb_info *sbi = F2FS_SB(dn->inode->i_sb);
> > +	struct f2fs_summary sum;
> > +	block_t new_blkaddr;
> > +	struct node_info ni;
> > +	int type;
> > +
> > +	if (unlikely(is_inode_flag_set(F2FS_I(dn->inode), FI_NO_ALLOC)))
> > +		return -EPERM;
> > +	if (unlikely(!inc_valid_block_count(sbi, dn->inode, 1)))
> > +		return -ENOSPC;
> > +
> > +	__set_data_blkaddr(dn, NEW_ADDR);
> > +	dn->data_blkaddr = NEW_ADDR;
> > +
> > +	get_node_info(sbi, dn->nid, &ni);
> > +	set_summary(&sum, dn->nid, dn->ofs_in_node, ni.version);
> > +
> > +	type = CURSEG_WARM_DATA;
> 
> If so, our cold data will be written to WARM_DATA segment.
> How about check segment type here?

Actually, I'm not sure this kind of data requested through direct IOs
are cold or hot data.
But I just intended to gather such the direct IO'ed data into one type
of log, not separately.
So, I selected WARM_DATA by the fact that such the data will be
frequently updated through direct IO either.
Thanks,

> 
> > +
> > +	allocate_data_block(sbi, NULL, NULL_ADDR, &new_blkaddr, &sum, type);
> > +
> > +	/* direct IO doesn't use extent cache to maximize the performance */
> > +	set_inode_flag(F2FS_I(dn->inode), FI_NO_EXTENT);
> > +	update_extent_cache(new_blkaddr, dn);
> > +	clear_inode_flag(F2FS_I(dn->inode), FI_NO_EXTENT);
> > +
> > +	dn->data_blkaddr = new_blkaddr;
> > +	return 0;
> > +}
> > +
> 
> [snip]
> 

-- 
Jaegeuk Kim
Samsung



------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

      reply	other threads:[~2013-12-20  9:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-17  1:49 [PATCH] f2fs: introduce a new direct_IO write path Jaegeuk Kim
2013-12-18  0:12 ` Jaegeuk Kim
2013-12-19  1:12   ` Chao Yu
2013-12-20  2:14   ` Chao Yu
2013-12-20  9:21     ` 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=1387531312.2101.230.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).