OpenVZ Forum


Home » Mailing lists » Devel » [PATCH] Use KMEM_CACHE macro to create the nsproxy cache
[PATCH] Use KMEM_CACHE macro to create the nsproxy cache [message #20810] Wed, 26 September 2007 13:22 Go to next message
Pavel Emelianov is currently offline  Pavel Emelianov
Messages: 1149
Registered: September 2006
Senior Member
The blessed way for standard caches is to use it.
Besides, this may give this cache a better alignment.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---

diff --git a/kernel/nsproxy.c b/kernel/nsproxy.c
index ee68964..31351cc 100644
--- a/kernel/nsproxy.c
+++ b/kernel/nsproxy.c
@@ -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
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Re: [PATCH] Use KMEM_CACHE macro to create the nsproxy cache [message #20816 is a reply to message #20810] Wed, 26 September 2007 13:37 Go to previous messageGo to next message
Cedric Le Goater is currently offline  Cedric Le Goater
Messages: 443
Registered: February 2006
Senior Member
Pavel Emelyanov wrote:
> The blessed way for standard caches is to use it.
> Besides, this may give this cache a better alignment.
> 
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

yes of course. thanks. 

Acked-by: Cedric Le Goater <clg@fr.ibm.com>

> ---
> 
> diff --git a/kernel/nsproxy.c b/kernel/nsproxy.c
> index ee68964..31351cc 100644
> --- a/kernel/nsproxy.c
> +++ b/kernel/nsproxy.c
> @@ -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
> Containers@lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/containers
> 

_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Re: [PATCH] Use KMEM_CACHE macro to create the nsproxy cache [message #20817 is a reply to message #20810] Wed, 26 September 2007 13:39 Go to previous message
serue is currently offline  serue
Messages: 750
Registered: February 2006
Senior Member
Quoting Pavel Emelyanov (xemul@openvz.org):
> The blessed way for standard caches is to use it.
> Besides, this may give this cache a better alignment.
> 
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

Acked-by: Serge Hallyn <serue@us.ibm.com>

> ---
> 
> diff --git a/kernel/nsproxy.c b/kernel/nsproxy.c
> index ee68964..31351cc 100644
> --- a/kernel/nsproxy.c
> +++ b/kernel/nsproxy.c
> @@ -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
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Previous Topic: [PATCH] Remove unused member from nsproxy
Next Topic: Playing with namespaces and bloat-o-meeter
Goto Forum:
  


Current Time: Mon Jul 15 14:43:35 GMT 2024

Total time taken to generate the page: 0.03899 seconds