Skip to content

Commit

Permalink
f2fs: set ioprio of GC kthread to idle
Browse files Browse the repository at this point in the history
GC should run conservatively as possible to reduce latency spikes to the user.

Setting ioprio to idle class will allow the kernel to schedule GC thread's I/O
to not affect any other processes' I/O requests.

Signed-off-by: Park Ju Hyung <[email protected]>
Signed-off-by: Danny Lin <[email protected]>
  • Loading branch information
arter97 authored and kdrag0n committed Dec 4, 2020
1 parent 7f1cbe7 commit 5e4d6c5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/f2fs/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ int f2fs_start_gc_thread(struct f2fs_sb_info *sbi)
kvfree(gc_th);
sbi->gc_thread = NULL;
}
set_task_ioprio(sbi->gc_thread->f2fs_gc_task,
IOPRIO_PRIO_VALUE(IOPRIO_CLASS_IDLE, 0));
out:
return err;
}
Expand Down

0 comments on commit 5e4d6c5

Please sign in to comment.