From: linux@horizon.com
To: linux-kernel@vger.kernel.org
Subject: Re: [RFC] Simple Slab: A slab allocator with minimal meta information
Date: 13 Aug 2006 21:10:56 -0400 [thread overview]
Message-ID: <20060814011056.2381.qmail@science.horizon.com> (raw)
Um, with all this discussion of keeping caches hot, people do remember
that FIFO handling of free blocks *greatly* reduces fragmentation, right?
That's an observation from malloc implementations that support merging
of any two adjacent blocks, but at least some of it should apply to slab
pages that require multple adjacent free objects to be returned to the
free-page pool.
With steady-state allocations and a LIFO free list, your "hot" end
of the list is never free long enough to be combined, and the "cold"
end, which shared pages with long-lived objects that have no hope of
ever being freed, is rarely used and just wastes memory.
Managing the free list FIFO gives every chunk an equal opportunity to
have its neighbor chunks freed.
The first idea that comes to mind for adapting this to a slab cache is
to put the cache pages on a free list. Whenever a chunk is freed on
a page, that page is moved to the "recent" end. Objects are allocated
from the page at the "old" end until it is full, then the next-oldest
page taken, and so on.
Completely free pages are either returned to the system, or put on a
lowest-priority list that is only used when the other pages are all
full.
Especially in a memory-constrained embedded environment, I'd think
space-efficiency would be at least as important as time.
next reply other threads:[~2006-08-14 1:11 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-14 1:10 linux [this message]
2006-08-14 11:47 ` Andi Kleen
-- strict thread matches above, loose matches on Subject: below --
2006-08-10 0:52 Christoph Lameter
2006-08-10 2:07 ` Matt Mackall
2006-08-10 5:01 ` KAMEZAWA Hiroyuki
2006-08-10 5:13 ` Christoph Lameter
2006-08-10 5:44 ` KAMEZAWA Hiroyuki
2006-08-10 5:44 ` Christoph Lameter
2006-08-10 5:56 ` KAMEZAWA Hiroyuki
2006-08-10 6:13 ` KAMEZAWA Hiroyuki
2006-08-10 15:25 ` Christoph Lameter
2006-08-10 18:47 ` Manfred Spraul
2006-08-10 18:52 ` Christoph Lameter
2006-08-11 17:21 ` Christoph Lameter
2006-08-11 20:33 ` Manfred Spraul
2006-08-11 21: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=20060814011056.2381.qmail@science.horizon.com \
--to=linux@horizon.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
all inboxes | Powered by JetHome®