aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slub.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-06-17 23:24:12 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-18 16:12:57 -0400
commitdcce284a259373f9e5570f2e33f79eca84fcf565 (patch)
treeafc4b23208974f17c080ea3d2ecfbaca4254c010 /mm/slub.c
parent9729a6eb5878a3daa18395f2b5fb38bf9359a761 (diff)
mm: Extend gfp masking to the page allocator
The page allocator also needs the masking of gfp flags during boot, so this moves it out of slab/slub and uses it with the page allocator as well. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/slub.c')
-rw-r--r--mm/slub.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/mm/slub.c b/mm/slub.c
index 4c6449310a0e..ce62b770e2fc 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -179,12 +179,6 @@ 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
188/* A list of all slab caches on the system */ 182/* A list of all slab caches on the system */
189static DECLARE_RWSEM(slub_lock); 183static DECLARE_RWSEM(slub_lock);
190static LIST_HEAD(slab_caches); 184static LIST_HEAD(slab_caches);
@@ -1692,7 +1686,7 @@ static __always_inline void *slab_alloc(struct kmem_cache *s,
1692 unsigned long flags; 1686 unsigned long flags;
1693 unsigned int objsize; 1687 unsigned int objsize;
1694 1688
1695 gfpflags &= slab_gfp_mask; 1689 gfpflags &= gfp_allowed_mask;
1696 1690
1697 lockdep_trace_alloc(gfpflags); 1691 lockdep_trace_alloc(gfpflags);
1698 might_sleep_if(gfpflags & __GFP_WAIT); 1692 might_sleep_if(gfpflags & __GFP_WAIT);
@@ -3220,10 +3214,6 @@ void __init kmem_cache_init(void)
3220 3214
3221void __init kmem_cache_init_late(void) 3215void __init kmem_cache_init_late(void)
3222{ 3216{
3223 /*
3224 * Interrupts are enabled now so all GFP allocations are safe.
3225 */
3226 slab_gfp_mask = __GFP_BITS_MASK;
3227} 3217}
3228 3218
3229/* 3219/*