aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHongfu Li <[email protected]>2024-06-18 09:45:17 +0800
committerAndrew Morton <[email protected]>2024-07-03 19:30:15 -0700
commit9b94b5a2f9a95d693cfa8db6e34dcb3f1cd91204 (patch)
tree87bcf062e669fb0a316dba6c022ff28f9f6d2643
parentaa1b94891cbf48296b4571bf4625c0a13bd5e3f5 (diff)
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/[email protected] Signed-off-by: Hongfu Li <[email protected]> Acked-by: David Hildenbrand <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
-rw-r--r--mm/khugepaged.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index 774a97e6e2da..f8d08b49420c 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -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;