Skip to contentSkip to conversation

Use KMEM_CACHE macro to create the nsproxy cache

PATCH In review Pavel Emelyanov 3 participants 3 messages Sep 26, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use KMEM_CACHE macro to create the nsproxy cache

The blessed way for standard caches is to use it. Besides, this may give this cache a better alignment.

---

kernel/nsproxy.c +1 -2
index ee68964..31351cc 100644
@@ -222,8 +222,7 @@ void exit_task_namespaces(struct task_st
 
 static int __init nsproxy_cache_init(void)
 {
-	nsproxy_cachep = kmem_cache_create("nsproxy", sizeof(struct nsproxy),
-					   0, SLAB_PANIC, NULL);
+	nsproxy_cachep = KMEM_CACHE(nsproxy, SLAB_PANIC);
 	return 0;
 }
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Pavel Emelyanov

The blessed way for standard caches is to use it. Besides, this may give this cache a better alignment.

yes of course. thanks.

Quoted 21 lines

---

kernel/nsproxy.c +1 -2
index ee68964..31351cc 100644
@@ -222,8 +222,7 @@ void exit_task_namespaces(struct task_st
 
 static int __init nsproxy_cache_init(void)
 {
-	nsproxy_cachep = kmem_cache_create("nsproxy", sizeof(struct nsproxy),
-					   0, SLAB_PANIC, NULL);
+	nsproxy_cachep = KMEM_CACHE(nsproxy, SLAB_PANIC);
 	return 0;
 }
 

_______________________________________________
Containers mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/containers

Acked-by on v1 1/1
#2 lore raw
In reply to Pavel Emelyanov
Quoted 4 lines · Pavel Emelyanov

The blessed way for standard caches is to use it. Besides, this may give this cache a better alignment.

Quoted 15 lines

---

kernel/nsproxy.c +1 -2
index ee68964..31351cc 100644
@@ -222,8 +222,7 @@ void exit_task_namespaces(struct task_st
 
 static int __init nsproxy_cache_init(void)
 {
-	nsproxy_cachep = kmem_cache_create("nsproxy", sizeof(struct nsproxy),
-					   0, SLAB_PANIC, NULL);
+	nsproxy_cachep = KMEM_CACHE(nsproxy, SLAB_PANIC);
 	return 0;
 }