+ percpu-__percpu_alloc_mask-can-dynamically-size-percpu_data.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     PERCPU : __percpu_alloc_mask() can dynamically size percpu_data storage
has been added to the -mm tree.  Its filename is
     percpu-__percpu_alloc_mask-can-dynamically-size-percpu_data.patch

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: PERCPU : __percpu_alloc_mask() can dynamically size percpu_data storage
From: Eric Dumazet <dada1@xxxxxxxxxxxxx>

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@xxxxxxxxxxxxx>
Cc: Christoph Lameter <clameter@xxxxxxx>
Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 include/linux/percpu.h |    2 +-
 mm/allocpercpu.c       |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff -puN include/linux/percpu.h~percpu-__percpu_alloc_mask-can-dynamically-size-percpu_data include/linux/percpu.h
--- a/include/linux/percpu.h~percpu-__percpu_alloc_mask-can-dynamically-size-percpu_data
+++ a/include/linux/percpu.h
@@ -34,7 +34,7 @@
 #ifdef CONFIG_SMP
 
 struct percpu_data {
-	void *ptrs[NR_CPUS];
+	void *ptrs[1];
 };
 
 #define __percpu_disguise(pdata) (struct percpu_data *)~(unsigned long)(pdata)
diff -puN mm/allocpercpu.c~percpu-__percpu_alloc_mask-can-dynamically-size-percpu_data mm/allocpercpu.c
--- a/mm/allocpercpu.c~percpu-__percpu_alloc_mask-can-dynamically-size-percpu_data
+++ a/mm/allocpercpu.c
@@ -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))
_

Patches currently in -mm which might be from dada1@xxxxxxxxxxxxx are

git-net.patch
nr_open-should-be-raised-a-litle-bit.patch
percpu-__percpu_alloc_mask-can-dynamically-size-percpu_data.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux