From: Andrew Morton <akpm@osdl.org>
To: "Pekka Enberg" <penberg@cs.helsinki.fi>
Cc: linux-kernel@vger.kernel.org, manfred@colorfullife.com
Subject: Re: [patch 04/10] slab: cache_estimate cleanup
Date: Sun, 15 Jan 2006 18:38:22 -0800 [thread overview]
Message-ID: <20060115183822.38b1e807.akpm@osdl.org> (raw)
In-Reply-To: <20060114122415.163755000@localhost>
"Pekka Enberg" <penberg@cs.helsinki.fi> wrote:
>
> From: Steven Rostedt <rostedt@goodmis.org>
>
> This patch cleans up cache_estimate() in mm/slab.c and improves the
> algorithm from O(n) to O(1). We first calculate the maximum number of
> objects a slab can hold after struct slab and kmem_bufctl_t for each
> object has been given enough space. After that, to respect alignment
> rules, we decrease the number of objects if necessary. As required
> padding is at most align-1 and memory of obj_size is at least align,
> it is always enough to decrease number of objects by one.
>
> The optimization was originally made by Balbir Singh with more
> improvements from Steven Rostedt. Manfred Spraul provider further
> modifications: no loop at all for the off-slab case and added comments
> to explain the background.
>
> ...
> - size_t wastage = PAGE_SIZE << gfporder;
> - size_t extra = 0;
> - size_t base = 0;
> ...
> + size_t mgmt_size;
> + size_t slab_size = PAGE_SIZE << gfporder;
Can anyone think of a reason for using size_t in there instead of plain old
unsigned int?
next prev parent reply other threads:[~2006-01-16 2:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-14 12:46 [patch 00/10] slab updates Pekka Enberg
2006-01-14 12:46 ` [patch 01/10] slab: distinguish between object and buffer size Pekka Enberg
2006-01-14 12:46 ` [patch 02/10] slab: minor cleanup to kmem_cache_alloc_node Pekka Enberg
2006-01-14 12:46 ` [patch 05/10] slab: extract slab_destroy_objs() Pekka Enberg
2006-01-18 18:31 ` Christoph Lameter
2006-01-19 9:07 ` Pekka J Enberg
2006-01-20 5:18 ` Horst von Brand
2006-01-14 12:46 ` [patch 04/10] slab: cache_estimate cleanup Pekka Enberg
2006-01-16 2:38 ` Andrew Morton [this message]
2006-01-16 7:00 ` Pekka J Enberg
2006-01-14 12:46 ` [patch 06/10] slab: extract slab_{put|get}_obj Pekka Enberg
2006-01-14 12:46 ` [patch 03/10] slab: have index_of bug at compile time Pekka Enberg
2006-01-14 12:46 ` [patch 07/10] slab: reduce inlining Pekka Enberg
2006-01-14 12:46 ` [patch 08/10] slab: extract virt_to_{cache|slab} Pekka Enberg
2006-01-14 12:46 ` [patch 10/10] slab: replace kmem_cache_t with struct kmem_cache Pekka Enberg
2006-01-14 12:46 ` [patch 09/10] slab: rename ac_data to cpu_cache_get Pekka Enberg
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=20060115183822.38b1e807.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manfred@colorfullife.com \
--cc=penberg@cs.helsinki.fi \
/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®