Skip to content

Commit 1db6a4e

Browse files
JuliaLawallmpe
authored andcommitted
KVM: PPC: replace call_rcu by kfree_rcu for simple kmem_cache_free callback
Since SLOB was removed and since commit 6c6c47b ("mm, slab: call kvfree_rcu_barrier() from kmem_cache_destroy()"), it is not necessary to use call_rcu when the callback only performs kmem_cache_free. Use kfree_rcu() directly. The changes were made using Coccinelle. Signed-off-by: Julia Lawall <[email protected]> Acked-by: Paul E. McKenney <[email protected]> Acked-by: Vlastimil Babka <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 8cf0b93 commit 1db6a4e

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

arch/powerpc/kvm/book3s_mmu_hpte.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,6 @@ void kvmppc_mmu_hpte_cache_map(struct kvm_vcpu *vcpu, struct hpte_cache *pte)
9292
spin_unlock(&vcpu3s->mmu_lock);
9393
}
9494

95-
static void free_pte_rcu(struct rcu_head *head)
96-
{
97-
struct hpte_cache *pte = container_of(head, struct hpte_cache, rcu_head);
98-
kmem_cache_free(hpte_cache, pte);
99-
}
100-
10195
static void invalidate_pte(struct kvm_vcpu *vcpu, struct hpte_cache *pte)
10296
{
10397
struct kvmppc_vcpu_book3s *vcpu3s = to_book3s(vcpu);
@@ -126,7 +120,7 @@ static void invalidate_pte(struct kvm_vcpu *vcpu, struct hpte_cache *pte)
126120

127121
spin_unlock(&vcpu3s->mmu_lock);
128122

129-
call_rcu(&pte->rcu_head, free_pte_rcu);
123+
kfree_rcu(pte, rcu_head);
130124
}
131125

132126
static void kvmppc_mmu_pte_flush_all(struct kvm_vcpu *vcpu)

0 commit comments

Comments
 (0)