linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Rik van Riel <riel@nl.linux.org>
To: Andi Kleen <ak@muc.de>
Cc: Jeff Garzik <jgarzik@pobox.com>, linux-mm@kvack.org
Subject: Re: simple slab alloc question
Date: Mon, 11 Oct 1999 20:11:38 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.10.9910112007250.26190-100000@imladris.dummy.home> (raw)
In-Reply-To: <19991011131021.A952@fred.muc.de>

On Mon, 11 Oct 1999, Andi Kleen wrote:
> On Mon, Oct 11, 1999 at 12:09:47AM +0200, Jeff Garzik wrote:
> > kmalloc seems to allocate against various kmem_cache sizes: 32,
> > 64...1024...65536...
> > 
> > Does this mean that allocations of various sizes are stored in different
> > "buckets"?  Would that not reduce fragmentation and the need for a zone
> > allocator?
> 
> kmalloc uses these buckets. Other clients use their own slab pool
> (e.g. skb headers etc.). This is a variant of a zone allocator,
> but only for relatively small objects.
> 
> Slab sits on top of the page allocator and is on its mercy.

Indeed.

> Even other major users get their pages from the page allocator
> directly (inodes, dcache). These used to be (still are?) a major
> source of fragmentation, because they tend to wire whole pages
> down even where there is only a single active inode/dentry on it.

A zone allocator would not help in this case. A zone
which has only one active inode/dentry on it is just
as wired down as a normal page.

What we need here is a trick to emergency-recycle the
last two(?) inodes on a page when memory is short. Of
course the real number should be calculated by memory
pressure, but I don't have time to think about that
now :)

> The page allocator uses the buddy algorithm, which is very prone
> to fragmentation.

> The basic idea is to replace the buddy with another zone allocator.

I hope to be working on a design for something like that from
december onwards. With a bit of luck the first code will be
ready just before we begin the 2.5 development cycle.

(doing things earlier doesn't make much sense and we're too
late for 2.4 anyway)

cheers,

Rik
--
The Internet is not a network of computers. It is a network
of people. That is its real strength.
--
work at:	http://www.reseau.nl/
home at:	http://www.nl.linux.org/~riel/

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://humbolt.geo.uu.nl/Linux-MM/

  reply	other threads:[~1999-10-11 18:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-10 22:09 Jeff Garzik
1999-10-11 11:10 ` Andi Kleen
1999-10-11 18:11   ` Rik van Riel [this message]
1999-10-11 22:19     ` Stephen C. Tweedie

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=Pine.LNX.4.10.9910112007250.26190-100000@imladris.dummy.home \
    --to=riel@nl.linux.org \
    --cc=ak@muc.de \
    --cc=jgarzik@pobox.com \
    --cc=linux-mm@kvack.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