[PATCH] Use KMEM_CACHE macro to create the nsproxy cache - Kernel

This is a discussion on [PATCH] Use KMEM_CACHE macro to create the nsproxy cache - Kernel ; The blessed way for standard caches is to use it. Besides, this may give this cache a better alignment. Signed-off-by: Pavel Emelyanov --- 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 ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: [PATCH] Use KMEM_CACHE macro to create the nsproxy cache

  1. [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

    ---

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

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. Re: [PATCH] Use KMEM_CACHE macro to create the nsproxy cache

    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


    Acked-by: Serge Hallyn

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

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread