Commit 9b94b5a2 authored by Hongfu Li's avatar Hongfu Li Committed by Andrew Morton
Browse files

khugepaged: simplify the allocation of slab caches

Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
to simplify the creation of SLAB caches.

Link: https://lkml.kernel.org/r/20240618014517.25954-1-lihongfu@kylinos.cn


Signed-off-by: default avatarHongfu Li <lihongfu@kylinos.cn>
Acked-by: default avatarDavid Hildenbrand <david@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent aa1b9489
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -385,10 +385,7 @@ int hugepage_madvise(struct vm_area_struct *vma,

int __init khugepaged_init(void)
{
	mm_slot_cache = kmem_cache_create("khugepaged_mm_slot",
					  sizeof(struct khugepaged_mm_slot),
					  __alignof__(struct khugepaged_mm_slot),
					  0, NULL);
	mm_slot_cache = KMEM_CACHE(khugepaged_mm_slot, 0);
	if (!mm_slot_cache)
		return -ENOMEM;