lkml.org 
[lkml]   [2005]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] micro optimization of cache_estimate in slab.c
> Index: linux-2.6.15-rc5/mm/slab.c
> ===================================================================
> --- linux-2.6.15-rc5.orig/mm/slab.c 2005-12-16 16:24:09.000000000 -0500
> +++ linux-2.6.15-rc5/mm/slab.c 2005-12-18 13:30:13.000000000 -0500
> @@ -708,7 +708,14 @@
> base = sizeof(struct slab);
> extra = sizeof(kmem_bufctl_t);
> }
> - i = 0;
> + /*
> + * Divide the amount we have, by the amount we need for
> + * each object. Since the size is already calculated
> + * to be no less than the alignment, this result will
> + * not be any greater than 1 that we need, and this will
> + * be subtracted after the while loop.
> + */
> + i = (wastage - base)/(size + extra);
> while (i*size + ALIGN(base+i*extra, align) <= wastage)
> i++;
> if (i > 0)


Yes, I recognised the patch because I passed Balbirs version over to
Micheal Cohen in early 2002. The patch originaly was intended for 2.4

Complexity of Stevens patch has gone, readability has improved, Steven
has taken advantage of context-code and the rationale has been
explained in the comment.

Sounds fine to me.

Luuk van der Duim

Partners aan het Werk
-
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: 2005-12-18 20:32    [W:0.478 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site