linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ezequiel Garcia <elezegarcia@gmail.com>
To: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>, Joonsoo Kim <js1304@gmail.com>,
	Glauber Costa <glommer@parallels.com>,
	linux-mm@kvack.org, David Rientjes <rientjes@google.com>,
	Tim Bird <tim.bird@am.sony.com>
Subject: Re: REN2 [07/13] Common constants for kmalloc boundaries
Date: Sat, 2 Feb 2013 15:00:11 -0300	[thread overview]
Message-ID: <CALF0-+VGnhL0B5nuqJUYCEzKRxzzxJAWzT2x1SumVRmVapdLRg@mail.gmail.com> (raw)
In-Reply-To: <0000013c25e260c8-aeaa555f-3466-4c01-8e81-9891429850b2-000000@email.amazonses.com>

Hi Christoph,

On Thu, Jan 10, 2013 at 4:14 PM, Christoph Lameter <cl@linux.com> wrote:
> Standardize the constants that describe the smallest and largest
> object kept in the kmalloc arrays for SLAB and SLUB.
>
> Differentiate between the maximum size for which a slab cache is used
> (KMALLOC_MAX_CACHE_SIZE) and the maximum allocatable size
> (KMALLOC_MAX_SIZE, KMALLOC_MAX_ORDER).
>
> Signed-off-by: Christoph Lameter <cl@linux.com>
>
> Index: linux/include/linux/slab.h
> ===================================================================
> --- linux.orig/include/linux/slab.h     2013-01-10 09:42:25.640301677 -0600
> +++ linux/include/linux/slab.h  2013-01-10 09:43:40.857456229 -0600
> @@ -163,7 +163,12 @@ struct kmem_cache {
>  #else /* CONFIG_SLOB */
>
>  /*
> - * The largest kmalloc size supported by the slab allocators is
> + * Kmalloc array related definitions
> + */
> +
> +#ifdef CONFIG_SLAB
> +/*
> + * The largest kmalloc size supported by the SLAB allocators is
>   * 32 megabyte (2^25) or the maximum allocatable page order if that is
>   * less than 32 MB.
>   *
> @@ -173,9 +178,24 @@ struct kmem_cache {
>   */
>  #define KMALLOC_SHIFT_HIGH     ((MAX_ORDER + PAGE_SHIFT - 1) <= 25 ? \
>                                 (MAX_ORDER + PAGE_SHIFT - 1) : 25)
> +#define KMALLOC_SHIFT_MAX      KMALLOC_SHIFT_HIGH
> +#define KMALLOC_SHIFT_LOW      5
> +#else
> +/*
> + * SLUB allocates up to order 2 pages directly and otherwise
> + * passes the request to the page allocator.
> + */
> +#define KMALLOC_SHIFT_HIGH     (PAGE_SHIFT + 1)
> +#define KMALLOC_SHIFT_MAX      (MAX_ORDER + PAGE_SHIFT)
> +#define KMALLOC_SHIFT_LOW      3
> +#endif
>

Why do we need to distinguish SLAB from SLUB here?

I mean: why do we need to maintain 32 bytes as the smallest kmalloc cache?

Thanks,

-- 
    Ezequiel

--
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:[~2013-02-02 18:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20130110190027.780479755@linux.com>
2013-01-10 19:00 ` REN2 [01/13] slab_common: Use proper formatting specs for unsigned size_t Christoph Lameter
2013-01-10 19:00 ` REN2 [02/13] Move kmalloc related function defs Christoph Lameter
2013-01-10 19:12 ` REN2 [05/13] slab: Common name for the per node structures Christoph Lameter
2013-01-10 19:12 ` REN2 [08/13] Common definition for the array of kmalloc caches Christoph Lameter
2013-01-10 19:12 ` REN2 [09/13] Common function to create the kmalloc array Christoph Lameter
2013-01-11  7:23   ` Joonsoo Kim
2013-01-14 14:46     ` Christoph Lameter
     [not found]     ` <alpine.DEB.2.02.1301140843010.27095@gentwo.org>
2013-01-14 19:50       ` Christoph Lameter
2013-01-10 19:14 ` REN2 [10/13] stat: Use size_t for sizes instead of unsigned Christoph Lameter
2013-01-10 19:14 ` REN2 [04/13] slab: Use common kmalloc_index/kmalloc_size functions Christoph Lameter
2013-01-10 19:14 ` REN2 [11/13] Common Kmalloc cache determination Christoph Lameter
2013-01-10 19:14 ` REN2 [03/13] Common kmalloc slab index determination Christoph Lameter
2013-01-10 19:14 ` REN2 [13/13] Common definition for kmem_cache_node Christoph Lameter
2013-01-10 19:14 ` REN2 [12/13] slab: Rename list3/l3 to node Christoph Lameter
2013-01-10 19:14 ` REN2 [07/13] Common constants for kmalloc boundaries Christoph Lameter
2013-02-02 18:00   ` Ezequiel Garcia [this message]
2013-02-04 19:36     ` Christoph Lameter
2013-01-10 19:14 ` REN2 [06/13] slab: rename nodelists to node Christoph Lameter

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=CALF0-+VGnhL0B5nuqJUYCEzKRxzzxJAWzT2x1SumVRmVapdLRg@mail.gmail.com \
    --to=elezegarcia@gmail.com \
    --cc=cl@linux.com \
    --cc=glommer@parallels.com \
    --cc=js1304@gmail.com \
    --cc=linux-mm@kvack.org \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    --cc=tim.bird@am.sony.com \
    /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