aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorPark Ju Hyung <qkrwngud825@gmail.com>2017-09-26 23:26:53 +0900
committerMoyster <oysterized@gmail.com>2018-05-23 19:11:36 +0200
commitecefab5e7ad00c4d3b49ac9deec5f31235f7343f (patch)
tree7638da009f62ab0558d6a3b313dc20119e4cdf05 /fs
parent014cdba8459b8031348d03e0924ecd1c1fd7b873 (diff)
f2fs: queue rapid GC on system_power_efficient_wq
Handle this asynchronously to avoid wake-up delay. Use system_power_efficient_wq since this is not CPU intensive. Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/gc.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index e54e4830d..b47355f6b 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -261,6 +261,22 @@ void f2fs_sbi_list_del(struct f2fs_sb_info *sbi)
mutex_unlock(&f2fs_sbi_mutex);
}
+static struct work_struct f2fs_gc_fb_worker;
+static void f2fs_gc_fb_work(struct work_struct *work)
+{
+ if (screen_on) {
+ stop_all_gc_threads();
+ } else {
+ /*
+ * Start all GC threads exclusively from here
+ * since the phone screen would turn on when
+ * a charger is connected
+ */
+ if (TRIGGER_SOFF)
+ start_all_gc_threads();
+ }
+}
+
static int fb_notifier_callback(struct notifier_block *self,
unsigned long event, void *data)
{
@@ -273,17 +289,11 @@ static int fb_notifier_callback(struct notifier_block *self,
switch (*blank) {
case FB_BLANK_POWERDOWN:
screen_on = false;
- /*
- * Start all GC threads exclusively from here
- * since the phone screen would turn on when
- * a charger is connected
- */
- if (TRIGGER_SOFF)
- start_all_gc_threads();
+ queue_work(system_power_efficient_wq, &f2fs_gc_fb_worker);
break;
case FB_BLANK_UNBLANK:
screen_on = true;
- stop_all_gc_threads();
+ queue_work(system_power_efficient_wq, &f2fs_gc_fb_worker);
break;
}
}
@@ -297,6 +307,7 @@ static struct notifier_block fb_notifier_block = {
static int __init f2fs_gc_register_fb(void)
{
+ INIT_WORK(&f2fs_gc_fb_worker, f2fs_gc_fb_work);
fb_register_client(&fb_notifier_block);
return 0;