diff mbox series

KVM: x86/mmu: Use KMEM_CACHE instead of kmem_cache_create()

Message ID 20240116100025.95702-1-chentao@kylinos.cn (mailing list archive)
State New, archived
Headers show
Series KVM: x86/mmu: Use KMEM_CACHE instead of kmem_cache_create() | expand

Commit Message

Kunwu Jan. 16, 2024, 10 a.m. UTC
Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
to simplify the creation of SLAB caches.

Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
---
 arch/x86/kvm/mmu/mmu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Sean Christopherson Feb. 3, 2024, 12:11 a.m. UTC | #1
On Tue, 16 Jan 2024 18:00:25 +0800, Kunwu Chan wrote:
> Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
> to simplify the creation of SLAB caches.
> 
> 

Applied to kvm-x86 mmu, with a slightly expanded changelog.  Thanks!

[1/1] KVM: x86/mmu: Use KMEM_CACHE instead of kmem_cache_create()
      https://github.com/kvm-x86/linux/commit/0dbd05469966

--
https://github.com/kvm-x86/linux/tree/next
diff mbox series

Patch

diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
index d59e3ba5d646..5f0d8148cf6e 100644
--- a/arch/x86/kvm/mmu/mmu.c
+++ b/arch/x86/kvm/mmu/mmu.c
@@ -6997,9 +6997,7 @@  int kvm_mmu_vendor_module_init(void)
 
 	kvm_mmu_reset_all_pte_masks();
 
-	pte_list_desc_cache = kmem_cache_create("pte_list_desc",
-					    sizeof(struct pte_list_desc),
-					    0, SLAB_ACCOUNT, NULL);
+	pte_list_desc_cache = KMEM_CACHE(pte_list_desc, SLAB_ACCOUNT);
 	if (!pte_list_desc_cache)
 		goto out;