Commit | Line | Data |
---|---|---|
34e49164 C |
1 | static int __cpuinit cpuup_prepare(long cpu) |
2 | { | |
3 | struct kmem_list3 *l3 = NULL; | |
4 | ||
5 | list_for_each_entry(cachep, &cache_chain, next) { | |
6 | if (!cachep->nodelists[node]) { | |
7 | l3 = kmalloc_node(memsize, GFP_KERNEL, node); | |
8 | if (!l3) return 0; | |
9 | kmem_list3_init(l3); | |
10 | l3->next_reap = jiffies + REAPTIMEOUT_LIST3 + | |
11 | ((unsigned long)cachep) % REAPTIMEOUT_LIST3; | |
12 | cachep->nodelists[node] = l3; | |
13 | } | |
14 | } | |
15 | list_for_each_entry(cachep, &cache_chain, next) { | |
16 | struct array_cache *shared = NULL; | |
17 | ||
18 | if (cachep->shared) { | |
19 | shared = alloc_arraycache(node, | |
20 | cachep->shared * cachep->batchcount, | |
21 | 0xbaadf00d); | |
22 | if (!shared) return 0; | |
23 | } | |
24 | if (use_alien_caches) { | |
25 | if (!alien) { | |
26 | kfree(shared); | |
27 | goto bad; | |
28 | } | |
29 | } | |
30 | ||
31 | kfree(shared); | |
32 | } | |
33 | ||
34 | bad: | |
35 | return -ENOMEM; | |
36 | } |