Skip to content

Commit

Permalink
f2fs: Demote GC thread to idle scheduler class
Browse files Browse the repository at this point in the history
We don't want the background GC work causing UI jitter should it ever
collide with periods of user activity.

Signed-off-by: Danny Lin <[email protected]>
  • Loading branch information
kdrag0n committed Dec 4, 2020
1 parent 5e4d6c5 commit 2e575be
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/f2fs/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <linux/delay.h>
#include <linux/freezer.h>
#include <linux/sched/signal.h>
#include <uapi/linux/sched/types.h>

#include "f2fs.h"
#include "node.h"
Expand Down Expand Up @@ -124,6 +125,7 @@ static int gc_thread_func(void *data)

int f2fs_start_gc_thread(struct f2fs_sb_info *sbi)
{
const struct sched_param param = { .sched_priority = 0 };
struct f2fs_gc_kthread *gc_th;
dev_t dev = sbi->sb->s_bdev->bd_dev;
int err = 0;
Expand All @@ -150,6 +152,7 @@ int f2fs_start_gc_thread(struct f2fs_sb_info *sbi)
kvfree(gc_th);
sbi->gc_thread = NULL;
}
sched_setscheduler(sbi->gc_thread->f2fs_gc_task, SCHED_IDLE, &param);
set_task_ioprio(sbi->gc_thread->f2fs_gc_task,
IOPRIO_PRIO_VALUE(IOPRIO_CLASS_IDLE, 0));
out:
Expand Down

0 comments on commit 2e575be

Please sign in to comment.