* Collision of SLUB unique ID
@ 2008-06-04 14:46 Yoichi Yuasa
2008-06-09 14:10 ` Christoph Lameter
0 siblings, 1 reply; 6+ messages in thread
From: Yoichi Yuasa @ 2008-06-04 14:46 UTC (permalink / raw)
To: Christoph Lameter; +Cc: yoichi_yuasa, linux-mm
Hi,
I'm testing SLUB on Cobalt(MIPS machine).
I got the following error messages at the boot time.
The Cobalt's ARCH_KMALLOC_MINALIGN is 128.
At this time, kmalloc-192 unique ID has collided with kmalloc-256.
kobject_add_internal failed for :0000256 with -EEXIST, don't try to register things with the same name in the same directory.
Call Trace:
[<80086f34>] dump_stack+0x8/0x34
[<801d4dbc>] kobject_add_internal+0x20c/0x214
[<801d51cc>] kobject_init_and_add+0x40/0x58
[<800fdbfc>] sysfs_slab_add+0x148/0x204
[<803ac1b0>] slab_sysfs_init+0x80/0x158
[<803a46c4>] kernel_init+0xa4/0x2e4
[<800830dc>] kernel_thread_helper+0x10/0x18
Bad page state in process 'swapper'
page:81001d00 flags:0x00000400 mapping:00000000 mapcount:0 count:0
Trying to fix it up, but a reboot is needed
Backtrace:
Call Trace:
[<80086f34>] dump_stack+0x8/0x34
[<800dadc4>] bad_page+0x74/0xb4
[<800db874>] free_hot_cold_page+0x21c/0x22c
[<801d4aa8>] kobject_release+0x58/0xb4
[<801d5b38>] kref_put+0x68/0xac
[<800fdc0c>] sysfs_slab_add+0x158/0x204
[<803ac1b0>] slab_sysfs_init+0x80/0x158
[<803a46c4>] kernel_init+0xa4/0x2e4
[<800830dc>] kernel_thread_helper+0x10/0x18
SLUB: Unable to add boot slab kmalloc-192 to sysfs
Thanks,
Yoichi
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Collision of SLUB unique ID
2008-06-04 14:46 Collision of SLUB unique ID Yoichi Yuasa
@ 2008-06-09 14:10 ` Christoph Lameter
2008-06-10 1:06 ` Yoichi Yuasa
0 siblings, 1 reply; 6+ messages in thread
From: Christoph Lameter @ 2008-06-09 14:10 UTC (permalink / raw)
To: Yoichi Yuasa; +Cc: linux-mm, Pekka Enberg
On Wed, 4 Jun 2008, Yoichi Yuasa wrote:
> I'm testing SLUB on Cobalt(MIPS machine).
> I got the following error messages at the boot time.
>
> The Cobalt's ARCH_KMALLOC_MINALIGN is 128.
> At this time, kmalloc-192 unique ID has collided with kmalloc-256.
Hmmm... The system should alias the 192 byte cache to the 256 sized one.
What kernel version is this? We could have broken this in 2.6.25 with the
addtional flags that were added. But then it should be okay again for
2.6.26-rcX which removed those additional flags. If this is indeed the
case then we need a fix for stable and mainline is fine.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Collision of SLUB unique ID
2008-06-09 14:10 ` Christoph Lameter
@ 2008-06-10 1:06 ` Yoichi Yuasa
2008-06-10 1:22 ` Christoph Lameter
0 siblings, 1 reply; 6+ messages in thread
From: Yoichi Yuasa @ 2008-06-10 1:06 UTC (permalink / raw)
To: Christoph Lameter; +Cc: yoichi_yuasa, linux-mm, Pekka Enberg
On Mon, 9 Jun 2008 07:10:56 -0700 (PDT)
Christoph Lameter <clameter@sgi.com> wrote:
> On Wed, 4 Jun 2008, Yoichi Yuasa wrote:
>
> > I'm testing SLUB on Cobalt(MIPS machine).
> > I got the following error messages at the boot time.
> >
> > The Cobalt's ARCH_KMALLOC_MINALIGN is 128.
> > At this time, kmalloc-192 unique ID has collided with kmalloc-256.
>
> Hmmm... The system should alias the 192 byte cache to the 256 sized one.
>
> What kernel version is this? We could have broken this in 2.6.25 with the
> addtional flags that were added. But then it should be okay again for
> 2.6.26-rcX which removed those additional flags. If this is indeed the
> case then we need a fix for stable and mainline is fine.
2.6.24, 2.6.25.5 and 2.6.26-rc5.
I got same error on these version.
Yoichi
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Collision of SLUB unique ID
2008-06-10 1:06 ` Yoichi Yuasa
@ 2008-06-10 1:22 ` Christoph Lameter
2008-06-10 2:44 ` Yoichi Yuasa
0 siblings, 1 reply; 6+ messages in thread
From: Christoph Lameter @ 2008-06-10 1:22 UTC (permalink / raw)
To: Yoichi Yuasa; +Cc: linux-mm, Pekka Enberg
> I got same error on these version.
Duh.
Does this patch fix it?
Subject: slub: Do not use 192 byte sized cache if minimum alignment is 128 byte
The 192 byte cache is not necessary if we have a basic alignment of 128
byte. If it would be used then the 192 would be aligned and result in
another 256 byte cache which causes trouble for sysfs.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
---
mm/slub.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
Index: linux-2.6/mm/slub.c
===================================================================
--- linux-2.6.orig/mm/slub.c 2008-06-09 18:08:50.000000000 -0700
+++ linux-2.6/mm/slub.c 2008-06-09 18:17:26.000000000 -0700
@@ -2995,8 +2995,7 @@ void __init kmem_cache_init(void)
create_kmalloc_cache(&kmalloc_caches[1],
"kmalloc-96", 96, GFP_KERNEL);
caches++;
- }
- if (KMALLOC_MIN_SIZE <= 128) {
+
create_kmalloc_cache(&kmalloc_caches[2],
"kmalloc-192", 192, GFP_KERNEL);
caches++;
@@ -3026,6 +3025,16 @@ void __init kmem_cache_init(void)
for (i = 8; i < KMALLOC_MIN_SIZE; i += 8)
size_index[(i - 1) / 8] = KMALLOC_SHIFT_LOW;
+ if (KMALLOC_MIN_SIZE == 128) {
+ /*
+ * The 192 byte sized kmalloc cache is not properly
+ * aligned if the minimum alignment is 128 bytes.
+ * Use the 256 sized kmalloc cache instead.
+ */
+ for (i = 128; i < 192; i += 8)
+ size_index[(i - 1) / 8] = 8;
+ }
+
slab_state = UP;
/* Provide the correct kmalloc names now that the caches are up */
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Collision of SLUB unique ID
2008-06-10 1:22 ` Christoph Lameter
@ 2008-06-10 2:44 ` Yoichi Yuasa
2008-06-10 17:06 ` Christoph Lameter
0 siblings, 1 reply; 6+ messages in thread
From: Yoichi Yuasa @ 2008-06-10 2:44 UTC (permalink / raw)
To: Christoph Lameter; +Cc: yoichi_yuasa, linux-mm, Pekka Enberg
Hi,
On Mon, 9 Jun 2008 18:22:39 -0700 (PDT)
Christoph Lameter <clameter@sgi.com> wrote:
> > I got same error on these version.
>
> Duh.
>
> Does this patch fix it?
No, the kernel that applies it cannot boot.
Yoichi
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Collision of SLUB unique ID
2008-06-10 2:44 ` Yoichi Yuasa
@ 2008-06-10 17:06 ` Christoph Lameter
0 siblings, 0 replies; 6+ messages in thread
From: Christoph Lameter @ 2008-06-10 17:06 UTC (permalink / raw)
To: Yoichi Yuasa; +Cc: linux-mm, Pekka Enberg
On Tue, 10 Jun 2008, Yoichi Yuasa wrote:
> No, the kernel that applies it cannot boot.
Hmmm... Ok here is an experimental patch that just disables merging for
192 (in general a bad idea). If this works then we know at least where
to look for the solution.
---
mm/slub.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Index: linux-2.6/mm/slub.c
===================================================================
--- linux-2.6.orig/mm/slub.c 2008-06-10 10:02:03.000000000 -0700
+++ linux-2.6/mm/slub.c 2008-06-10 10:04:04.000000000 -0700
@@ -171,7 +171,7 @@ static inline void ClearSlabDebug(struct
* Set of flags that will prevent slab merging
*/
#define SLUB_NEVER_MERGE (SLAB_RED_ZONE | SLAB_POISON | SLAB_STORE_USER | \
- SLAB_TRACE | SLAB_DESTROY_BY_RCU)
+ SLAB_TRACE | SLAB_DESTROY_BY_RCU | __SLAB_NOMERGE)
#define SLUB_MERGE_SAME (SLAB_DEBUG_FREE | SLAB_RECLAIM_ACCOUNT | \
SLAB_CACHE_DMA)
@@ -187,6 +187,7 @@ static inline void ClearSlabDebug(struct
/* Internal SLUB flags */
#define __OBJECT_POISON 0x80000000 /* Poison object */
#define __SYSFS_ADD_DEFERRED 0x40000000 /* Not yet visible via sysfs */
+#define __SLAB_NOMERGE 0x20000000 /* Never merge this slab */
static int kmem_size = sizeof(struct kmem_cache);
@@ -2998,7 +2999,7 @@ void __init kmem_cache_init(void)
}
if (KMALLOC_MIN_SIZE <= 128) {
create_kmalloc_cache(&kmalloc_caches[2],
- "kmalloc-192", 192, GFP_KERNEL);
+ "kmalloc-192", 192, GFP_KERNEL | __SLAB_NOMERGE);
caches++;
}
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-06-10 17:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-04 14:46 Collision of SLUB unique ID Yoichi Yuasa
2008-06-09 14:10 ` Christoph Lameter
2008-06-10 1:06 ` Yoichi Yuasa
2008-06-10 1:22 ` Christoph Lameter
2008-06-10 2:44 ` Yoichi Yuasa
2008-06-10 17:06 ` Christoph Lameter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox