linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Pekka Enberg" <penberg@cs.helsinki.fi>
To: Nick Piggin <npiggin@suse.de>
Cc: Linux Memory Management List <linux-mm@kvack.org>,
	linux-acpi@vger.kernel.org, lenb@kernel.org
Subject: Re: [patch][rfc] acpi: do not use kmem caches
Date: Mon, 1 Dec 2008 13:18:33 +0200	[thread overview]
Message-ID: <84144f020812010318v205579ean57edecf7992ec7ef@mail.gmail.com> (raw)
In-Reply-To: <20081201083128.GB2529@wotan.suse.de>

Hi Nick,

On Mon, Dec 1, 2008 at 10:31 AM, Nick Piggin <npiggin@suse.de> wrote:
> What does everyone think about this patch?

Doesn't matter all that much for SLUB which already merges the ACPI
caches with the generic kmalloc caches. But for SLAB, it's an obvious
wil so:

Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>

> ACPI subsystem creates a handful of kmem caches that are not particularly
> appropriate. Most of them seem to be empty or nearly empty most of the time,
> and the others don't have too many objects. In this situation, kmem caches
> can actually have more overhead than they save.
>
> Just use ACPI's generic code for its acpi_cache_t type.
> ---
>  drivers/acpi/osl.c              |   85 ----------------------------------------
>  include/acpi/acmacros.h         |    2
>  include/acpi/platform/aclinux.h |    9 ----
>  3 files changed, 3 insertions(+), 93 deletions(-)
>
> Index: linux-2.6/include/acpi/acmacros.h
> ===================================================================
> --- linux-2.6.orig/include/acpi/acmacros.h
> +++ linux-2.6/include/acpi/acmacros.h
> @@ -670,7 +670,7 @@ struct acpi_integer_overlay {
>  #define ACPI_ALLOCATE_ZEROED(a)     acpi_ut_allocate_zeroed((acpi_size)(a), ACPI_MEM_PARAMETERS)
>  #endif
>  #ifndef ACPI_FREE
> -#define ACPI_FREE(a)                acpio_os_free(a)
> +#define ACPI_FREE(a)                acpi_os_free(a)
>  #endif
>  #define ACPI_MEM_TRACKING(a)
>
> Index: linux-2.6/include/acpi/platform/aclinux.h
> ===================================================================
> --- linux-2.6.orig/include/acpi/platform/aclinux.h
> +++ linux-2.6/include/acpi/platform/aclinux.h
> @@ -65,7 +65,6 @@
>  /* Host-dependent types and defines */
>
>  #define ACPI_MACHINE_WIDTH          BITS_PER_LONG
> -#define acpi_cache_t                        struct kmem_cache
>  #define acpi_spinlock                   spinlock_t *
>  #define ACPI_EXPORT_SYMBOL(symbol)  EXPORT_SYMBOL(symbol);
>  #define strtoul                     simple_strtoul
> @@ -73,6 +72,8 @@
>  /* Full namespace pathname length limit - arbitrary */
>  #define ACPI_PATHNAME_MAX              256
>
> +#define ACPI_USE_LOCAL_CACHE
> +
>  #else                          /* !__KERNEL__ */
>
>  #include <stdarg.h>
> @@ -128,12 +129,6 @@ static inline void *acpi_os_allocate_zer
>        return kzalloc(size, irqs_disabled()? GFP_ATOMIC : GFP_KERNEL);
>  }
>
> -static inline void *acpi_os_acquire_object(acpi_cache_t * cache)
> -{
> -       return kmem_cache_zalloc(cache,
> -                                irqs_disabled()? GFP_ATOMIC : GFP_KERNEL);
> -}
> -
>  #define ACPI_ALLOCATE(a)       acpi_os_allocate(a)
>  #define ACPI_ALLOCATE_ZEROED(a)        acpi_os_allocate_zeroed(a)
>  #define ACPI_FREE(a)           kfree(a)
> Index: linux-2.6/drivers/acpi/osl.c
> ===================================================================
> --- linux-2.6.orig/drivers/acpi/osl.c
> +++ linux-2.6/drivers/acpi/osl.c
> @@ -1212,91 +1212,6 @@ void acpi_os_release_lock(acpi_spinlock
>        spin_unlock_irqrestore(lockp, flags);
>  }
>
> -#ifndef ACPI_USE_LOCAL_CACHE
> -
> -/*******************************************************************************
> - *
> - * FUNCTION:    acpi_os_create_cache
> - *
> - * PARAMETERS:  name      - Ascii name for the cache
> - *              size      - Size of each cached object
> - *              depth     - Maximum depth of the cache (in objects) <ignored>
> - *              cache     - Where the new cache object is returned
> - *
> - * RETURN:      status
> - *
> - * DESCRIPTION: Create a cache object
> - *
> - ******************************************************************************/
> -
> -acpi_status
> -acpi_os_create_cache(char *name, u16 size, u16 depth, acpi_cache_t ** cache)
> -{
> -       *cache = kmem_cache_create(name, size, 0, 0, NULL);
> -       if (*cache == NULL)
> -               return AE_ERROR;
> -       else
> -               return AE_OK;
> -}
> -
> -/*******************************************************************************
> - *
> - * FUNCTION:    acpi_os_purge_cache
> - *
> - * PARAMETERS:  Cache           - Handle to cache object
> - *
> - * RETURN:      Status
> - *
> - * DESCRIPTION: Free all objects within the requested cache.
> - *
> - ******************************************************************************/
> -
> -acpi_status acpi_os_purge_cache(acpi_cache_t * cache)
> -{
> -       kmem_cache_shrink(cache);
> -       return (AE_OK);
> -}
> -
> -/*******************************************************************************
> - *
> - * FUNCTION:    acpi_os_delete_cache
> - *
> - * PARAMETERS:  Cache           - Handle to cache object
> - *
> - * RETURN:      Status
> - *
> - * DESCRIPTION: Free all objects within the requested cache and delete the
> - *              cache object.
> - *
> - ******************************************************************************/
> -
> -acpi_status acpi_os_delete_cache(acpi_cache_t * cache)
> -{
> -       kmem_cache_destroy(cache);
> -       return (AE_OK);
> -}
> -
> -/*******************************************************************************
> - *
> - * FUNCTION:    acpi_os_release_object
> - *
> - * PARAMETERS:  Cache       - Handle to cache object
> - *              Object      - The object to be released
> - *
> - * RETURN:      None
> - *
> - * DESCRIPTION: Release an object to the specified cache.  If cache is full,
> - *              the object is deleted.
> - *
> - ******************************************************************************/
> -
> -acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object)
> -{
> -       kmem_cache_free(cache, object);
> -       return (AE_OK);
> -}
> -#endif
> -
>  /**
>  *     acpi_dmi_dump - dump DMI slots needed for blacklist entry
>  *
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2008-12-01 11:18 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-01  8:31 Nick Piggin
2008-12-01 11:18 ` Pekka Enberg [this message]
2008-12-01 12:00   ` Nick Piggin
2008-12-01 13:12     ` Alexey Starikovskiy
2008-12-01 13:36       ` Nick Piggin
2008-12-01 14:14         ` Alexey Starikovskiy
2008-12-01 16:32           ` Nick Piggin
2008-12-01 17:18           ` Christoph Hellwig
2008-12-01 17:32             ` Alexey Starikovskiy
2008-12-01 13:37       ` Pekka Enberg
2008-12-01 14:02         ` Alexey Starikovskiy
2008-12-01 16:14           ` Nick Piggin
2008-12-01 16:45             ` Alexey Starikovskiy
2008-12-01 16:58               ` Nick Piggin
2008-12-01 17:20               ` Moore, Robert
2008-12-01 17:30                 ` Andi Kleen
2008-12-01 17:32                   ` Moore, Robert
2008-12-01 17:20               ` Christoph Hellwig
2008-12-01 17:49                 ` Alexey Starikovskiy
2008-12-01 17:53                 ` Len Brown
2008-12-01 18:10                   ` Nick Piggin
2008-12-31 22:04                     ` Len Brown
2009-01-05  4:14                       ` Nick Piggin
2009-01-05  5:43                         ` Skywing
2009-01-05  6:55                           ` Nick Piggin
2008-12-01 14:32         ` Christoph Lameter
2008-12-01 14:48           ` Alexey Starikovskiy
2008-12-01 16:20             ` Nick Piggin
2008-12-01 17:04               ` Alexey Starikovskiy
2008-12-01 17:12                 ` Nick Piggin
2008-12-01 17:25                   ` Pekka Enberg
2008-12-01 17:32                     ` Pekka Enberg
2008-12-01 17:36                       ` Alexey Starikovskiy
2008-12-01 17:48                         ` Pekka Enberg
2008-12-01 18:09                         ` Christoph Lameter
2008-12-01 17:43                   ` Alexey Starikovskiy
2008-12-01 17:31 ` Len Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84144f020812010318v205579ean57edecf7992ec7ef@mail.gmail.com \
    --to=penberg@cs.helsinki.fi \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=npiggin@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox