LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Pekka Enberg" <penberg@cs.helsinki.fi>
To: "Bin Chen" <binary.chen@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: kmem_cache_create loop for find the proper gfporder
Date: Sun, 25 Mar 2007 17:30:04 +0200	[thread overview]
Message-ID: <84144f020703250830k5fb3e2eo6145a88cbe5a859d@mail.gmail.com> (raw)
In-Reply-To: <5800c1cc0703241649q27157d9aid3d9d51b52efbf65@mail.gmail.com>

On 3/25/07, Bin Chen <binary.chen@gmail.com> wrote:
> It is done by increase gfporder for low number to high(possibly 0 to
> MAX_GFP_ORDER). But why increase the gfporder(or slab size) can
> decrease the internal fragmentation?)
>
> A simple example, suppose the slab management stuff is kept off-slab,
> if the gfporder is zero, and the object size in slab is 1000, the
> wasted space is 4096 mod 1000 = 96, but with 4096 * 2(increase
> gfporder by 1), the space is 8192 mod 1000 = 192, 192 > 96.

You didn't simulate the algorithm long enough. If you had, you'd hit
order five which wastes only 72 bytes in your example.

                                 Pekka

      reply	other threads:[~2007-03-25 15:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-24 23:49 kmem_cache_create loop for find the proper gfporder Bin Chen
2007-03-25 15:30 ` Pekka Enberg [this message]

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=84144f020703250830k5fb3e2eo6145a88cbe5a859d@mail.gmail.com \
    --to=penberg@cs.helsinki.fi \
    --cc=binary.chen@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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).