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

Commit ff4b5eb8 authored by Chao Yu's avatar Chao Yu Committed by Sahitya Tummala
Browse files

f2fs: fix out-of-order execution in f2fs_issue_flush



commit 6f890df0a7efe3181aceb5d8bcd4af7deb2abce5 upstream.

In f2fs_issue_flush, due to out-of-order execution of CPU, wake_up can
be called before we insert issue_list, result in long latency of
wait_for_completion. Fix this by adding smp_mb() to force the order of
related codes.

Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
Git-commit: 6ed7ad60
Git-repo: https://android.googlesource.com/kernel/common.git


Signed-off-by: default avatarSahitya Tummala <stummala@codeaurora.org>
parent 2204c737
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -549,7 +549,10 @@ int f2fs_issue_flush(struct f2fs_sb_info *sbi)
	atomic_inc(&fcc->issing_flush);
	llist_add(&cmd.llnode, &fcc->issue_list);

	if (!fcc->dispatch_list)
	/* update issue_list before we wake up issue_flush thread */
	smp_mb();

	if (waitqueue_active(&fcc->flush_wait_queue))
		wake_up(&fcc->flush_wait_queue);

	if (fcc->f2fs_issue_flush) {