- cpu-hotplug-compatible-alloc_percpu-fix-2.patch removed from -mm tree

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

 



The patch titled

     percpu_alloc: pass cpumask by reference

has been removed from the -mm tree.  Its filename is

     cpu-hotplug-compatible-alloc_percpu-fix-2.patch

This patch was dropped because it was folded into cpu-hotplug-compatible-alloc_percpu.patch

------------------------------------------------------
Subject: percpu_alloc: pass cpumask by reference
From: Martin Peschke <mp3@xxxxxxxxxx>

make the percpu_alloc() functions pass (possibly large) cpumasks by
reference, while it still looks like 'pass by value' for users (in the
style of include/linux/cpumask.h).

Signed-off-by: Martin Peschke <mp3@xxxxxxxxxx>
Cc: Paul Jackson <pj@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 include/linux/percpu.h |   23 +++++++++++++++--------
 mm/slab.c              |   23 ++++++++++++-----------
 2 files changed, 27 insertions(+), 19 deletions(-)

diff -puN include/linux/percpu.h~cpu-hotplug-compatible-alloc_percpu-fix-2 include/linux/percpu.h
--- a/include/linux/percpu.h~cpu-hotplug-compatible-alloc_percpu-fix-2
+++ a/include/linux/percpu.h
@@ -44,10 +44,10 @@ struct percpu_data {
 
 extern void *percpu_populate(void *__pdata, size_t size, gfp_t gfp, int cpu);
 extern void percpu_depopulate(void *__pdata, int cpu);
-extern int percpu_populate_mask(void *__pdata, size_t size, gfp_t gfp,
-				cpumask_t mask);
-extern void percpu_depopulate_mask(void *__pdata, cpumask_t mask);
-extern void *percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t mask);
+extern int __percpu_populate_mask(void *__pdata, size_t size, gfp_t gfp,
+				  cpumask_t *mask);
+extern void __percpu_depopulate_mask(void *__pdata, cpumask_t *mask);
+extern void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask);
 extern void percpu_free(void *__pdata);
 
 #else /* CONFIG_SMP */
@@ -58,7 +58,7 @@ static inline void percpu_depopulate(voi
 {
 }
 
-static inline void percpu_depopulate_mask(void *__pdata, cpumask_t mask)
+static inline void __percpu_depopulate_mask(void *__pdata, cpumask_t *mask)
 {
 }
 
@@ -68,13 +68,13 @@ static inline void *percpu_populate(void
 	return percpu_ptr(__pdata, cpu);
 }
 
-static inline int percpu_populate_mask(void *__pdata, size_t size, gfp_t gfp,
-				       cpumask_t mask)
+static inline int __percpu_populate_mask(void *__pdata, size_t size, gfp_t gfp,
+					 cpumask_t *mask)
 {
 	return 0;
 }
 
-static inline void *percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t mask)
+static inline void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask)
 {
 	return kzalloc(size, gfp);
 }
@@ -86,6 +86,13 @@ static inline void percpu_free(void *__p
 
 #endif /* CONFIG_SMP */
 
+#define percpu_populate_mask(__pdata, size, gfp, mask) \
+	__percpu_populate_mask((__pdata), (size), (gfp), &(mask))
+#define percpu_depopulate_mask(__pdata, mask) \
+	__percpu_depopulate_mask((__pdata), &(mask))
+#define percpu_alloc_mask(size, gfp, mask) \
+	__percpu_alloc_mask((size), (gfp), &(mask))
+
 #define percpu_alloc(size, gfp) percpu_alloc_mask((size), (gfp), cpu_online_map)
 
 /* (legacy) interface for use without CPU hotplug handling */
diff -puN mm/slab.c~cpu-hotplug-compatible-alloc_percpu-fix-2 mm/slab.c
--- a/mm/slab.c~cpu-hotplug-compatible-alloc_percpu-fix-2
+++ a/mm/slab.c
@@ -3393,13 +3393,13 @@ EXPORT_SYMBOL_GPL(percpu_depopulate);
  * @__pdata: per-cpu data to depopulate
  * @mask: depopulate per-cpu data for cpu's selected through mask bits
  */
-void percpu_depopulate_mask(void *__pdata, cpumask_t mask)
+void __percpu_depopulate_mask(void *__pdata, cpumask_t *mask)
 {
 	int cpu;
-	for_each_cpu_mask(cpu, mask)
+	for_each_cpu_mask(cpu, *mask)
 		percpu_depopulate(__pdata, cpu);
 }
-EXPORT_SYMBOL_GPL(percpu_depopulate_mask);
+EXPORT_SYMBOL_GPL(__percpu_depopulate_mask);
 
 /**
  * percpu_populate - populate per-cpu data for given cpu
@@ -3438,20 +3438,21 @@ EXPORT_SYMBOL_GPL(percpu_populate);
  *
  * Per-cpu objects are populated with zeroed buffers.
  */
-int percpu_populate_mask(void *__pdata, size_t size, gfp_t gfp, cpumask_t mask)
+int __percpu_populate_mask(void *__pdata, size_t size, gfp_t gfp,
+			   cpumask_t *mask)
 {
 	cpumask_t populated = CPU_MASK_NONE;
 	int cpu;
 
-	for_each_cpu_mask(cpu, mask)
+	for_each_cpu_mask(cpu, *mask)
 		if (unlikely(!percpu_populate(__pdata, size, gfp, cpu))) {
-			percpu_depopulate_mask(__pdata, populated);
+			__percpu_depopulate_mask(__pdata, &populated);
 			return -ENOMEM;
 		} else
 			cpu_set(cpu, populated);
 	return 0;
 }
-EXPORT_SYMBOL_GPL(percpu_populate_mask);
+EXPORT_SYMBOL_GPL(__percpu_populate_mask);
 
 /**
  * percpu_alloc_mask - initial setup of per-cpu data
@@ -3463,19 +3464,19 @@ EXPORT_SYMBOL_GPL(percpu_populate_mask);
  * which is simplified by the percpu_alloc() wrapper.
  * Per-cpu objects are populated with zeroed buffers.
  */
-void *percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t mask)
+void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask)
 {
 	void *pdata = kzalloc(sizeof(struct percpu_data), gfp);
 	void *__pdata = __percpu_disguise(pdata);
 
 	if (unlikely(!pdata))
 		return NULL;
-	if (likely(!percpu_populate_mask(__pdata, size, gfp, mask)))
+	if (likely(!__percpu_populate_mask(__pdata, size, gfp, mask)))
 		return __pdata;
 	kfree(pdata);
 	return NULL;
 }
-EXPORT_SYMBOL_GPL(percpu_alloc_mask);
+EXPORT_SYMBOL_GPL(__percpu_alloc_mask);
 
 /**
  * percpu_free - final cleanup of per-cpu data
@@ -3486,7 +3487,7 @@ EXPORT_SYMBOL_GPL(percpu_alloc_mask);
  */
 void percpu_free(void *__pdata)
 {
-	percpu_depopulate_mask(__pdata, cpu_possible_map);
+	__percpu_depopulate_mask(__pdata, &cpu_possible_map);
 	kfree(__percpu_disguise(__pdata));
 }
 EXPORT_SYMBOL_GPL(percpu_free);
_

Patches currently in -mm which might be from mp3@xxxxxxxxxx are

cpu-hotplug-compatible-alloc_percpu.patch
cpu-hotplug-compatible-alloc_percpu-fix-2.patch
statistics-infrastructure-prerequisite-list.patch
statistics-infrastructure-prerequisite-parser.patch
statistics-infrastructure-prerequisite-timestamp.patch
statistics-infrastructure-prerequisite-timestamp-fix.patch
statistics-infrastructure-make-printk_clock-a-generic-kernel-wide-nsec-resolution.patch
statistics-infrastructure-documentation.patch
statistics-infrastructure.patch
statistics-infrastructure-update-9.patch
statistics-use-the-enhanced-percpu-interface.patch
statistics-replace-inode-ugeneric_ip-with-i_private.patch
statistics-infrastructure-exploitation-zfcp.patch
statistics-infrastructure-exploitation-zfcp-sched_clock-fix.patch
zfcp-gather-hba-specific-latencies-in-statistics.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