Re: [f2fs-dev] [PATCH] f2fs: fix to avoid NULL pointer dereference in f2fs_issue_flush()

2023-01-03 Thread Yuwei Guan
于2023年1月4日周三 01:04写道: > > Hello: > > This patch was applied to jaegeuk/f2fs.git (dev) > by Jaegeuk Kim : > > On Fri, 30 Dec 2022 23:43:32 +0800 you wrote: > > With below two cases, it will cause NULL pointer dereference when > > accessing SM_I(sbi)->fcc_info in f2fs_issue_flush(). > > > > a) If

[f2fs-dev] [PATCH] f2fs: do decrease_sleep_time() if any of the victims have been selected

2022-12-09 Thread Yuwei Guan
from no_gc_sleep_time, if *wait is no_gc_sleep_time. And then it goes down in the next step. Signed-off-by: Yuwei Guan --- fs/f2fs/gc.c | 2 ++ fs/f2fs/gc.h | 7 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index f0c6506d8975..c023ffeb9268

[f2fs-dev] [PATCH v3] f2fs: deliver the accumulated 'issued' to __issue_discard_cmd_orderly() to meet the max_requests limit

2022-12-13 Thread Yuwei Guan
in f2fs_tuning_parameters(). We need to deliver the accumulated @issued to __issue_discard_cmd_orderly() to meet the max_requests limit. BTW, convert the parameter type of @issued in __submit_discard_cmd(). Signed-off-by: Yuwei Guan Cc: Bagas Sanjaya --- fs/f2fs/segment.c | 24

Re: [f2fs-dev] [PATCH] f2fs: continuous counting for 'issued' in __issue_discard_cmd_orderly()

2022-12-11 Thread Yuwei Guan
在 2022/12/11 10:36, Chao Yu 写道: On 2022/11/22 0:11, Yuwei Guan wrote: As the 'dcc->discard_granularity' and 'dcc->max_ordered_discard' can be set at the user space, and if the 'dcc->max_ordered_discard' is set larger than 'dcc->discard_granularity' in DPOLICY_BG mode, or i

[f2fs-dev] [PATCH v2] f2fs: continuous counting for 'issued' in __issue_discard_cmd_orderly()

2022-12-11 Thread Yuwei Guan
g_parameters(), it will may send more requests than the number of 'dpolicy->max_requests' in issue_discard_thread(). This patch will fix the issue. Signed-off-by: Yuwei Guan --- fs/f2fs/segment.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/fs/f2fs/segm

Re: [f2fs-dev] [PATCH] f2fs: do decrease_sleep_time() if any of the victims have been selected

2022-12-11 Thread Yuwei Guan
在 2022/12/11 10:52, Chao Yu 写道: On 2022/12/9 19:28, Yuwei Guan wrote: In non-foreground gc mode, if no victim is selected, the gc process will wait for no_gc_sleep_time before waking up again. In this subsequent time, even though a victim will be selected, the gc process still waits

[f2fs-dev] [PATCH v2] f2fs: reset wait_ms to default if any of the victims have been selected

2022-12-11 Thread Yuwei Guan
is not reasonable. After any of the victims have been selected, we need to reset wait_ms to default sleep time from no_gc_sleep_time. Signed-off-by: Yuwei Guan --- fs/f2fs/gc.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index f0c6506d8975..d7a9d84ba57c 100644 --- a/fs

Re: [f2fs-dev] [PATCH v2] f2fs: continuous counting for 'issued' in __issue_discard_cmd_orderly()

2022-12-13 Thread Yuwei Guan
Bagas Sanjaya 于2022年12月11日周日 21:20写道: > > On Sun, Dec 11, 2022 at 08:18:52PM +0800, Yuwei Guan wrote: > > As the 'dcc->discard_granularity' and 'dcc->max_ordered_discard' can be set > > at the user space, and if the 'dcc->max_ordered_discard' is set larger than &g

[f2fs-dev] [PATCH] f2fs: remove useless io_aware_gran variable

2022-11-16 Thread Yuwei Guan
This 'io_aware_gran' is initialized as MAX_PLIST_NUM in __init_discard_policy(), and use as 'i < dpolicy->io_aware_gran' in __issue_discard_cmd(), but 'i < dpolicy->io_aware_gran' is true always, so remvoe this variable. Signed-off-by: Yuwei Guan --- fs/f2fs/f2fs.h| 1 - fs/f2

[f2fs-dev] [PATCH] f2fs: continuous counting for 'issued' in __issue_discard_cmd_orderly()

2022-11-21 Thread Yuwei Guan
g_parameters(), it will may send more requests than the number of 'dpolicy->max_requests' in issue_discard_thread(). This patch will fix the issue. Signed-off-by: Yuwei Guan --- fs/f2fs/segment.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/fs/f2fs/segment.c b/fs

[f2fs-dev] [PATCH 0/3] alloc_mode changed after remount on a small volume device

2022-11-12 Thread Yuwei Guan
This series contains a fix patch for alloc_mode changed after remount on a small volume device, and do cleanup for 'f2fs_tuning_parameters' function. The last one change type for sbi->readdir_ra. Yuwei Guan (3): f2fs: fix to alloc_mode changed after remount on a small volume device f

[f2fs-dev] [PATCH 3/3] f2fs: change type for 'sbi->readdir_ra'

2022-11-12 Thread Yuwei Guan
Before this patch, the varibale 'readdir_ra' takes effect if it's equal to '1' or not, so we can change type for it from 'int' to 'bool'. Signed-off-by: Yuwei Guan --- fs/f2fs/dir.c | 7 +++ fs/f2fs/f2fs.h | 2 +- fs/f2fs/super.c | 2 +- fs/f2fs/sysfs.c | 5 + 4 files changed, 10

[f2fs-dev] [PATCH 2/3] f2fs: cleanup for 'f2fs_tuning_parameters' function

2022-11-12 Thread Yuwei Guan
A cleanup patch for 'f2fs_tuning_parameters' function. Signed-off-by: Yuwei Guan --- fs/f2fs/super.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 2f36824ff84b..f18ae5410b2c 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c

[f2fs-dev] [PATCH 1/3] f2fs: fix to alloc_mode changed after remount on a small volume device

2022-11-12 Thread Yuwei Guan
loc_mode will be set as remount command, if it has 'alloc_mode='. Signed-off-by: Yuwei Guan --- fs/f2fs/super.c | 37 - 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 3834ead04620..2f36824ff84b 100644 --- a/fs/f

Re: [f2fs-dev] [PATCH 1/3] f2fs: fix to alloc_mode changed after remount on a small volume device

2022-11-14 Thread Yuwei Guan
On 2022/11/14 22:42, Chao Yu wrote: On 2022/11/12 16:32, Yuwei Guan wrote: The commit 84b89e5d943d8 ("f2fs: add auto tuning for small devices") add tuning for small volume device, now support to tune alloce_mode to 'reuse' if it's small size. But the alloc_mode will change to 'def

Re: [f2fs-dev] [PATCH 3/3] f2fs: change type for 'sbi->readdir_ra'

2022-11-14 Thread Yuwei Guan
On 2022/11/14 22:59, Chao Yu wrote: On 2022/11/12 16:32, Yuwei Guan wrote: Before this patch, the varibale 'readdir_ra' takes effect if it's equal to '1' or not, so we can change type for it from 'int' to 'bool'. Signed-off-by: Yuwei Guan ---   fs/f2fs/dir.c   | 7 +++   fs/f2fs/f2fs.h

Re: [f2fs-dev] [PATCH 1/3] f2fs: fix to alloc_mode changed after remount on a small volume device

2022-11-14 Thread Yuwei Guan
On 2022/11/15 9:23, Chao Yu wrote: On 2022/11/15 0:13, Yuwei Guan wrote: On 2022/11/14 22:42, Chao Yu wrote: On 2022/11/12 16:32, Yuwei Guan wrote: The commit 84b89e5d943d8 ("f2fs: add auto tuning for small devices") add tuning for small volume device, now support to tune a

[f2fs-dev] [PATCH v2 0/3] alloc_mode changed after remount on a small volume device

2022-11-14 Thread Yuwei Guan
holds the sbi->readdir_ra state in f2fs_fill_dentries() Yuwei Guan (3): f2fs: fix to alloc_mode changed after remount on a small volume device f2fs: cleanup for 'f2fs_tuning_parameters' function f2fs: change type for 'sbi->readdir_ra' fs/f2fs/dir.c | 2 +- fs/f2fs/f2fs.h | 2

[f2fs-dev] [PATCH v2 2/3] f2fs: cleanup for 'f2fs_tuning_parameters' function

2022-11-14 Thread Yuwei Guan
A cleanup patch for 'f2fs_tuning_parameters' function. Signed-off-by: Yuwei Guan --- fs/f2fs/super.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 17b9e70b8f32..3e974c003b77 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c

[f2fs-dev] [PATCH v2 3/3] f2fs: change type for 'sbi->readdir_ra'

2022-11-14 Thread Yuwei Guan
Before this patch, the varibale 'readdir_ra' takes effect if it's equal to '1' or not, so we can change type for it from 'int' to 'bool'. Signed-off-by: Yuwei Guan --- fs/f2fs/dir.c | 2 +- fs/f2fs/f2fs.h | 2 +- fs/f2fs/super.c | 2 +- fs/f2fs/sysfs.c | 5 + 4 files changed, 8

[f2fs-dev] [PATCH v2 1/3] f2fs: fix to alloc_mode changed after remount on a small volume device

2022-11-14 Thread Yuwei Guan
anged when do remount for a small volume device. Signed-off-by: Yuwei Guan --- fs/f2fs/super.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 3834ead04620..17b9e70b8f32 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -2043,