mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Luuk van der Duim <luukvanderduim@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>,
	LKML <linux-kernel@vger.kernel.org>,
	Manfred Spraul <manfred@colorfullife.com>,
	Andrew Morton <akpm@osdl.org>,
	balbir.singh@wipro.com
Subject: Re: [PATCH] micro optimization of cache_estimate in slab.c
Date: Sun, 18 Dec 2005 20:29:31 +0100	[thread overview]
Message-ID: <28cc27130512181129q77fcccfcq@mail.gmail.com> (raw)
In-Reply-To: <1134931062.13138.214.camel@localhost.localdomain>

> 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

  reply	other threads:[~2005-12-18 19:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-18  8:23 Steven Rostedt
2005-12-18 17:27 ` Pekka Enberg
2005-12-18 18:37   ` Steven Rostedt
2005-12-18 19:29     ` Luuk van der Duim [this message]
2005-12-19  7:43     ` Pekka J 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=28cc27130512181129q77fcccfcq@mail.gmail.com \
    --to=luukvanderduim@gmail.com \
    --cc=akpm@osdl.org \
    --cc=balbir.singh@wipro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.com \
    --cc=penberg@cs.helsinki.fi \
    --cc=rostedt@goodmis.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

Powered by JetHome