diff mbox series

KVM: x86/mmu: remove unnecessary flush_workqueue()

Message ID 20220401083530.2407703-1-lv.ruyi@zte.com.cn (mailing list archive)
State New, archived
Headers show
Series KVM: x86/mmu: remove unnecessary flush_workqueue() | expand

Commit Message

CGEL April 1, 2022, 8:35 a.m. UTC
From: Lv Ruyi <lv.ruyi@zte.com.cn>

All work currently pending will be done first by calling destroy_workqueue,
so there is unnecessary to flush it explicitly.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
 arch/x86/kvm/mmu/tdp_mmu.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Sean Christopherson April 1, 2022, 1:59 p.m. UTC | #1
On Fri, Apr 01, 2022, cgel.zte@gmail.com wrote:
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
> 
> All work currently pending will be done first by calling destroy_workqueue,
> so there is unnecessary to flush it explicitly.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>

Good bot :-)

> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
> ---
>  arch/x86/kvm/mmu/tdp_mmu.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c
> index a2f9a34a0168..b822677ee3da 100644
> --- a/arch/x86/kvm/mmu/tdp_mmu.c
> +++ b/arch/x86/kvm/mmu/tdp_mmu.c
> @@ -51,7 +51,6 @@ void kvm_mmu_uninit_tdp_mmu(struct kvm *kvm)
>  	if (!kvm->arch.tdp_mmu_enabled)
>  		return;
>  
> -	flush_workqueue(kvm->arch.tdp_mmu_zap_wq);

Might be worth adding a comment calling out that this drains the queue.  Either way,

Reviewed-by: Sean Christopherson <seanjc@google.com>
Paolo Bonzini April 5, 2022, 12:12 p.m. UTC | #2
Queued, thanks.

Paolo
diff mbox series

Patch

diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c
index a2f9a34a0168..b822677ee3da 100644
--- a/arch/x86/kvm/mmu/tdp_mmu.c
+++ b/arch/x86/kvm/mmu/tdp_mmu.c
@@ -51,7 +51,6 @@  void kvm_mmu_uninit_tdp_mmu(struct kvm *kvm)
 	if (!kvm->arch.tdp_mmu_enabled)
 		return;
 
-	flush_workqueue(kvm->arch.tdp_mmu_zap_wq);
 	destroy_workqueue(kvm->arch.tdp_mmu_zap_wq);
 
 	WARN_ON(!list_empty(&kvm->arch.tdp_mmu_pages));