Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 54241
b: refs/heads/master
c: 4f10493
h: refs/heads/master
i:
  54239: e3528d2
v: v3
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed May 7, 2007
1 parent abb5064 commit 754c352
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 25 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: 50953fe9e00ebbeffa032a565ab2f08312d51a87
refs/heads/master: 4f104934591ed98534b3a4c3d17d972b790e9c42
1 change: 0 additions & 1 deletion trunk/include/linux/slab.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ typedef struct kmem_cache kmem_cache_t __deprecated;

/* Flags passed to a constructor functions */
#define SLAB_CTOR_CONSTRUCTOR 0x001UL /* If not set, then deconstructor */
#define SLAB_CTOR_ATOMIC 0x002UL /* Tell constructor it can't sleep */

/*
* struct kmem_cache related prototypes
Expand Down
17 changes: 2 additions & 15 deletions trunk/mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -2752,13 +2752,6 @@ static int cache_grow(struct kmem_cache *cachep,

ctor_flags = SLAB_CTOR_CONSTRUCTOR;
local_flags = (flags & GFP_LEVEL_MASK);
if (!(local_flags & __GFP_WAIT))
/*
* Not allowed to sleep. Need to tell a constructor about
* this - it might need to know...
*/
ctor_flags |= SLAB_CTOR_ATOMIC;

/* Take the l3 list lock to change the colour_next on this node */
check_irq_off();
l3 = cachep->nodelists[nodeid];
Expand Down Expand Up @@ -3092,14 +3085,8 @@ static void *cache_alloc_debugcheck_after(struct kmem_cache *cachep,
}
#endif
objp += obj_offset(cachep);
if (cachep->ctor && cachep->flags & SLAB_POISON) {
unsigned long ctor_flags = SLAB_CTOR_CONSTRUCTOR;

if (!(flags & __GFP_WAIT))
ctor_flags |= SLAB_CTOR_ATOMIC;

cachep->ctor(objp, cachep, ctor_flags);
}
if (cachep->ctor && cachep->flags & SLAB_POISON)
cachep->ctor(objp, cachep, SLAB_CTOR_CONSTRUCTOR);
#if ARCH_SLAB_MINALIGN
if ((u32)objp & (ARCH_SLAB_MINALIGN-1)) {
printk(KERN_ERR "0x%p: not aligned to ARCH_SLAB_MINALIGN=%d\n",
Expand Down
10 changes: 2 additions & 8 deletions trunk/mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,14 +802,8 @@ static void setup_object(struct kmem_cache *s, struct page *page,
init_tracking(s, object);
}

if (unlikely(s->ctor)) {
int mode = SLAB_CTOR_CONSTRUCTOR;

if (!(s->flags & __GFP_WAIT))
mode |= SLAB_CTOR_ATOMIC;

s->ctor(object, s, mode);
}
if (unlikely(s->ctor))
s->ctor(object, s, SLAB_CTOR_CONSTRUCTOR);
}

static struct page *new_slab(struct kmem_cache *s, gfp_t flags, int node)
Expand Down

0 comments on commit 754c352

Please sign in to comment.