Skip to contentSkip to conversation

slob: handle SLAB_PANIC flag

PATCH In review Akinobu Mita 2 participants 3 messages Apr 9, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 slob: handle SLAB_PANIC flag

kmem_cache_create() for slob doesn't handle SLAB_PANIC.

---
 mm/slob.c |    3 +++
 1 file changed, 3 insertions(+)
mm/slob.c +3 -0
Index: 2.6-mm/mm/slob.c
===================================================================
@@ -298,6 +298,9 @@ struct kmem_cache *kmem_cache_create(con
 		c->align = (flags & SLAB_MUST_HWCACHE_ALIGN) ? SLOB_ALIGN : 0;
 		if (c->align < align)
 			c->align = align;
+	} else {
+		if (flags & SLAB_PANIC)
+			panic("Cannot create slab cache %s\n", name);
 	}
 
 	return c;
#1 lore raw
Quoted 14 lines · Akinobu Mita

kmem_cache_create() for slob doesn't handle SLAB_PANIC.

---
 mm/slob.c |    3 +++
 1 file changed, 3 insertions(+)

Index: 2.6-mm/mm/slob.c
===================================================================

mm/slob.c struct kmem_cache *kmem_cache_create(con · line 304

Quoted 7 lines
mm/slob.c +3 -0
@@ -298,6 +298,9 @@ struct kmem_cache *kmem_cache_create(con
 		c->align = (flags & SLAB_MUST_HWCACHE_ALIGN) ? SLOB_ALIGN : 0;
 		if (c->align < align)
 			c->align = align;
+	} else {
+		if (flags & SLAB_PANIC)
+			panic("Cannot create slab cache %s\n", name);
 	}

I think this would be more canonical:

} else if (..)
panic();

But otherwise,

Signature · 1 line
Mathematics is the supreme nostalgia of our time.
#2 lore raw

2007/4/9, Matt Mackall <[email protected]>:

Quoted 15 lines

mm/slob.c struct kmem_cache *kmem_cache_create(con · line 304

Quoted 12 lines

Index: 2.6-mm/mm/slob.c
===================================================================

mm/slob.c +3 -0
@@ -298,6 +298,9 @@ struct kmem_cache *kmem_cache_create(con
              c->align = (flags & SLAB_MUST_HWCACHE_ALIGN) ? SLOB_ALIGN : 0;
              if (c->align < align)
                      c->align = align;
+     } else {
+             if (flags & SLAB_PANIC)
+                     panic("Cannot create slab cache %s\n", name);
      }

I think this would be more canonical:

Quoted 2 lines

} else if (..)
panic();

Thanks, the patch updated.

From: Akinobu Mita <[email protected]>
Subject: [PATCH] slob: handle SLAB_PANIC flag

kmem_cache_create() for slob doesn't handle SLAB_PANIC.

---
mm/slob.c | 3 ++-

1 file changed, 2 insertions(+), 1 deletion(-)
mm/slob.c +0 -0
Index: 2.6-mm/mm/slob.c
===================================================================
@@ -298,7 +298,8 @@ struct kmem_cache *kmem_cache_create(con
		c->align = (flags & SLAB_MUST_HWCACHE_ALIGN) ? SLOB_ALIGN : 0;
		if (c->align < align)
			c->align = align;

- }
+ } else if (flags & SLAB_PANIC)
+ panic("Cannot create slab cache %s\n", name);

	return c;
}