aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slub.c
diff options
context:
space:
mode:
authorVegard Nossum <vegard.nossum@gmail.com>2009-06-15 09:50:49 -0400
committerVegard Nossum <vegard.nossum@gmail.com>2009-06-15 09:50:49 -0400
commit722f2a6c87f34ee0fd0130a8cf45f81e0705594a (patch)
tree50b054df34d2731eb0ba0cf1a6c27e43e7eed428 /mm/slub.c
parent7a0aeb14e18ad59394bd9bbc6e57fb345819e748 (diff)
parent45e3e1935e2857c54783291107d33323b3ef33c8 (diff)
Merge commit 'linus/master' into HEAD
Conflicts: MAINTAINERS Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
Diffstat (limited to 'mm/slub.c')
-rw-r--r--mm/slub.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/mm/slub.c b/mm/slub.c
index 898fb5047dcc..15960a09abb1 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -179,6 +179,12 @@ static enum {
179 SYSFS /* Sysfs up */ 179 SYSFS /* Sysfs up */
180} slab_state = DOWN; 180} slab_state = DOWN;
181 181
182/*
183 * The slab allocator is initialized with interrupts disabled. Therefore, make
184 * sure early boot allocations don't accidentally enable interrupts.
185 */
186static gfp_t slab_gfp_mask __read_mostly = SLAB_GFP_BOOT_MASK;
187
182/* A list of all slab caches on the system */ 188/* A list of all slab caches on the system */
183static DECLARE_RWSEM(slub_lock); 189static DECLARE_RWSEM(slub_lock);
184static LIST_HEAD(slab_caches); 190static LIST_HEAD(slab_caches);
@@ -1618,6 +1624,8 @@ static __always_inline void *slab_alloc(struct kmem_cache *s,
1618 unsigned long flags; 1624 unsigned long flags;
1619 unsigned int objsize; 1625 unsigned int objsize;
1620 1626
1627 gfpflags &= slab_gfp_mask;
1628
1621 lockdep_trace_alloc(gfpflags); 1629 lockdep_trace_alloc(gfpflags);
1622 might_sleep_if(gfpflags & __GFP_WAIT); 1630 might_sleep_if(gfpflags & __GFP_WAIT);
1623 1631
@@ -3132,6 +3140,14 @@ void __init kmem_cache_init(void)
3132 nr_cpu_ids, nr_node_ids); 3140 nr_cpu_ids, nr_node_ids);
3133} 3141}
3134 3142
3143void __init kmem_cache_init_late(void)
3144{
3145 /*
3146 * Interrupts are enabled now so all GFP allocations are safe.
3147 */
3148 slab_gfp_mask = __GFP_BITS_MASK;
3149}
3150
3135/* 3151/*
3136 * Find a mergeable slab cache 3152 * Find a mergeable slab cache
3137 */ 3153 */