Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 34e159da authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim
Browse files

f2fs: delay awaking discard thread



It's better to delay awaking discard thread while queuing discard commands
in checkpoint, it will help to give more chances for merging big and small
discard.

Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 66a82d1f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -968,7 +968,6 @@ static int __queue_discard_cmd(struct f2fs_sb_info *sbi,
		blkstart -= FDEV(devi).start_blk;
	}
	__update_discard_tree_range(sbi, bdev, lblkstart, blkstart, blklen);
	wake_up(&SM_I(sbi)->dcc_info->discard_wait_queue);
	return 0;
}

@@ -1335,6 +1334,8 @@ void clear_prefree_segments(struct f2fs_sb_info *sbi, struct cp_control *cpc)
		SM_I(sbi)->dcc_info->nr_discards -= total_len;
		kmem_cache_free(discard_entry_slab, entry);
	}

	wake_up(&SM_I(sbi)->dcc_info->discard_wait_queue);
}

static int create_discard_cmd_control(struct f2fs_sb_info *sbi)