Re: [f2fs-dev] [RFC PATCH v2 4/4] f2fs: move fault injection to sysfs

2016-05-12 Thread Jaegeuk Kim
Hello, Could you send one patch which has 2, 3, and 4 together? And also, we don't need drop the mount option. Instead, we can turn on all the fault types with default values, once we get the option. Then, we can turn off any specific types dynamically. Thanks, On Thu, May 12, 2016 at

Re: [f2fs-dev] [RFC] f2fs: fix a race condition between evict & gc

2016-05-17 Thread Jaegeuk Kim
On Tue, May 17, 2016 at 11:00:53AM +0800, Hou Pengyang wrote: > On 2016/5/16 23:10, Chao Yu wrote: > Hi chao, > > Hi Pengyang, > > > > On 2016/5/16 18:40, Hou Pengyang wrote: > >> When collecting data segment(gc_data_segment), there is a race condition > >> between evict and phases of gc: > >> 0)

[f2fs-dev] [PATCH] f2fs: use bio count instead of F2FS_WRITEBACK page count

2016-05-17 Thread Jaegeuk Kim
This can reduce page counting overhead. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/checkpoint.c | 2 +- fs/f2fs/data.c | 26 +++--- fs/f2fs/debug.c | 6 +++--- fs/f2fs/f2fs.h | 4 ++-- fs/f2fs/super.c | 2 +- 5 files chang

Re: [f2fs-dev] [PATCH] f2fs: use bio count instead of F2FS_WRITEBACK page count

2016-05-17 Thread Jaegeuk Kim
On Wed, May 18, 2016 at 09:17:00AM +0800, Chao Yu wrote: > Hi Jaegeuk, > > On 2016/5/18 8:44, Jaegeuk Kim wrote: > > This can reduce page counting overhead. > > We change to increase one reference for one bio, but block layer can split or > merge bios by itself, and writ

[f2fs-dev] [PATCH 2/5] f2fs: use percpu_counter for page counters

2016-05-16 Thread Jaegeuk Kim
This patch substitutes percpu_counter for atomic_counter when counting various types of pages. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/debug.c | 1 + fs/f2fs/f2fs.h | 12 +++- fs/f2fs/super.c | 31 +++ 3 files changed, 35 insertions

[f2fs-dev] [PATCH 5/5] f2fs: use percpu_counter for total_valid_inode_count

2016-05-16 Thread Jaegeuk Kim
This patch uses percpu_counter to avoid stat_lock. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/f2fs.h | 18 +++--- fs/f2fs/super.c | 11 --- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 4

[f2fs-dev] [PATCH 4/5] f2fs: use percpu_counter for alloc_valid_block_count

2016-05-16 Thread Jaegeuk Kim
This patch uses percpu_count for sbi->alloc_valid_block_count. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/checkpoint.c | 2 +- fs/f2fs/f2fs.h | 8 +--- fs/f2fs/recovery.c | 5 +++-- fs/f2fs/super.c | 7 +-- 4 files changed, 14 insertions(+), 8

[f2fs-dev] [PATCH 3/5] f2fs: use percpu_counter for # of dirty pages in inode

2016-05-16 Thread Jaegeuk Kim
This patch adds percpu_counter for # of dirty pages in inode. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/f2fs.h | 10 +- fs/f2fs/file.c | 2 +- fs/f2fs/super.c | 8 +++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/fs/f2fs/f2fs.h b/f

Re: [f2fs-dev] [PATCH v2 2/2] f2fs: add fault injection to sysfs

2016-05-12 Thread Jaegeuk Kim
Hi Sheng, On Fri, May 13, 2016 at 10:22:40AM +0800, Sheng Yong wrote: > This patch introduces a new struct f2fs_fault_info and a global f2fs_fault > to save fault injection status. All fault injection interfaces are created > in /sys/fs/f2fs/fault_injection during initializing f2fs module. > >

Re: [f2fs-dev] Invoke GC by user?

2016-05-13 Thread Jaegeuk Kim
Hello, On Fri, May 13, 2016 at 11:47:29AM -0500, Jun He wrote: > Hi, > > I understand that "F2FS does cleaning both on demand and in the > background. On-demand cleaning is triggered when there are not enough > free segments to serve VFS calls". Is there any way to start GC to > clean all

Re: [f2fs-dev] [PATCH] f2fs: no need inc dirty pages under inode lock

2016-05-13 Thread Jaegeuk Kim
Hi Yunlei, It's just one atomic operation. Are there performance or race condition issues? Thanks, On Fri, May 13, 2016 at 02:57:43PM +0800, Yunlei He wrote: > No need inc dirty pages under inode lock > > Signed-off-by: Yunlei He > --- > fs/f2fs/checkpoint.c | 2 +- > 1

Re: [f2fs-dev] [PATCH v2 2/2] f2fs: add fault injection to sysfs

2016-05-13 Thread Jaegeuk Kim
On Fri, May 13, 2016 at 11:43:56AM +0800, Sheng Yong wrote: > Hi, Kim > > On 5/13/2016 10:47 AM, Jaegeuk Kim wrote: > > Hi Sheng, > > > > On Fri, May 13, 2016 at 10:22:40AM +0800, Sheng Yong wrote: > >> This patch introduces a new struct f2fs_fault_info and a

Re: [f2fs-dev] Kernel panic in F2FS mount on NVMe SSD.

2016-05-13 Thread Jaegeuk Kim
Hello, On Mon, May 09, 2016 at 10:26:08AM -0700, Jaegeuk Kim wrote: > On Mon, May 09, 2016 at 03:35:25PM +, Stephen Bates wrote: > > > > > > We could figure out how to improve them. :) > > > > > > I've been preparing two patches under testing right no

[f2fs-dev] [PATCH 01/11] f2fs: introduce macros for proc entries

2016-05-03 Thread Jaegeuk Kim
This adds macros to be used multiple proc entries. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/super.c | 25 ++--- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 19a85cf..b006de6 100644 --- a/f

[f2fs-dev] [PATCH 10/11] f2fs: fix leak of orphan inode objects

2016-05-03 Thread Jaegeuk Kim
When unmounting filesystem, we should release all the ino entries. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/checkpoint.c | 6 +++--- fs/f2fs/f2fs.h | 2 +- fs/f2fs/super.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/checkpoi

[f2fs-dev] [PATCH 06/11] f2fs: inject kmalloc failure

2016-05-03 Thread Jaegeuk Kim
This patch injects kmalloc failure given a fault injection rate. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/f2fs.h | 29 + fs/f2fs/super.c | 6 ++ 2 files changed, 35 insertions(+) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 0

[f2fs-dev] [PATCH 11/11] f2fs: retry to truncate blocks in -ENOMEM case

2016-05-03 Thread Jaegeuk Kim
This patch modifies to retry truncating node blocks in -ENOMEM case. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/inode.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index f4ac851..5cccd7a 100644 --- a/fs/f2fs/i

[f2fs-dev] [PATCH 04/11] f2fs: use f2fs_grab_cache_page instead of grab_cache_page

2016-05-03 Thread Jaegeuk Kim
This patch converts grab_cache_page to f2fs_grab_cache_page. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/checkpoint.c | 7 --- fs/f2fs/inline.c | 4 ++-- fs/f2fs/node.c | 8 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/f

[f2fs-dev] [PATCH 02/11] f2fs: add proc entry to show valid block bitmap

2016-05-03 Thread Jaegeuk Kim
This patch adds a new proc entry to show segment information in more detail. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/super.c | 32 +++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index b

[f2fs-dev] [PATCH 08/11] f2fs: inject ENOSPC failures

2016-05-03 Thread Jaegeuk Kim
This patch injects ENOSPC failures. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/checkpoint.c | 7 +++ fs/f2fs/dir.c| 4 fs/f2fs/f2fs.h | 10 ++ fs/f2fs/node.c | 4 fs/f2fs/super.c | 4 5 files changed, 29 insertions(+)

[f2fs-dev] [PATCH 07/11] f2fs: inject page allocation failures

2016-05-03 Thread Jaegeuk Kim
This patch adds page allocation failures. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/f2fs.h | 9 + fs/f2fs/super.c | 1 + 2 files changed, 10 insertions(+) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 60098df..02c2c96 100644 --- a/fs/f2fs/f2fs.h +++ b/f

[f2fs-dev] [PATCH 05/11] f2fs: add mount option to select fault injection ratio

2016-05-03 Thread Jaegeuk Kim
This patch adds a mount option to select fault ratio. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/Kconfig | 8 fs/f2fs/f2fs.h | 1 + fs/f2fs/super.c | 16 3 files changed, 25 insertions(+) diff --git a/fs/f2fs/Kconfig b/fs/f2fs/Kconfig index 1

[f2fs-dev] [PATCH 09/11] f2fs: revisit error handling flows

2016-05-03 Thread Jaegeuk Kim
This patch fixes a couple of bugs regarding to orphan inodes when handling errors. This tries to - call alloc_nid_done with add_orphan_inode in handle_failed_inode - let truncate blocks in f2fs_evict_inode - not make a bad inode due to i_mode change Signed-off-by: Jaegeuk Kim <j

[f2fs-dev] [PATCH 03/11] f2fs: introduce f2fs_kmalloc to wrap kmalloc

2016-05-03 Thread Jaegeuk Kim
This patch adds f2fs_kmalloc. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/acl.c| 4 ++-- fs/f2fs/dir.c| 2 +- fs/f2fs/f2fs.h | 5 + fs/f2fs/gc.c | 2 +- fs/f2fs/inline.c | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/acl.

Re: [f2fs-dev] Kernel panic in F2FS mount on NVMe SSD.

2016-05-04 Thread Jaegeuk Kim
Hi Stephen, On Wed, May 04, 2016 at 10:47:10PM +, Stephen Bates wrote: > Hi > > I have been experimenting with putting F2FS onto a NVMe block device. I have > been hitting a kernel panic on mount and was wondering if anyone on the list > had any ideas what might be causing this. I

Re: [f2fs-dev] [PATCH 11/11] f2fs: retry to truncate blocks in -ENOMEM case

2016-05-04 Thread Jaegeuk Kim
Hi, On Thu, May 05, 2016 at 10:00:15AM +0800, Hou Pengyang wrote: > On 2016/5/4 2:21, Jaegeuk Kim wrote: > >This patch modifies to retry truncating node blocks in -ENOMEM case. > > > Hi, Kim. in this patch, I think there is NO chance to retry for -ENOMEM. &g

Re: [f2fs-dev] Kernel panic in F2FS mount on NVMe SSD.

2016-05-04 Thread Jaegeuk Kim
On Thu, May 05, 2016 at 02:35:42AM +, Stephen Bates wrote: > > Hi Stephen, > > > > On Wed, May 04, 2016 at 10:47:10PM +, Stephen Bates wrote: > > > Hi > > > > > > I have been experimenting with putting F2FS onto a NVMe block device. I > > have been hitting a kernel panic on mount and was

[f2fs-dev] [GIT PULL] f2fs and fscrypto bug fixes for 4.6-rc4

2016-04-14 Thread Jaegeuk Kim
-mode lookup in d_invalidate - disallow -ENOMEM in the core data encryption path Jaegeuk Kim (4): fscrypto: use dget_parent() in fscrypt_d_revalidate() f2fs: use dget_parent and file_dentry in f2fs_file_open fscrypto

[f2fs-dev] [PATCH 1/2] f2fs: read node blocks ahead when truncating blocks

2016-05-07 Thread Jaegeuk Kim
This patch enables reading node blocks in advance when truncating large data blocks. > time rm $MNT/testfile (500GB) after drop_cachees Before : 9.422 s After : 4.821 s Reported-by: Stephen Bates <stephen.ba...@microsemi.com> Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> ---

Re: [f2fs-dev] Kernel panic in F2FS mount on NVMe SSD.

2016-05-07 Thread Jaegeuk Kim
On Thu, May 05, 2016 at 05:53:14PM +, Stephen Bates wrote: > > > > > > One thing I did notice is that fallocate() seems slow (5-6 GB/s) compared > > > to > > other file systems for a 3TiB fallocate() [ext4 performs the same operation > > in > > under a second on my system)]. Is this

Re: [f2fs-dev] [PATCH] f2fs: Return the errno to the caller to avoid using a wrong page

2016-05-25 Thread Jaegeuk Kim
Hi Yunlong, Do we have a bug report in terms of this? Thanks, On Wed, May 25, 2016 at 09:01:01PM +0800, Yunlong Song wrote: > Commit aaf9607516ed38825268515ef4d773289a44f429 ("f2fs: check node page > contents all the time") pointed out that "sometimes it was reported that > its contents was

[f2fs-dev] [GIT PULL] f2fs for 4.8

2016-07-26 Thread Jaegeuk Kim
f2fs: fix incorrect f_bfree calculation in ->statfs f2fs: fix to avoid redundant discard during fstrim f2fs: fix to avoid data update racing between GC and DIO f2fs: reset default idle interval value f2fs: fix to report error number of f2fs_find_entry Jaegeuk Kim

[f2fs-dev] [PATCH 5/5] f2fs: use blk_plug in all the possible paths

2016-07-14 Thread Jaegeuk Kim
This patch reverts 19a5f5e2ef37 (f2fs: drop any block plugging), and adds blk_plug in write paths additionally. The main reason is that blk_start_plug can be used to wake up from low-power mode before submitting further bios. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- f

[f2fs-dev] [PATCH 1/5] f2fs: refactor __exchange_data_block for speed up

2016-07-14 Thread Jaegeuk Kim
This reduces the elapsed time to do xfstests/generic/017. Before: 715 s After: 458 s Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/file.c | 236 + fs/f2fs/node.c | 1 + 2 files changed, 171 insertions(+), 66 del

[f2fs-dev] [PATCH 4/5] f2fs: add maximum prefree segments

2016-07-14 Thread Jaegeuk Kim
In 1TB storage, we need to admit 22841 prefree segments, which can consume too much segments. This patch sets 8GB in max. prefree segments in that case. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/segment.c | 3 +++ fs/f2fs/segment.h | 1 + 2 files changed, 4 insertions(+)

[f2fs-dev] [PATCH 2/5] f2fs: disable extent_cache for fcollapse/finsert inodes

2016-07-14 Thread Jaegeuk Kim
This reduces the elapsed time to do xfstests/generic/017. Before: 458 s After: 390 s Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/extent_cache.c | 13 + fs/f2fs/f2fs.h | 1 + fs/f2fs/file.c | 5 + 3 files changed, 19 insertions(+) diff

Re: [f2fs-dev] [PATCH v2] f2fs: get victim segment again after new cp

2016-07-22 Thread Jaegeuk Kim
Hi Yunlei, On Fri, Jul 22, 2016 at 07:08:31PM +0800, Yunlei He wrote: > Previous selected segment may become free after write_checkpoint, > if we do garbage collect on this segment, and then new_curseg happen > to reuse it, it may cause f2fs_bug_on as below. > > panic+0x154/0x29c >

Re: [f2fs-dev] [PATCH v2] f2fs: get victim segment again after new cp

2016-07-25 Thread Jaegeuk Kim
On Sun, Jul 24, 2016 at 06:38:46AM +0800, Chao Yu wrote: ... > >> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c > >> index de6c41c..ec17096 100644 > >> --- a/fs/f2fs/gc.c > >> +++ b/fs/f2fs/gc.c > >> @@ -908,10 +908,14 @@ gc_more: > >> * enough free sections, we should flush dent/node

Re: [f2fs-dev] Out of memory mounting 8 TB volume with 3.5 GiB of memory

2016-07-25 Thread Jaegeuk Kim
Hi, On Sun, Jul 24, 2016 at 09:46:32PM +0200, Rask Ingemann Lambertsen wrote: > Hello, > >I have one of those 8 TB shingled magnetic recording hard disk drives and > thought F2FS would be a good choice of file system because of the need to > write sequentially to the HDD. I passed -s 128 to

Re: [f2fs-dev] [GIT PULL] f2fs for 4.8

2016-07-27 Thread Jaegeuk Kim
t; > bio->bi_rw = fio->op_flags; > > bio_set_op_attrs(bio, fio->op, fio->op_flags); > > > > __submit_bio(fio->sbi, bio, fio->type); > > Ahh, yes. I'll add a patch to drop that line, unless you just want to > do it yourself (or J

Re: [f2fs-dev] [GIT PULL] f2fs for 4.8

2016-07-27 Thread Jaegeuk Kim
On Wed, Jul 27, 2016 at 01:41:01AM -0700, Christoph Hellwig wrote: > > - ioctl to move a range of data between files > > Please run this through the linux-api list first. We had so many > problem with random ioctls on random file systems in the past. Also > I know Samsung had an xfs (and maybe

[f2fs-dev] [PATCH] f2fs: clean up codying style and redundancy

2016-07-22 Thread Jaegeuk Kim
This patch includes minor clean-ups. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/acl.h | 2 +- fs/f2fs/data.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/acl.h b/fs/f2fs/acl.h index 997ca8e..b2334d1 100644 --- a/fs/f2fs/acl.h +++ b/f

Re: [f2fs-dev] [LKP] [lkp] [f2fs] ec795418c4: fsmark.files_per_sec -36.3% regression

2016-08-11 Thread Jaegeuk Kim
On Thu, Aug 11, 2016 at 03:49:41PM -0700, Huang, Ying wrote: > Hi, Kim, > > "Huang, Ying" writes: > >> > >> [lkp] [f2fs] 3bdad3c7ee: aim7.jobs-per-min -25.3% regression > >> [lkp] [f2fs] b93f771286: aim7.jobs-per-min -81.2% regression > >> > >> In terms of the above

Re: [f2fs-dev] [PATCH] In fs/f2fs/data.c, there is a typo.

2016-08-11 Thread Jaegeuk Kim
Hi Jonggyu, Please take a look at how other patches look like. (e.g., subject and your SOB) Thanks, On Wed, Aug 10, 2016 at 08:25:36PM +0900, Jonggyu wrote: > I fixed write_cche_pages to write_cache_pages > > Signed-off-by: Jonggyu > --- > fs/f2fs/data.c | 2 +- > 1

[f2fs-dev] [PATCH 1/3] f2fs: support an ioctl to move a range of data blocks

2016-07-20 Thread Jaegeuk Kim
This patch implements moving a range of data blocks from source file to destination file. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/f2fs.h | 9 fs/f2fs/file.c | 132 + 2 files changed, 141 insertions(+) diff

[f2fs-dev] [PATCH 2/3] f2fs: avoid data race when deciding checkpoin in f2fs_sync_file

2016-07-20 Thread Jaegeuk Kim
err); ... } ... } in do_recover_data. So, this patch avoids that situation in advance. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/f2fs.h | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 7a57279..3098109 100644 --- a/fs/f2

[f2fs-dev] [PATCH 3/3] f2fs: handle error case with f2fs_bug_on

2016-07-20 Thread Jaegeuk Kim
It's enough to show BUG or WARN by f2fs_bug_on for error case. Then, we don't need to remain corrupted filesystem. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/recovery.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c index 5

Re: [f2fs-dev] [PATCH] f2fs: get victim segment again after new cp

2016-07-21 Thread Jaegeuk Kim
Hi Yunlei, The problem may be the above stale segno. How about this? --- fs/f2fs/gc.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index de6c41c..8a0ed89 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -908,10 +908,12 @@ gc_more:

Re: [f2fs-dev] [PATCH 2/3] f2fs: support copy_file_range

2016-07-18 Thread Jaegeuk Kim
Hi, Please ignore copy/clone_file_range patches, which are wrong implementation. Sorry for the noise. Thanks, On Sat, Jul 16, 2016 at 11:24:26PM -0700, Jaegeuk Kim wrote: > This patch implements copy_file_range in f2fs. > > Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> &

[f2fs-dev] [PATCH 3/3] f2fs: support clone_file_range

2016-07-17 Thread Jaegeuk Kim
This patch implements clone_file_range in f2fs. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/file.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index c2b7e35..37480f3 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -

[f2fs-dev] [PATCH 2/3] f2fs: support copy_file_range

2016-07-17 Thread Jaegeuk Kim
This patch implements copy_file_range in f2fs. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/file.c | 98 ++ 1 file changed, 98 insertions(+) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 3573b07..c2b7e35 100644 --

[f2fs-dev] [PATCH 1/3] f2fs: avoid memory allocation failure due to a long length

2016-07-17 Thread Jaegeuk Kim
We need to avoid ENOMEM due to unexpected long length. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/file.c | 46 -- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 17b3059..3

Re: [f2fs-dev] [PATCH 5/5] f2fs: use blk_plug in all the possible paths

2016-07-18 Thread Jaegeuk Kim
On Mon, Jul 18, 2016 at 08:59:52PM -0700, Christoph Hellwig wrote: > On Thu, Jul 14, 2016 at 08:05:02PM -0700, Jaegeuk Kim wrote: > > >From kernel guys working on android. > > Well, until it's mainline it simply doesn't matter, so NAK to this > patch. Tying power behavior

Re: [f2fs-dev] [PATCH 3/3] f2fs: support clone_file_range

2016-07-18 Thread Jaegeuk Kim
On Mon, Jul 18, 2016 at 08:47:36PM -0700, Christoph Hellwig wrote: > On Sat, Jul 16, 2016 at 11:24:27PM -0700, Jaegeuk Kim wrote: > > This patch implements clone_file_range in f2fs. > > [...] > > > +int f2fs_clone_file_range(struct file *file_in, loff_t pos_in, >

Re: [f2fs-dev] [bug report] f2fs: fix to avoid reading out encrypted data in page cache

2016-07-12 Thread Jaegeuk Kim
Hello, It seems we can write just one patch to resolve this. Thoughts? >From f2bd632963409ff969aa2567a38f42f4b493a4b4 Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim <jaeg...@kernel.org> Date: Tue, 12 Jul 2016 09:38:48 -0700 Subject: [PATCH] f2fs: fix ERR_PTR returned by bio This is to

Re: [f2fs-dev] [PATCH 3/7] f2fs: drop any block plugging

2016-07-12 Thread Jaegeuk Kim
Hi Chao, On Tue, Jul 12, 2016 at 09:38:11AM +0800, Chao Yu wrote: > On 2016/7/10 0:32, Jaegeuk Kim wrote: > > On Sat, Jul 09, 2016 at 10:28:49AM +0800, Chao Yu wrote: > >> Hi Jaegeuk, > >> > >> On 2016/6/9 1:24, Jaegeuk Kim wrote: > >>> In f2f

Re: [f2fs-dev] [PATCH 2/2] f2fs: fix to avoid data update racing between GC and DIO

2016-07-05 Thread Jaegeuk Kim
On Fri, Jul 01, 2016 at 02:03:17PM +0800, Chao Yu wrote: > Hi Jaegeuk, > > On 2016/7/1 8:03, Jaegeuk Kim wrote: > > Hi Chao, > > > > On Thu, Jun 30, 2016 at 04:42:48PM +0800, Chao Yu wrote: > >> Datas in file can be operated by GC and DIO simultaneously, so

[f2fs-dev] [PATCH 2/2] f2fs: avoid mark_inode_dirty

2016-07-08 Thread Jaegeuk Kim
Let's check inode's dirtiness before calling mark_inode_dirty. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/acl.c | 2 +- fs/f2fs/dir.c | 6 +++--- fs/f2fs/extent_cache.c | 2 +- fs/f2fs/f2fs.h | 24 +--- fs/f2fs/file.c

Re: [f2fs-dev] [PATCH 1/2] f2fs: check only data or node for summary

2016-07-06 Thread Jaegeuk Kim
On Wed, Jul 06, 2016 at 12:09:12PM +0800, He YunLei wrote: > On 2016/6/11 5:01, Jaegeuk Kim wrote: > > We can check data or node types only for gc, since we allocate different > > type of > > data/node blocks in a different logs occasionally. > > > >

[f2fs-dev] [PATCH 6/6] f2fs: avoid mark_inode_dirty and update_inode

2016-07-06 Thread Jaegeuk Kim
Let's check inode's dirtiness before calling mark_inode_dirty and update_inode. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/acl.c | 2 +- fs/f2fs/dir.c | 6 +++--- fs/f2fs/extent_cache.c | 2 +- fs/f2fs/f2fs.h | 25 + f

[f2fs-dev] [PATCH 1/6] f2fs: introduce f2fs_set_page_dirty_nobuffer

2016-07-06 Thread Jaegeuk Kim
This patch adds f2fs_set_page_dirty_nobuffer() copied from __set_page_dirty_buffer. When appending 4KB blocks in f2fs on pmem with multiple cores, this improves the overall performance. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/checkpoint.c | 2 +- fs/f2fs/data.c

[f2fs-dev] [PATCH 5/6] f2fs: use percpu_rw_semaphore

2016-07-06 Thread Jaegeuk Kim
This patch replaces rw_semaphore with percpu_rw_semaphore for: sbi->cp_rwsem nm_i->nat_tree_lock Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/f2fs.h | 12 ++-- fs/f2fs/node.c | 47 --- fs/f2fs/super.c | 6 +++

[f2fs-dev] [PATCH 4/6] f2fs: skip to check the block address of node page

2016-07-06 Thread Jaegeuk Kim
If the node page is up-to-date, it should be alive. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/node.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index ca1bb3c..9d994b9 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/

[f2fs-dev] [PATCH 3/6] f2fs: shrink critical region in spin_lock

2016-07-06 Thread Jaegeuk Kim
This patch shrinks the critical region in spin_lock. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/f2fs.h | 23 --- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index a05f65b..a51f230 100644 --- a/fs/f2fs/

Re: [f2fs-dev] [PATCH 2/2] f2fs: fix to avoid data update racing between GC and DIO

2016-07-06 Thread Jaegeuk Kim
On Wed, Jul 06, 2016 at 10:10:57AM +0800, Chao Yu wrote: > On 2016/7/6 8:24, Jaegeuk Kim wrote: > > On Fri, Jul 01, 2016 at 02:03:17PM +0800, Chao Yu wrote: > >> Hi Jaegeuk, > >> > >> On 2016/7/1 8:03, Jaegeuk Kim wrote: > >>> Hi Chao, > >>

Re: [f2fs-dev] [PATCH v3] f2fs: fix to avoid data update racing between GC and DIO

2016-07-09 Thread Jaegeuk Kim
On Fri, Jul 08, 2016 at 11:50:02PM +0800, Chao Yu wrote: > Hi Jaegeuk, > > On 2016/7/8 11:19, Jaegeuk Kim wrote: > > Hi Chao, > > > > Could you take a look at this in xfstests/generic/013? > > > > [ 502.480850] =

Re: [f2fs-dev] [PATCH v3] f2fs: fix to avoid data update racing between GC and DIO

2016-07-07 Thread Jaegeuk Kim
Hi Chao, Could you take a look at this in xfstests/generic/013? [ 502.480850] == [ 502.480864] [ INFO: possible circular locking dependency detected ] [ 502.480877] 4.7.0-rc1+ #124 Tainted: G OE [ 502.480886]

Re: [f2fs-dev] [PATCH] f2fs: do not use discard_map for non-discard case

2016-08-05 Thread Jaegeuk Kim
On Fri, Aug 05, 2016 at 05:38:25PM +0800, Chao Yu wrote: > Hi Jaegeuk, > > On 2016/8/5 3:04, Jaegeuk Kim wrote: > > We don't need to keep discard_map, if f2fs has no discard mount option. > > In trim_fs path, we will still use discard_map though, right? Oops, right. :) I

Re: [f2fs-dev] [LKP] [lkp] [f2fs] ec795418c4: fsmark.files_per_sec -36.3% regression

2016-08-04 Thread Jaegeuk Kim
On Thu, Aug 04, 2016 at 10:44:20AM -0700, Huang, Ying wrote: > Jaegeuk Kim <jaeg...@kernel.org> writes: > > > Hi Huang, > > > > On Thu, Aug 04, 2016 at 10:00:41AM -0700, Huang, Ying wrote: > >> Hi, Jaegeuk, > >> > >> "Huang, Ying"

Re: [f2fs-dev] [LKP] [lkp] [f2fs] ec795418c4: fsmark.files_per_sec -36.3% regression

2016-08-04 Thread Jaegeuk Kim
Hi Huang, On Thu, Aug 04, 2016 at 10:00:41AM -0700, Huang, Ying wrote: > Hi, Jaegeuk, > > "Huang, Ying" writes: > > Hi, > > > > I checked the comparison result below and found this is a regression for > > fsmark.files_per_sec, not fsmark.app_overhead. > > > > Best Regards,

Re: [f2fs-dev] f2fs-tool-1.7.0 build error

2016-07-29 Thread Jaegeuk Kim
Hello, I've fixed up right away. Thanks, On Fri, Jul 29, 2016 at 11:22:24AM +0700, Perfect Gentleman wrote: > >>> Source configured. > >>> Compiling source in > /tmp/portage/sys-fs/f2fs-tools-/work/f2fs-tools- ... > make -j7 > make all-recursive > make[1]: Entering directory >

Re: [f2fs-dev] [PATCH 2/2] f2fs: fix to avoid data update racing between GC and DIO

2016-06-30 Thread Jaegeuk Kim
Hi Chao, On Thu, Jun 30, 2016 at 04:42:48PM +0800, Chao Yu wrote: > Datas in file can be operated by GC and DIO simultaneously, so we will > face race case as below: > > For write case: > Thread A Thread B > - generic_file_direct_write > -

[f2fs-dev] [PATCH 4/5] f2fs: move write_node_page above fsync_node_pages

2017-02-03 Thread Jaegeuk Kim
This patch just moves write_node_page and introduces an inner function. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/node.c | 142 ++--- 1 file changed, 74 insertions(+), 68 deletions(-) diff --git a/fs/f2fs/node.c b/f

[f2fs-dev] [PATCH 3/5] f2fs: move flush tracepoint

2017-02-03 Thread Jaegeuk Kim
This patch moves the tracepoint location for flush command. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/segment.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 984d94efe8cb..2c283a5fead0 100644 --- a/f

[f2fs-dev] [PATCH 2/5] f2fs: check last page index in cached bio to decide submission

2017-02-03 Thread Jaegeuk Kim
If the cached bio has the last page's index, then we need to submit it. Otherwise, we don't need to submit it and can wait for further IO merges. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/checkpoint.c | 3 ++- fs/f2fs/data.c

Re: [f2fs-dev] [PATCH] mkfs.f2fs: make sure clean all reset dnodes

2017-02-06 Thread Jaegeuk Kim
Nice catch! On 02/07, Kinglong Mee wrote: > memset(raw_node, 0, F2FS_BLKSIZE) sets the next_blkaddr to zero, > so that, only one reset dnode is cleaned always. > > Fixes: ad042d9194f5 "mkfs.f2fs: reset dnode with zeros", > Signed-off-by: Kinglong Mee > --- >

Re: [f2fs-dev] [PATCH 5/6] f2fs: add a kernel thread to issue discard commands asynchronously

2017-02-08 Thread Jaegeuk Kim
On 02/08, Christoph Hellwig wrote: > On Mon, Feb 06, 2017 at 07:44:03PM -0800, Jaegeuk Kim wrote: > > Sorry for the late response due to the travel. > > > > When doing fstrim with a fresh f2fs image fomatted on Intel NVMe SSD whose > > model name is SSDPE2MW012T4, I

Re: [f2fs-dev] [PATCH] f2fs: introduce nid cache

2017-02-08 Thread Jaegeuk Kim
On 02/08, Chao Yu wrote: > On 2017/2/7 15:24, Chao Yu wrote: > > Hi Jaegeuk, > > > > Happy Chinese New Year! :) > > > > On 2017/1/24 12:35, Jaegeuk Kim wrote: > >> Hi Chao, > >> > >> On 01/22, Chao Yu wrote: > >>> In scena

Re: [f2fs-dev] f2fs-tools support packing file into android image ?

2017-01-30 Thread Jaegeuk Kim
Hello, On 01/22, Yu Xing (邢宇) wrote: > Hi > > Recently, I used the make_f2fs command to create android > system.img/userdata.img/cache.img. > The tool from system/extras/f2fs_utils/ > > But I found the make_f2fs cannot packing file into image, so I can not > apply the tool

Re: [f2fs-dev] Unrecoverable FS errors

2017-01-30 Thread Jaegeuk Kim
On 01/29, V10lator wrote: > Hi, > > I compiled and tried the version you linked, sadly it's still the same. Oh, was there no reported error? Then, which kernel version are you using? Thanks, > > Thanks for your support > > Am Sonntag, 29. Januar 2017 05:14:46 CET schrie

Re: [f2fs-dev] [PATCH 2/2] fsck.f2fs: support -p without argument

2017-01-20 Thread Jaegeuk Kim
On 01/20, Sheng Yong wrote: > Hi Jaegeuk, > > On 1/20/2017 5:47 PM, Jaegeuk Kim wrote: > > On 01/20, Sheng Yong wrote: > [..] > >>> > >>> if (!strcmp("fsck.f2fs", prog)) { > >>> - const char *option_string = "ad:fp:

[f2fs-dev] [PATCH 2/2] fsck.f2fs: show parse errors neatly

2017-01-20 Thread Jaegeuk Kim
This patch is just to clean up. Cc: Sheng Yong <shengyo...@huawei.com> Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fsck/fsck.h | 8 fsck/main.c | 140 2 files changed, 93 insertions(+), 55 deletions(-) diff

[f2fs-dev] [PATCH 1/2] fsck.f2fs: support -p without argument

2017-01-20 Thread Jaegeuk Kim
; Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fsck/main.c | 99 + 1 file changed, 80 insertions(+), 19 deletions(-) diff --git a/fsck/main.c b/fsck/main.c index 39ef8d3..0ac1711 100644 --- a/fsck/main.c +++ b/fsck/mai

Re: [f2fs-dev] Unrecoverable FS errors

2017-01-28 Thread Jaegeuk Kim
Hi, On 01/27, V10lator wrote: > Hi, > > First off if this is the wrong mailing list please tell me, I just couldn't > find any other for f2fs. > > Around a year (maybe longer) ago my computer crashed, the only way was a > hard reset which caused f2fs corruptions. Since then fsck.f2fs -f finds

Re: [f2fs-dev] [PATCH 0/5] Fix coding style errors and warnings in f2fs.h

2017-01-28 Thread Jaegeuk Kim
Hi DongOh, It doesn't need to split everything with same patch subjects. So, could you please submit two patches? - f2fs: fix coding style errors in f2fs.h - f2fs: fix coding style warnings in f2fs.h Thanks, On 01/27, DongOh Shin wrote: > f2fs.h has 3 errors and 454 warnings on the coding

Re: [f2fs-dev] [PATCH] f2fs: enhance lookup xattr

2017-01-28 Thread Jaegeuk Kim
Hi Chao, On 01/24, Chao Yu wrote: ... > > - error = read_all_xattrs(inode, ipage, _addr); > + error = lookup_all_xattrs(inode, ipage, index, len, name, > + , _addr); > if (error) > return error; > > - entry =

Re: [f2fs-dev] [PATCH 2/2] f2fs: remove unnecessary wait in write_begin

2017-02-17 Thread Jaegeuk Kim
>From 8baf724c638813ab8d2e9bad99f5b8683e788da3 Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim <jaeg...@kernel.org> Date: Fri, 17 Feb 2017 09:55:55 -0800 Subject: [PATCH] f2fs: do not wait for writeback in write_begin Otherwise we can get livelock like below. [79880.428136] dbench D

Re: [f2fs-dev] [PATCH 0/2] Reduce the overprovision size a lot in f2fs

2017-02-17 Thread Jaegeuk Kim
Hi Yunlong, On 02/17, Yunlong Song wrote: > Rethink the meaning of reserved segments and overprovision segments in f2fs > > The key issue is that flash FTL has already made overprovision itself, e.g. > 7%, > according to the difference between gigabyte (GB) and gibibyte (GiB). And this > part

Re: [f2fs-dev] [RFC] add ovp valid_blocks check for bg gc victim to fg_gc

2017-02-17 Thread Jaegeuk Kim
On 02/17, Hou Pengyang wrote: ... > > > On 2017/2/17 7:48, Jaegeuk Kim wrote: > > > > + ovp_count = SM_I(sbi)->ovp_segments << sbi->log_blocks_per_seg; > > > > > > About the ovp_count calculation, > > > > &

Re: [f2fs-dev] [PATCH 2/2] f2fs: fix the case when there is no free segment to allocate for CURSEG_WARM_NODE

2017-02-17 Thread Jaegeuk Kim
Hi Yunlong, I already started to test this since a couple of days ago. :) http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs.git/commit/?h=dev-test=908b5f463c82eaf972b149a26bb310f5e25064fd Thanks, On 02/17, Yunlong Song wrote: > If the free segments are used up, then new_curseg will fail

Re: [f2fs-dev] [PATCH 1/2] f2fs: replace __get_victim by dirty_segments in FG_GC

2017-02-17 Thread Jaegeuk Kim
Hi Yunlei, I also removed "segno = NULL_SEGNO;" in the beginning part near gc_more. Thanks, On 02/17, Yunlei He wrote: > In FG_GC process, it will search victim section twice. This will > cause some dirty section with less valid blocks skip garbage > collection. > > section # 26425 : valid

[f2fs-dev] [PATCH] f2fs: trace victim's cost selectecd by f2fs_gc

2017-02-17 Thread Jaegeuk Kim
This patch adds min_cost of each victims. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- include/trace/events/f2fs.h | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h index 153572e256d6..ff31ccfb8111

Re: [f2fs-dev] [RFC] add ovp valid_blocks check for bg gc victim to fg_gc

2017-02-16 Thread Jaegeuk Kim
On 02/17, Hou Pengyang wrote: > On 2017/2/17 7:48, Jaegeuk Kim wrote: > > Hi Pengyang, > > > > Nice > Hi Jaegeuk, > catch! > > > > I think fggc_threshold needs to be revised, and we need to consider about > > general victim sele

Re: [f2fs-dev] documentation for atomic writes, encryption and other features

2017-02-16 Thread Jaegeuk Kim
Hi Daniel, On 02/17, Daniel Black wrote: > I was looking at Documentation/filesystems/f2fs.txt trying to work out > how to do atomic writes. > > I did find https://www.spinics.net/lists/kernel/msg1839691.html which > contains some elements. > > It seems F2FS_IOC_DB_OPEN might been replaced by >

Re: [f2fs-dev] [RFC] add ovp valid_blocks check for bg gc victim to fg_gc

2017-02-16 Thread Jaegeuk Kim
g_victims, if segment's has # of valid blocks over overprovision ratio, skip such segments. Cc: <sta...@vger.kernel.org> Signed-off-by: Hou Pengyang <houpengy...@huawei.com> Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/f2fs.h| 3 +++ fs/f2fs/gc.c | 22

Re: [f2fs-dev] [PATCH] f2fs: no need lock_op in f2fs_write_inline_data

2017-02-23 Thread Jaegeuk Kim
Hi Yunlei, On 02/23, Yunlei He wrote: > Similar as f2fs_write_inode, f2fs_write_inline_data just > mark inode page dirty, so it's no need to write inline data > under read lock of cp_rwsem. We count # of dirty inodes that we need to flush through f2fs_write_inode, so it's fine to go without

Re: [f2fs-dev] [PATCH 10/10] f2fs: return fs_trim if there is no candidate

2017-02-22 Thread Jaegeuk Kim
Hi Chao, On 02/22, Chao Yu wrote: > On 2016/12/31 2:51, Jaegeuk Kim wrote: > > If there is no candidate to submit discard command during f2sf_trim_fs, > > let's > > return without checkpoint. > > > > Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> >

Re: [f2fs-dev] [PATCH 3/6] f2fs: remove batched discard in f2fs_trim_fs

2017-02-22 Thread Jaegeuk Kim
On 02/22, Chao Yu wrote: > On 2017/1/13 6:44, Jaegeuk Kim wrote: > > We don't need to do multiple checkpoints, since we don't actually wait for > > completion of discard commands during checkpoint. > > Instead, we still need to avoid very big discard commands, since that

Re: [f2fs-dev] [PATCH 08/10] f2fs: relax async discard commands more

2017-02-22 Thread Jaegeuk Kim
On 02/22, Chao Yu wrote: > On 2017/1/6 10:42, Jaegeuk Kim wrote: > > Hi Chao, > > > > On 01/06, Chao Yu wrote: > >> On 2017/1/6 3:46, Jaegeuk Kim wrote: > >>> On 01/05, Chao Yu wrote: > >>>> On 2017/1/4 17:29, Chao Yu wrote: > >

Re: [f2fs-dev] [PATCH 2/3 v2] f2fs: add bitmaps for empty or full NAT blocks

2017-02-23 Thread Jaegeuk Kim
, but in runtime, we check empty NAT blocks to load free nids without loading any NAT pages from disk. Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org> --- fs/f2fs/checkpoint.c| 28 +++- fs/f2fs/debug.c | 1 + fs/f2fs/f2fs.h | 31 +++- fs/f2fs/node.c

<    6   7   8   9   10   11   12   13   14   15   >