linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Shentino <shentino@gmail.com>
To: Tim Bird <tim.bird@am.sony.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	Ezequiel Garcia <elezegarcia@gmail.com>,
	David Rientjes <rientjes@google.com>,
	Andi Kleen <andi@firstfloor.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"celinux-dev@lists.celinuxforum.org"
	<celinux-dev@lists.celinuxforum.org>
Subject: Re: [Q] Default SLAB allocator
Date: Wed, 17 Oct 2012 17:46:16 -0700	[thread overview]
Message-ID: <CAGDaZ_qQ6L38EVkwmSakWF4xGFcESY-cr_XbjwG1pELTr1XGQw@mail.gmail.com> (raw)
In-Reply-To: <507F160A.7090302@am.sony.com>

On Wed, Oct 17, 2012 at 1:33 PM, Tim Bird <tim.bird@am.sony.com> wrote:
> On 10/17/2012 12:20 PM, Shentino wrote:
>> Potentially stupid question
>>
>> But is SLAB the one where all objects per cache have a fixed size and
>> thus you don't have any bookkeeping overhead for the actual
>> allocations?
>>
>> I remember something about one of the allocation mechanisms being
>> designed for caches of fixed sized objects to minimize the need for
>> bookkeeping.
>
> I wouldn't say "don't have _any_ bookkeeping", but minimizing the
> bookkeeping is indeed part of the SLAB goals.
>
> However, that is for objects that are allocated at fixed size.
> kmalloc is (currently) a thin wrapper over the slab system,
> and it maps non-power-of-two allocations onto slabs that are
> power-of-two sized.

...yuck?

> So, for example a string that is 18 bytes long
> will be allocated out of a slab with 32-byte objects.  This
> is the wastage that we're talking about here.  "Overhead" may
> have been the wrong word on my part, as that may imply overhead
> in the actual slab mechanisms, rather than just slop in the
> data area.

Data slop (both for alignment as well as for making room for
per-allocation bookkeeping overhead as is often done with userspace
malloc arenas) is precisely what I was referring to here.

Thanks for the answers I was curious.

> As an aside...
>
> Is there a canonical glossary for memory-related terms?  What
> is the correct term for the difference between what is requested
> and what is actually returned by the allocator?  I've been
> calling it alternately "wastage" or "overhead", but maybe there's
> a more official term?
>
> I looked here: http://www.memorymanagement.org/glossary/
> but didn't find exactly what I was looking for.  The closest
> things I found were "internal fragmentation" and
> "padding", but those didn't seem to exactly describe
> the situation here.

Another stupid question.

Is it possible to have both SLAB for fixed sized objects and something
like SLOB or SLUB standing aside with a different pool for variable
sized allocations ala kmalloc?

My hunch is that handling the two cases with separate methods may get
the best of both worlds.  Or layering kmalloc through something that
gets huge blocks from slab and slices them up in ways more amenable to
avoiding power-of-2 slopping.

No memory geek, so my two cents.

>  -- Tim
>
> =============================
> Tim Bird
> Architecture Group Chair, CE Workgroup of the Linux Foundation
> Senior Staff Engineer, Sony Network Entertainment
> =============================

--
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:[~2012-10-18  0:46 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-11 14:19 [Q] Default SLAB allocator Ezequiel Garcia
2012-10-11 22:42 ` Andi Kleen
2012-10-11 22:59   ` David Rientjes
2012-10-11 23:10     ` Andi Kleen
2012-10-12 12:07       ` Ezequiel Garcia
2012-10-13  9:54         ` David Rientjes
2012-10-13 12:44           ` Ezequiel Garcia
2012-10-16  0:46             ` David Rientjes
2012-10-16 12:35               ` Ezequiel Garcia
2012-10-16 12:56                 ` Eric Dumazet
2012-10-16 18:07                   ` Tim Bird
2012-10-16 18:27                     ` Ezequiel Garcia
2012-10-16 18:44                       ` Tim Bird
2012-10-16 18:49                         ` Ezequiel Garcia
2012-10-16 19:16                       ` Eric Dumazet
2012-10-17 18:45                         ` Tim Bird
2012-10-17 19:13                           ` Eric Dumazet
2012-10-17 19:20                             ` Shentino
2012-10-17 20:33                               ` Tim Bird
2012-10-18  0:46                                 ` Shentino [this message]
2012-10-17 20:58                             ` Tim Bird
2012-10-17 21:05                               ` Ezequiel Garcia
2012-10-16 18:36                     ` Ezequiel Garcia
2012-10-16 18:54                       ` Christoph Lameter
2012-10-13  9:51       ` David Rientjes
2012-10-13 15:10         ` Eric Dumazet
2012-10-16  1:28           ` JoonSoo Kim
2012-10-16  7:23             ` Eric Dumazet
2012-10-19  0:03           ` JoonSoo Kim
2012-10-19  7:01             ` Eric Dumazet
2012-10-16  0:45         ` David Rientjes
2012-10-16 18:53           ` Christoph Lameter
2012-10-16 19:02 ` 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=CAGDaZ_qQ6L38EVkwmSakWF4xGFcESY-cr_XbjwG1pELTr1XGQw@mail.gmail.com \
    --to=shentino@gmail.com \
    --cc=andi@firstfloor.org \
    --cc=celinux-dev@lists.celinuxforum.org \
    --cc=elezegarcia@gmail.com \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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;
as well as URLs for NNTP newsgroup(s).