[PATCH] KVM: SVM: move kfree() out of critical zone protected by spin_lock_irqsave

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Li RongQing <lirongqing@xxxxxxxxx>

Although kfree is a non-sleep function, it is possible to enter a long
chain of calls probabilistically, so it looks better to move kfree out
of the critical zone.

Signed-off-by: xuwenjie <xuwenjie04@xxxxxxxxx>
Signed-off-by: Li RongQing <lirongqing@xxxxxxxxx>
---
 arch/x86/kvm/svm/avic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kvm/svm/avic.c b/arch/x86/kvm/svm/avic.c
index 65fd245..2520247 100644
--- a/arch/x86/kvm/svm/avic.c
+++ b/arch/x86/kvm/svm/avic.c
@@ -783,8 +783,9 @@ static void svm_ir_list_del(struct vcpu_svm *svm, struct amd_iommu_pi_data *pi)
 		if (cur->data != pi->ir_data)
 			continue;
 		list_del(&cur->node);
+		spin_unlock_irqrestore(&svm->ir_list_lock, flags);
 		kfree(cur);
-		break;
+		return;
 	}
 	spin_unlock_irqrestore(&svm->ir_list_lock, flags);
 }
-- 
2.9.4





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux