OSDN Git Service

f2fs: set ioprio of GC kthread to idle
authorPark Ju Hyung <qkrwngud825@gmail.com>
Tue, 26 Sep 2017 01:51:24 +0000 (10:51 +0900)
committer0ranko0P <ranko0p@outlook.com>
Wed, 4 Dec 2019 13:46:37 +0000 (21:46 +0800)
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 <qkrwngud825@gmail.com>
fs/f2fs/gc.c

index bac6051..de1afaf 100644 (file)
@@ -145,6 +145,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;
 }