Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 215943
b: refs/heads/master
c: db210e7
h: refs/heads/master
i:
  215941: 1511f74
  215939: b819eb4
  215935: 497a1c2
v: v3
  • Loading branch information
Christoph Lameter authored and Pekka Enberg committed Oct 2, 2010
1 parent c55d70d commit f34bda5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a016471a16b5c4d4ec8f5221575e603a3d11e5e9
refs/heads/master: db210e70e5f191710a3b1d09f653b44885d397ea
16 changes: 16 additions & 0 deletions trunk/mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -2103,8 +2103,24 @@ init_kmem_cache_node(struct kmem_cache_node *n, struct kmem_cache *s)

static inline int alloc_kmem_cache_cpus(struct kmem_cache *s)
{
#ifdef CONFIG_SMP
/*
* Will use reserve that does not require slab operation during
* early boot.
*/
BUILD_BUG_ON(PERCPU_DYNAMIC_EARLY_SIZE <
SLUB_PAGE_SHIFT * sizeof(struct kmem_cache_cpu));
#else
/*
* Special hack for UP mode. allocpercpu() falls back to kmalloc
* operations. So we cannot use that before the slab allocator is up
* Simply get the smallest possible compound page. The page will be
* released via kfree() when the cpu caches are resized later.
*/
if (slab_state < UP)
s->cpu_slab = (__percpu void *)kmalloc_large(PAGE_SIZE << 1, GFP_NOWAIT);
else
#endif

s->cpu_slab = alloc_percpu(struct kmem_cache_cpu);

Expand Down

0 comments on commit f34bda5

Please sign in to comment.