[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-8b8e2ec1eeca7f6941bc81cefc9663018d6ceb57@git.kernel.org>
Date: Tue, 21 Sep 2010 14:13:26 GMT
From: tip-bot for Peter Zijlstra <a.p.zijlstra@...llo.nl>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
a.p.zijlstra@...llo.nl, tj@...nel.org, tglx@...utronix.de,
mingo@...e.hu
Subject: [tip:perf/core] percpu: Add {get,put}_cpu_ptr
Commit-ID: 8b8e2ec1eeca7f6941bc81cefc9663018d6ceb57
Gitweb: http://git.kernel.org/tip/8b8e2ec1eeca7f6941bc81cefc9663018d6ceb57
Author: Peter Zijlstra <a.p.zijlstra@...llo.nl>
AuthorDate: Thu, 16 Sep 2010 19:21:28 +0200
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Tue, 21 Sep 2010 13:55:43 +0200
percpu: Add {get,put}_cpu_ptr
These are similar to {get,put}_cpu_var() except for dynamically
allocated per-cpu memory.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Acked-by: Tejun Heo <tj@...nel.org>
LKML-Reference: <20100917093009.252867712@...llo.nl>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
include/linux/percpu.h | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 49466b1..0eb5083 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -39,6 +39,15 @@
preempt_enable(); \
} while (0)
+#define get_cpu_ptr(var) ({ \
+ preempt_disable(); \
+ this_cpu_ptr(var); })
+
+#define put_cpu_ptr(var) do { \
+ (void)(var); \
+ preempt_enable(); \
+} while (0)
+
#ifdef CONFIG_SMP
/* minimum unit size, also is the maximum supported allocation size */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists