Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755734AbbLWD1M (ORCPT ); Tue, 22 Dec 2015 22:27:12 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:43488 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754599AbbLWD1K (ORCPT ); Tue, 22 Dec 2015 22:27:10 -0500 X-AuditID: cbfee61a-f79266d000003652-49-567a148c39f5 From: Chao Yu To: "'Jaegeuk Kim'" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net References: <1450832388-29118-1-git-send-email-jaegeuk@kernel.org> <1450832388-29118-2-git-send-email-jaegeuk@kernel.org> In-reply-to: <1450832388-29118-2-git-send-email-jaegeuk@kernel.org> Subject: RE: [f2fs-dev] [PATCH 2/4] f2fs: avoid unnecessary f2fs_gc for dir operations Date: Wed, 23 Dec 2015 11:26:25 +0800 Message-id: <010101d13d31$cdc1d860$69458920$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AQG9bRZC60cJl2SGICHadMcbSzM9lgJHSnrknu1NHXA= Content-language: zh-cn X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrBLMWRmVeSWpSXmKPExsVy+t9jAd0ekaowg+MHRCyerJ/FbHFpkbvF nr0nWSwu75rD5sDisWlVJ5vH7gWfmTw+b5ILYI7isklJzcksSy3St0vgyljw4wdzwULpisYX P9kbGKeLdTFycEgImEhcvWrdxcgJZIpJXLi3nq2LkYtDSGApo0T7q0ZGCOcVo0Rv8zxWkCo2 ARWJ5R3/mUBsEQE1id59U8BsZoFMiQn9L9hBbCGBaonJZ4+zgdicAs4Sc/7cAasRFoiQeL9t AzOIzSKgKnHxyS+wGl4BS4kpDVOZIGxBiR+T77FAzNSSWL/zONR8eYnNa94yQ1yqILHj7GtG iBusJGav6maDqBGX2HjkFssERqFZSEbNQjJqFpJRs5C0LGBkWcUokVqQXFCclJ5rmJdarlec mFtcmpeul5yfu4kRHP7PpHYwHtzlfohRgINRiYfXoa0yTIg1say4MvcQowQHs5IIb/o7oBBv SmJlVWpRfnxRaU5q8SFGaQ4WJXHe2kuRYUIC6YklqdmpqQWpRTBZJg5OqQbGmubDrYeD15lH HDX7d+Iv+8fk7Rb6L7mvX9wef2bBRKXul70iTmkX+RV6oiVDn513Yvwj2LN0asrkY54Km24c 21m15Nf5sLxTmkf9TzNWmNXZpJw//dr72sykSf2C0z4/N5jgo7FiZUbigYNT5h/yT3EVafGf tPTzjVUP/nUmnjmrviiq63D8NCWW4oxEQy3mouJEAM/+dyp7AgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3621 Lines: 118 Hi Jaegeuk, > -----Original Message----- > From: Jaegeuk Kim [mailto:jaegeuk@kernel.org] > Sent: Wednesday, December 23, 2015 9:00 AM > To: linux-kernel@vger.kernel.org; linux-fsdevel@vger.kernel.org; > linux-f2fs-devel@lists.sourceforge.net > Cc: Jaegeuk Kim > Subject: [f2fs-dev] [PATCH 2/4] f2fs: avoid unnecessary f2fs_gc for dir operations > > The f2fs_balance_fs doesn't need to cover f2fs_new_inode or f2fs_find_entry > works. So this avoids some unneeded overhead in f2fs_balance_fs for scenario where f2fs_new_inode and f2fs_find_entry will fail for most of the time? Shouldn't cover f2fs_find_entry in rename or rename2 case? Thanks, > > Signed-off-by: Jaegeuk Kim > --- > fs/f2fs/namei.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) > > diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c > index 2c32110..8d2616f 100644 > --- a/fs/f2fs/namei.c > +++ b/fs/f2fs/namei.c > @@ -128,8 +128,6 @@ static int f2fs_create(struct inode *dir, struct dentry *dentry, umode_t > mode, > nid_t ino = 0; > int err; > > - f2fs_balance_fs(sbi); > - > inode = f2fs_new_inode(dir, mode); > if (IS_ERR(inode)) > return PTR_ERR(inode); > @@ -142,6 +140,8 @@ static int f2fs_create(struct inode *dir, struct dentry *dentry, umode_t > mode, > inode->i_mapping->a_ops = &f2fs_dblock_aops; > ino = inode->i_ino; > > + f2fs_balance_fs(sbi); > + > f2fs_lock_op(sbi); > err = f2fs_add_link(dentry, inode); > if (err) > @@ -288,12 +288,13 @@ static int f2fs_unlink(struct inode *dir, struct dentry *dentry) > int err = -ENOENT; > > trace_f2fs_unlink_enter(dir, dentry); > - f2fs_balance_fs(sbi); > > de = f2fs_find_entry(dir, &dentry->d_name, &page); > if (!de) > goto fail; > > + f2fs_balance_fs(sbi); > + > f2fs_lock_op(sbi); > err = acquire_orphan_inode(sbi); > if (err) { > @@ -341,8 +342,6 @@ static int f2fs_symlink(struct inode *dir, struct dentry *dentry, > if (len > dir->i_sb->s_blocksize) > return -ENAMETOOLONG; > > - f2fs_balance_fs(sbi); > - > inode = f2fs_new_inode(dir, S_IFLNK | S_IRWXUGO); > if (IS_ERR(inode)) > return PTR_ERR(inode); > @@ -353,6 +352,8 @@ static int f2fs_symlink(struct inode *dir, struct dentry *dentry, > inode->i_op = &f2fs_symlink_inode_operations; > inode->i_mapping->a_ops = &f2fs_dblock_aops; > > + f2fs_balance_fs(sbi); > + > f2fs_lock_op(sbi); > err = f2fs_add_link(dentry, inode); > if (err) > @@ -433,8 +434,6 @@ static int f2fs_mkdir(struct inode *dir, struct dentry *dentry, umode_t > mode) > struct inode *inode; > int err; > > - f2fs_balance_fs(sbi); > - > inode = f2fs_new_inode(dir, S_IFDIR | mode); > if (IS_ERR(inode)) > return PTR_ERR(inode); > @@ -444,6 +443,8 @@ static int f2fs_mkdir(struct inode *dir, struct dentry *dentry, umode_t > mode) > inode->i_mapping->a_ops = &f2fs_dblock_aops; > mapping_set_gfp_mask(inode->i_mapping, GFP_F2FS_HIGH_ZERO); > > + f2fs_balance_fs(sbi); > + > set_inode_flag(F2FS_I(inode), FI_INC_LINK); > f2fs_lock_op(sbi); > err = f2fs_add_link(dentry, inode); > -- > 2.5.4 (Apple Git-61) > > > ------------------------------------------------------------------------------ > _______________________________________________ > Linux-f2fs-devel mailing list > Linux-f2fs-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/