mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
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 <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: "David S. Miller" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
e7ca2d41a0
commit
b324215190
2 changed files with 2 additions and 2 deletions
|
|
@ -98,7 +98,7 @@ EXPORT_SYMBOL_GPL(__percpu_populate_mask);
|
|||
*/
|
||||
void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask)
|
||||
{
|
||||
void *pdata = kzalloc(sizeof(struct percpu_data), gfp);
|
||||
void *pdata = kzalloc(nr_cpu_ids * sizeof(void *), gfp);
|
||||
void *__pdata = __percpu_disguise(pdata);
|
||||
|
||||
if (unlikely(!pdata))
|
||||
|
|
|
|||
Loading…
Reference in a new issue