Re: [f2fs-dev] [PATCH v11 18/63] page cache: Add and replace pages using the XArray

2018-04-26 Thread Matthew Wilcox
On Sat, Apr 14, 2018 at 07:12:31AM -0700, Matthew Wilcox wrote: > - xa_lock_irq(>i_pages); > - error = page_cache_tree_insert(mapping, page, shadowp); > - radix_tree_preload_end(); > - if (unlikely(error)) > - goto err_insert; > + do { > +

Re: [f2fs-dev] [PATCH v11 19/63] page cache: Convert page deletion to XArray

2018-04-26 Thread Matthew Wilcox
On Fri, Apr 20, 2018 at 07:00:57AM -0500, Goldwyn Rodrigues wrote: > On 04/14/2018 09:12 AM, Matthew Wilcox wrote: > > > > - for (i = 0; i < nr; i++) { > > - struct radix_tree_node *node; > > - void **slot; > > - > > - __radix_tree_lookup(>i_pages, page->index +

Re: [f2fs-dev] [PATCH 2/2] Revert "f2fs: add ovp valid_blocks check for bg gc victim to fg_gc"

2018-04-26 Thread Chao Yu
Hi Jaegeuk, Missed this patch, or any problem in it? Thanks, On 2018/4/26 17:05, Chao Yu wrote: > For extreme case: > 10 section, op = 10%, no_fggc_threshold = 90% > All section usage: 85% 85% 85% 85% 90% 90% 95% 95% 95% 95% > > During foreground GC, if we skip select dirty section whose usage

Re: [f2fs-dev] [RFC PATCH f2fs] f2fs: release_discard_addr() can be static

2018-04-26 Thread Chao Yu
Hi Fengguang, thanks for the fix. To Jaegeuk, could you please merge it to original patch? Thanks, On 2018/4/27 3:57, kbuild test robot wrote: > > Fixes: 6f89409e87ce ("f2fs: introduce release_discard_addr() for cleanup") > Signed-off-by: Fengguang Wu > --- >

Re: [f2fs-dev] [PATCH] f2fs: fix to wait IO writeback in __revoke_inmem_pages()

2018-04-26 Thread Chao Yu
On 2018/4/27 0:36, Jaegeuk Kim wrote: > On 04/26, Chao Yu wrote: >> On 2018/4/26 23:48, Jaegeuk Kim wrote: >>> On 04/26, Chao Yu wrote: Thread A Thread B - f2fs_ioc_commit_atomic_write - commit_inmem_pages - f2fs_submit_merged_write_cond :

Re: [f2fs-dev] [RFC PATCH] f2fs-tools: introduce tune.f2fs

2018-04-26 Thread Chao Yu
On 2018/4/27 0:13, Jaegeuk Kim wrote: > On 04/26, Junling Zheng wrote: >> Ping... >> >> On 2018/4/23 15:32, Junling Zheng wrote: >>> Introduce tune.f2fs tool to change the f2fs parameters. >>> Currently this tool only supports adding or removing encrypt >>> feature bit in superblock. > > What is

Re: [f2fs-dev] [PATCH v2] f2fs: fix to avoid race during access gc_thread pointer

2018-04-26 Thread Chao Yu
On 2018/4/27 10:04, Chao Yu wrote: > On 2018/4/27 0:03, Jaegeuk Kim wrote: >> On 04/24, Chao Yu wrote: >>> Thread AThread BThread C >>> - f2fs_remount >>> - stop_gc_thread >>> - f2fs_sbi_store >>>

Re: [f2fs-dev] [PATCH v2] f2fs: fix to avoid race during access gc_thread pointer

2018-04-26 Thread Chao Yu
On 2018/4/27 0:03, Jaegeuk Kim wrote: > On 04/24, Chao Yu wrote: >> Thread A Thread BThread C >> - f2fs_remount >> - stop_gc_thread >> - f2fs_sbi_store >> - issue_discard_thread

Re: [f2fs-dev] [PATCH 4/5 v2] f2fs: sanity check for total valid blocks

2018-04-26 Thread Chao Yu
On 2018/4/26 23:29, Jaegeuk Kim wrote: > This patch enhances sanity check for SIT entries. > > syzbot hit the following crash on upstream commit > 83beed7b2b26f232d782127792dd0cd4362fdc41 (Fri Apr 20 17:56:32 2018 +) > Merge branch 'fixes' of >

Re: [f2fs-dev] [PATCH v2] f2fs: avoid stucking GC due to atomic write

2018-04-26 Thread Chao Yu
On 2018/4/26 23:54, Jaegeuk Kim wrote: > On 04/24, Chao Yu wrote: >> f2fs doesn't allow abuse on atomic write class interface, so except >> limiting in-mem pages' total memory usage capacity, we need to limit >> atomic-write usage as well when filesystem is seriously fragmented, >> otherwise we

Re: [f2fs-dev] [PATCH 5/5] f2fs: enforce fsync_mode=strict for renamed directory

2018-04-26 Thread Chao Yu
On 2018/4/26 23:32, Jaegeuk Kim wrote: > On 04/25, Chao Yu wrote: >> On 2018/4/25 13:46, Jaegeuk Kim wrote: >>> This is to give a option for user to be able to recover B/foo in the below >>> case. >>> >>> mkdir A >>> sync() >>> rename(A, B) >>> creat (B/foo) >>> fsync (B/foo) >>> ---crash--- >> >>

[f2fs-dev] [f2fs:dev-test 40/41] fs/f2fs/segment.c:1601:6: sparse: symbol 'release_discard_addr' was not declared. Should it be static?

2018-04-26 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev-test head: 57ef368c8663e2198fadc0cfecdf67e0fe11e65a commit: 6f89409e87ce2a41baa5650c978857f306c02859 [40/41] f2fs: introduce release_discard_addr() for cleanup reproduce: # apt-get install sparse git

[f2fs-dev] [RFC PATCH f2fs] f2fs: release_discard_addr() can be static

2018-04-26 Thread kbuild test robot
Fixes: 6f89409e87ce ("f2fs: introduce release_discard_addr() for cleanup") Signed-off-by: Fengguang Wu --- segment.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 8652cfd..a0fce5e 100644 ---

Re: [f2fs-dev] [RFC PATCH] f2fs-tools: introduce tune.f2fs

2018-04-26 Thread Jaegeuk Kim
On 04/26, Junling Zheng wrote: > Ping... > > On 2018/4/23 15:32, Junling Zheng wrote: > > Introduce tune.f2fs tool to change the f2fs parameters. > > Currently this tool only supports adding or removing encrypt > > feature bit in superblock. What is the purpose of this empty tune.f2fs? How can

Re: [f2fs-dev] [PATCH 2/3] f2fs: introduce {create, destroy}_discard_caches for cleanup

2018-04-26 Thread Jaegeuk Kim
On 04/25, Chao Yu wrote: > Split discard slab cache related initial/release codes into separated > function {create,destroy}_discard_caches, later we can maintain those > independent functions in separated discard.c No need this as well. > > Signed-off-by: Chao Yu > --- >

Re: [f2fs-dev] [PATCH 3/3] f2fs: maintain discard interface separately

2018-04-26 Thread Jaegeuk Kim
On 04/25, Chao Yu wrote: > This patch adds a new file discard.c to maintain discard related > function separately. I don't think we need this at all. Thanks, > > BTW, fix below checkpatch errors: > > ERROR: space required before the open brace '{' > + } else if (issued == -1){ > >

Re: [f2fs-dev] [PATCH] f2fs: fix to wait IO writeback in __revoke_inmem_pages()

2018-04-26 Thread Chao Yu
On 2018/4/26 23:48, Jaegeuk Kim wrote: > On 04/26, Chao Yu wrote: >> Thread A Thread B >> - f2fs_ioc_commit_atomic_write >> - commit_inmem_pages >> - f2fs_submit_merged_write_cond >> : write data >> - write_checkpoint >>

Re: [f2fs-dev] [PATCH v2] f2fs: avoid stucking GC due to atomic write

2018-04-26 Thread Jaegeuk Kim
On 04/24, Chao Yu wrote: > f2fs doesn't allow abuse on atomic write class interface, so except > limiting in-mem pages' total memory usage capacity, we need to limit > atomic-write usage as well when filesystem is seriously fragmented, > otherwise we may run into infinite loop during foreground GC

Re: [f2fs-dev] [PATCH] f2fs: fix to wait IO writeback in __revoke_inmem_pages()

2018-04-26 Thread Jaegeuk Kim
On 04/26, Chao Yu wrote: > Thread A Thread B > - f2fs_ioc_commit_atomic_write > - commit_inmem_pages > - f2fs_submit_merged_write_cond > : write data > - write_checkpoint >-

Re: [f2fs-dev] [PATCH 5/5] f2fs: enforce fsync_mode=strict for renamed directory

2018-04-26 Thread Jaegeuk Kim
On 04/25, Chao Yu wrote: > On 2018/4/25 13:46, Jaegeuk Kim wrote: > > This is to give a option for user to be able to recover B/foo in the below > > case. > > > > mkdir A > > sync() > > rename(A, B) > > creat (B/foo) > > fsync (B/foo) > > ---crash--- > > That makes sense, IMO, it will be better

Re: [f2fs-dev] [PATCH 4/5 v2] f2fs: sanity check for total valid blocks

2018-04-26 Thread Jaegeuk Kim
This patch enhances sanity check for SIT entries. syzbot hit the following crash on upstream commit 83beed7b2b26f232d782127792dd0cd4362fdc41 (Fri Apr 20 17:56:32 2018 +) Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal syzbot dashboard link:

Re: [f2fs-dev] [PATCH 4/5] f2fs: sanity check for total valid blocks

2018-04-26 Thread Jaegeuk Kim
On 04/25, Chao Yu wrote: > Hi Jaegeuk, > > This patch makes generic/008 failed, because for fallocate case, total valid > block count can not be calculated by gathering valid_blocks of all sit > entries. Yeah, I got that too, and I've been testing to change it by valid_node_count, which works

Re: [f2fs-dev] [PATCH 1/5] f2fs: give message and set need_fsck given broken node id

2018-04-26 Thread Jaegeuk Kim
On 04/25, Chao Yu wrote: > On 2018/4/25 13:46, Jaegeuk Kim wrote: > > syzbot hit the following crash on upstream commit > > 83beed7b2b26f232d782127792dd0cd4362fdc41 (Fri Apr 20 17:56:32 2018 +) > > Merge branch 'fixes' of > >

[f2fs-dev] [PATCH 1/2] f2fs: treat volatile file's data as hot one

2018-04-26 Thread Chao Yu
Volatile file's data will be updated oftenly, so it'd better to place its data into hot data segment. In addition, for atomic file, we change to check FI_ATOMIC_FILE instead of FI_HOT_DATA to make code readability better. Signed-off-by: Chao Yu --- fs/f2fs/file.c| 2 --

[f2fs-dev] [PATCH] f2fs: fix to wait IO writeback in __revoke_inmem_pages()

2018-04-26 Thread Chao Yu
Thread AThread B - f2fs_ioc_commit_atomic_write - commit_inmem_pages - f2fs_submit_merged_write_cond : write data - write_checkpoint - do_checkpoint

[f2fs-dev] [PATCH v3] f2fs: build free nid bitmap during flush nat entries

2018-04-26 Thread Yunlei He
This patch introduce free nid bitmap build during flush nat entries in order to reduce synchronous read in the process of build free nids. Signed-off-by: Yunlei He --- fs/f2fs/node.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git