aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slub.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/slub.c')
-rw-r--r--mm/slub.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/mm/slub.c b/mm/slub.c
index 1af7f2f19420..ccfd41141b6b 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1078,14 +1078,7 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
1078 struct page *page; 1078 struct page *page;
1079 int pages = 1 << s->order; 1079 int pages = 1 << s->order;
1080 1080
1081 if (s->order) 1081 flags |= s->allocflags;
1082 flags |= __GFP_COMP;
1083
1084 if (s->flags & SLAB_CACHE_DMA)
1085 flags |= SLUB_DMA;
1086
1087 if (s->flags & SLAB_RECLAIM_ACCOUNT)
1088 flags |= __GFP_RECLAIMABLE;
1089 1082
1090 if (node == -1) 1083 if (node == -1)
1091 page = alloc_pages(flags, s->order); 1084 page = alloc_pages(flags, s->order);
@@ -2333,6 +2326,16 @@ static int calculate_sizes(struct kmem_cache *s)
2333 if (s->order < 0) 2326 if (s->order < 0)
2334 return 0; 2327 return 0;
2335 2328
2329 s->allocflags = 0;
2330 if (s->order)
2331 s->allocflags |= __GFP_COMP;
2332
2333 if (s->flags & SLAB_CACHE_DMA)
2334 s->allocflags |= SLUB_DMA;
2335
2336 if (s->flags & SLAB_RECLAIM_ACCOUNT)
2337 s->allocflags |= __GFP_RECLAIMABLE;
2338
2336 /* 2339 /*
2337 * Determine the number of objects per slab 2340 * Determine the number of objects per slab
2338 */ 2341 */