Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 85510
b: refs/heads/master
c: b7a49f0
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Lameter authored and Christoph Lameter committed Feb 14, 2008
1 parent a151297 commit d23ea0e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 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: dada123d99c241d1a45798a7c77bcf99c4968704
refs/heads/master: b7a49f0d4c34166ae84089d9f145cfaae1b0eec5
1 change: 1 addition & 0 deletions trunk/include/linux/slub_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ struct kmem_cache {

/* Allocation and freeing of slabs */
int objects; /* Number of objects in slab */
gfp_t allocflags; /* gfp flags to use on each alloc */
int refcount; /* Refcount for slab cache destroy */
void (*ctor)(struct kmem_cache *, void *);
int inuse; /* Offset to metadata */
Expand Down
19 changes: 11 additions & 8 deletions trunk/mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1078,14 +1078,7 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
struct page *page;
int pages = 1 << s->order;

if (s->order)
flags |= __GFP_COMP;

if (s->flags & SLAB_CACHE_DMA)
flags |= SLUB_DMA;

if (s->flags & SLAB_RECLAIM_ACCOUNT)
flags |= __GFP_RECLAIMABLE;
flags |= s->allocflags;

if (node == -1)
page = alloc_pages(flags, s->order);
Expand Down Expand Up @@ -2333,6 +2326,16 @@ static int calculate_sizes(struct kmem_cache *s)
if (s->order < 0)
return 0;

s->allocflags = 0;
if (s->order)
s->allocflags |= __GFP_COMP;

if (s->flags & SLAB_CACHE_DMA)
s->allocflags |= SLUB_DMA;

if (s->flags & SLAB_RECLAIM_ACCOUNT)
s->allocflags |= __GFP_RECLAIMABLE;

/*
* Determine the number of objects per slab
*/
Expand Down

0 comments on commit d23ea0e

Please sign in to comment.