public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@digeo.com>
To: Manfred Spraul <manfred@colorfullife.com>
Cc: linux-kernel@vger.kernel.org, mbligh@aracnet.com
Subject: Re: [PATCH] patch-slab-split-08-reap
Date: Sat, 05 Oct 2002 17:16:42 -0700	[thread overview]
Message-ID: <3D9F80EA.2768688@digeo.com> (raw)
In-Reply-To: 3D9EBFA9.90806@colorfullife.com

Manfred Spraul wrote:
> 
>  int __init cpucache_init(void)
>  {
>         struct list_head* p;
> +       int i;
> 
>         down(&cache_chain_sem);
>         g_cpucache_up = FULL;
> 
> -       p = &cache_cache.next;
> -       do {
> +       list_for_each(p, &cache_chain) {
>                 kmem_cache_t* cachep = list_entry(p, kmem_cache_t, next);
>                 enable_cpucache(cachep);
>                 p = cachep->next.next;
> -       } while (p != &cache_cache.next);
> +       }

You're only visiting every second member in this list walk.
I added the below diff which gets me to a login prompt.  I need
to get another rollup out - I'll beat on the slab changes a bit
and include them if they look solid; otherwise I'll upload an
incremental diff for them.

--- 2.5.40/mm/slab.c~cpucache_init-fix	Sat Oct  5 17:06:28 2002
+++ 2.5.40-akpm/mm/slab.c	Sat Oct  5 17:06:28 2002
@@ -697,17 +697,14 @@ void __init kmem_cache_sizes_init(void)
 
 int __init cpucache_init(void)
 {
-	struct list_head* p;
+	kmem_cache_t *cachep;
 	int i;
 
 	down(&cache_chain_sem);
 	g_cpucache_up = FULL;
 
-	list_for_each(p, &cache_chain) {
-		kmem_cache_t* cachep = list_entry(p, kmem_cache_t, next);
+	list_for_each_entry(cachep, &cache_chain, next)
 		enable_cpucache(cachep);
-		p = cachep->next.next;
-	}
 	
 	/* 
 	 * Register the timers that return unneeded

.

      reply	other threads:[~2002-10-06  0:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-05 10:32 [PATCH] patch-slab-split-08-reap Manfred Spraul
2002-10-06  0:16 ` Andrew Morton [this message]

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=3D9F80EA.2768688@digeo.com \
    --to=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.com \
    --cc=mbligh@aracnet.com \
    /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