lkml.org 
[lkml]   [2006]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 04/10] slab: cache_estimate cleanup
"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?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-01-16 03:42    [from the cache]
©2003-2011 Jasper Spaans