2007-09-26 13:30:20

by Pavel Emelyanov

[permalink] [raw]
Subject: [PATCH] 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.

Signed-off-by: Pavel Emelyanov <[email protected]>

---

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;
}


2007-09-26 13:37:49

by Cédric Le Goater

[permalink] [raw]
Subject: Re: [PATCH] Use KMEM_CACHE macro to create the nsproxy cache

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 <[email protected]>

yes of course. thanks.

Acked-by: Cedric Le Goater <[email protected]>

> ---
>
> 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
> [email protected]
> https://lists.linux-foundation.org/mailman/listinfo/containers
>

2007-09-26 13:40:01

by Serge E. Hallyn

[permalink] [raw]
Subject: Re: [PATCH] Use KMEM_CACHE macro to create the nsproxy cache

Quoting Pavel Emelyanov ([email protected]):
> The blessed way for standard caches is to use it.
> Besides, this may give this cache a better alignment.
>
> Signed-off-by: Pavel Emelyanov <[email protected]>

Acked-by: Serge Hallyn <[email protected]>

> ---
>
> 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;
> }