Skip to contentSkip to conversation

KVM: x86/mmu: remove unnecessary flush_workqueue()

PATCH Applied [email protected] 3 participants 3 messages Apr 1, 2022 – Apr 5, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: x86/mmu: remove unnecessary flush_workqueue()

From: Lv Ruyi <[email protected]>

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

---
 arch/x86/kvm/mmu/tdp_mmu.c | 1 -
 1 file changed, 1 deletion(-)
arch/x86/kvm/mmu/tdp_mmu.c +0 -1
index a2f9a34a0168..b822677ee3da 100644
@@ -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));
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · On Fri, Apr 01, 2022, [email protected] wrote:

From: Lv Ruyi <[email protected]>

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

Good bot :-)

Quoted 10 lines
---
 arch/x86/kvm/mmu/tdp_mmu.c | 1 -
 1 file changed, 1 deletion(-)
arch/x86/kvm/mmu/tdp_mmu.c +0 -0
index a2f9a34a0168..b822677ee3da 100644

arch/x86/kvm/mmu/tdp_mmu.c void kvm_mmu_uninit_tdp_mmu(struct kvm *kvm) · line 54

Quoted 4 lines
arch/x86/kvm/mmu/tdp_mmu.c +0 -1
@@ -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,