PERCPU : __percpu_alloc_mask() can dynamically size percpu_data storage
Instead of allocating a fix sized array of NR_CPUS pointers for percpu_data, we can use nr_cpu_ids, which is generally < NR_CPUS. Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Cc: Christoph Lameter <clameter@sgi.com> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
e7ca2d41a0
commit
b324215190
2 changed files with 2 additions and 2 deletions
|
@ -54,7 +54,7 @@
|
|||
#ifdef CONFIG_SMP
|
||||
|
||||
struct percpu_data {
|
||||
void *ptrs[NR_CPUS];
|
||||
void *ptrs[1];
|
||||
};
|
||||
|
||||
#define __percpu_disguise(pdata) (struct percpu_data *)~(unsigned long)(pdata)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue