Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42656
b: refs/heads/master
c: a44b56d
h: refs/heads/master
v: v3
  • Loading branch information
Kevin Hilman authored and Linus Torvalds committed Dec 7, 2006
1 parent 515a99d commit 4c7bf88
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cace673d376d97b0c66ffa0a49b8d588a696d5d2
refs/heads/master: a44b56d354b49f9abb184e5a14f71889856283bb
17 changes: 11 additions & 6 deletions trunk/mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -2197,18 +2197,17 @@ kmem_cache_create (const char *name, size_t size, size_t align,
if (flags & SLAB_RED_ZONE || flags & SLAB_STORE_USER)
ralign = BYTES_PER_WORD;

/* 2) arch mandated alignment: disables debug if necessary */
/* 2) arch mandated alignment */
if (ralign < ARCH_SLAB_MINALIGN) {
ralign = ARCH_SLAB_MINALIGN;
if (ralign > BYTES_PER_WORD)
flags &= ~(SLAB_RED_ZONE | SLAB_STORE_USER);
}
/* 3) caller mandated alignment: disables debug if necessary */
/* 3) caller mandated alignment */
if (ralign < align) {
ralign = align;
if (ralign > BYTES_PER_WORD)
flags &= ~(SLAB_RED_ZONE | SLAB_STORE_USER);
}
/* disable debug if necessary */
if (ralign > BYTES_PER_WORD)
flags &= ~(SLAB_RED_ZONE | SLAB_STORE_USER);
/*
* 4) Store it.
*/
Expand Down Expand Up @@ -3063,6 +3062,12 @@ static void *cache_alloc_debugcheck_after(struct kmem_cache *cachep,

cachep->ctor(objp, cachep, ctor_flags);
}
#if ARCH_SLAB_MINALIGN
if ((u32)objp & (ARCH_SLAB_MINALIGN-1)) {
printk(KERN_ERR "0x%p: not aligned to ARCH_SLAB_MINALIGN=%d\n",
objp, ARCH_SLAB_MINALIGN);
}
#endif
return objp;
}
#else
Expand Down

0 comments on commit 4c7bf88

Please sign in to comment.