mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Manfred Spraul <manfred@colorfullife.com>
Cc: Oleg <graycardinal@pisem.net>,
	linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>
Subject: Re: PROBLEM: kmem_cache_create: duplicate cache fat_cache
Date: Tue, 07 Jun 2005 23:26:47 +0900	[thread overview]
Message-ID: <87d5qyjl94.fsf@devron.myhome.or.jp> (raw)
In-Reply-To: <42A4A77A.5060101@colorfullife.com> (Manfred Spraul's message of "Mon, 06 Jun 2005 21:43:54 +0200")

Manfred Spraul <manfred@colorfullife.com> writes:

> OGAWA Hirofumi wrote:
>
>>Ummm... why is this normal situation? Didn't you run the
>>modules_install after changed .config?  Anyway, this patch returns
>>NULL instead of calling BUG().  This case seems to also happen with
>>user error.
>>
> Either return NULL or ignore the collision. I don't know what's the
> better solution.
>
> I'm open to either approach - it depends on what the
> kmem_cache_create() caller expects.

> --- 2.6/mm/slab.c	2005-06-05 17:29:01.000000000 +0200
> +++ build-2.6/mm/slab.c	2005-06-06 21:34:38.000000000 +0200
> @@ -1480,9 +1480,14 @@
>  			} 	
>  			if (!strcmp(pc->name,name)) { 
>  				printk("kmem_cache_create: duplicate cache %s\n",name); 
> -				up(&cache_chain_sem); 
> -				unlock_cpu_hotplug();
> -				BUG(); 
> +				/* This is a severe bug, because it breaks
> +				 * tuning by writing to /proc/slabinfo.
> +				 * But everything else works, and since
> +				 * duplicate caches typically happen if
> +				 * someone inserts a module twice, we'll
> +				 * continue.
> +				 */
> +				WARN_ON(1); 
>  			}	
>  		}
>  		set_fs(old_fs);

Ah, I see. I think this is friendly to developers and probably more
proper than my patch for this problem.

Thanks.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

      reply	other threads:[~2005-06-07 14:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-18  8:17 Oleg
2005-05-19 18:10 ` OGAWA Hirofumi
2005-05-20 14:31   ` Re[2]: " Oleg
2005-05-20 13:16     ` OGAWA Hirofumi
2005-06-06 19:43   ` Manfred Spraul
2005-06-07 14:26     ` OGAWA Hirofumi [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=87d5qyjl94.fsf@devron.myhome.or.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=akpm@osdl.org \
    --cc=graycardinal@pisem.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.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

Powered by JetHome