f2fs: clear discard_wake earlier
PATCH 1/1 f2fs: clear discard_wake earlier
If SBI_NEED_FSCK is set, discard_wake will never be cleared. As a result, the condition of wait_event_interruptible_timeout() is always true, which gets discard thread run too frequently.
Signed-off-by Sheng Yong <[email protected]>
--- fs/f2fs/segment.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
fs/f2fs/segment.c +4 -3
@@ -1404,6 +1404,10 @@ static int issue_discard_thread(void *data)kthread_should_stop () ||freezing (current) || dcc->discard_wake, msecs_to_jiffies(wait_ms)); + +if (dcc->discard_wake) + dcc->discard_wake =0 ; +if (try_to_freeze ())continue ;if (f2fs_readonly (sbi->sb))
@@ -1415,9 +1419,6 @@ static int issue_discard_thread(void *data)continue ; } -if (dcc->discard_wake) - dcc->discard_wake =0 ; -if (sbi->gc_thread && sbi->gc_thread->gc_urgent)init_discard_policy (&dpolicy,DPOLICY_FORCE ,1 );
Signature · 6 lines
2.17.0 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Quoted 5 lines · Sheng Yong
If
SBI_NEED_FSCKis set,discard_wakewill never be cleared. As a result, the condition ofwait_event_interruptible_timeout()is always true, which gets discard thread run too frequently.Signed-off-by Sheng Yong <[email protected]>
Reviewed-by Chao Yu <[email protected]>
Thanks,
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot