* + percpu-export-per_cpu_sum.patch added to -mm tree
@ 2021-03-11 22:15 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2021-03-11 22:15 UTC (permalink / raw)
To: cl, guro, iamjoonsoo.kim, jnwang, khlebnikov, mm-commits,
penberg, rientjes, sming56, vbabka, wenyang, willy, xlpang
The patch titled
Subject: percpu: export per_cpu_sum()
has been added to the -mm tree. Its filename is
percpu-export-per_cpu_sum.patch
This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/percpu-export-per_cpu_sum.patch
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/percpu-export-per_cpu_sum.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Xunlei Pang <xlpang@linux.alibaba.com>
Subject: percpu: export per_cpu_sum()
per_cpu_sum() is useful, and deserves to be exported.
Link: https://lkml.kernel.org/r/1615303512-35058-4-git-send-email-xlpang@linux.alibaba.com
Signed-off-by: Xunlei Pang <xlpang@linux.alibaba.com>
Tested-by: James Wang <jnwang@linux.alibaba.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Roman Gushchin <guro@fb.com>
Cc: Shu Ming <sming56@gmail.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Wen Yang <wenyang@linux.alibaba.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/percpu-defs.h | 10 ++++++++++
kernel/locking/percpu-rwsem.c | 10 ----------
2 files changed, 10 insertions(+), 10 deletions(-)
--- a/include/linux/percpu-defs.h~percpu-export-per_cpu_sum
+++ a/include/linux/percpu-defs.h
@@ -220,6 +220,16 @@ do { \
(void)__vpp_verify; \
} while (0)
+#define per_cpu_sum(var) \
+({ \
+ typeof(var) __sum = 0; \
+ int cpu; \
+ compiletime_assert_atomic_type(__sum); \
+ for_each_possible_cpu(cpu) \
+ __sum += per_cpu(var, cpu); \
+ __sum; \
+})
+
#ifdef CONFIG_SMP
/*
--- a/kernel/locking/percpu-rwsem.c~percpu-export-per_cpu_sum
+++ a/kernel/locking/percpu-rwsem.c
@@ -178,16 +178,6 @@ bool __percpu_down_read(struct percpu_rw
}
EXPORT_SYMBOL_GPL(__percpu_down_read);
-#define per_cpu_sum(var) \
-({ \
- typeof(var) __sum = 0; \
- int cpu; \
- compiletime_assert_atomic_type(__sum); \
- for_each_possible_cpu(cpu) \
- __sum += per_cpu(var, cpu); \
- __sum; \
-})
-
/*
* Return true if the modular sum of the sem->read_count per-CPU variable is
* zero. If this sum is zero, then it is stable due to the fact that if any
_
Patches currently in -mm which might be from xlpang@linux.alibaba.com are
mm-slub-introduce-two-counters-for-partial-objects.patch
mm-slub-get-rid-of-count_partial.patch
percpu-export-per_cpu_sum.patch
mm-slub-use-percpu-partial-free-counter.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-03-11 22:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-11 22:15 + percpu-export-per_cpu_sum.patch added to -mm tree akpm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).