From: tip-bot for Shaohua Li <shaohua.li@intel.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
eric.dumazet@gmail.com, shaohua.li@intel.com, tglx@linutronix.de,
hpa@linux.intel.com
Subject: [tip:x86/mm] percpu: Introduce a read-mostly percpu API
Date: Wed, 20 Oct 2010 23:06:59 GMT [thread overview]
Message-ID: <tip-c957ef2c59e952803766ddc22e89981ab534606f@git.kernel.org> (raw)
In-Reply-To: <1287544022.4571.7.camel@sli10-conroe.sh.intel.com>
Commit-ID: c957ef2c59e952803766ddc22e89981ab534606f
Gitweb: http://git.kernel.org/tip/c957ef2c59e952803766ddc22e89981ab534606f
Author: Shaohua Li <shaohua.li@intel.com>
AuthorDate: Wed, 20 Oct 2010 11:07:02 +0800
Committer: H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Wed, 20 Oct 2010 14:33:58 -0700
percpu: Introduce a read-mostly percpu API
Add a new readmostly percpu section and API. This can be used to
avoid dirtying data lines which are generally not written to, which is
especially important for data which may be accessed by processors
other than the one for which the percpu area belongs to.
[ hpa: moved it *after* the page-aligned section, for obvious
reasons. ]
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
LKML-Reference: <1287544022.4571.7.camel@sli10-conroe.sh.intel.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
include/asm-generic/vmlinux.lds.h | 4 ++++
include/linux/percpu-defs.h | 9 +++++++++
2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 8a92a17..d7e7b21 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -677,7 +677,9 @@
- LOAD_OFFSET) { \
VMLINUX_SYMBOL(__per_cpu_start) = .; \
*(.data..percpu..first) \
+ . = ALIGN(PAGE_SIZE); \
*(.data..percpu..page_aligned) \
+ *(.data..percpu..readmostly) \
*(.data..percpu) \
*(.data..percpu..shared_aligned) \
VMLINUX_SYMBOL(__per_cpu_end) = .; \
@@ -703,6 +705,8 @@
VMLINUX_SYMBOL(__per_cpu_load) = .; \
VMLINUX_SYMBOL(__per_cpu_start) = .; \
*(.data..percpu..first) \
+ . = ALIGN(PAGE_SIZE); \
+ *(.data..percpu..readmostly) \
*(.data..percpu..page_aligned) \
*(.data..percpu) \
*(.data..percpu..shared_aligned) \
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h
index ce2dc65..27ef6b1 100644
--- a/include/linux/percpu-defs.h
+++ b/include/linux/percpu-defs.h
@@ -139,6 +139,15 @@
__aligned(PAGE_SIZE)
/*
+ * Declaration/definition used for per-CPU variables that must be read mostly.
+ */
+#define DECLARE_PER_CPU_READ_MOSTLY(type, name) \
+ DECLARE_PER_CPU_SECTION(type, name, "..readmostly")
+
+#define DEFINE_PER_CPU_READ_MOSTLY(type, name) \
+ DEFINE_PER_CPU_SECTION(type, name, "..readmostly")
+
+/*
* Intermodule exports for per-CPU variables. sparse forgets about
* address space across EXPORT_SYMBOL(), change EXPORT_SYMBOL() to
* noop if __CHECKER__.
next prev parent reply other threads:[~2010-10-20 23:07 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-20 3:07 [PATCH 1/2]percpu: introduce read mostly percpu API Shaohua Li
2010-10-20 5:18 ` Eric Dumazet
2010-10-20 6:00 ` H. Peter Anvin
2010-10-20 7:35 ` Andi Kleen
2010-10-20 7:53 ` Eric Dumazet
2010-10-20 21:38 ` H. Peter Anvin
2010-10-20 21:42 ` H. Peter Anvin
2010-10-20 21:33 ` H. Peter Anvin
2010-10-20 23:06 ` tip-bot for Shaohua Li [this message]
2010-10-21 1:38 ` [tip:x86/mm] percpu: Introduce a read-mostly " Shaohua Li
2010-10-21 2:53 ` H. Peter Anvin
2010-10-21 5:33 ` Eric Dumazet
2010-10-21 5:54 ` H. Peter Anvin
2010-10-21 6:07 ` Eric Dumazet
2010-10-21 6:09 ` H. Peter Anvin
2010-10-21 6:17 ` Shaohua Li
2010-10-21 6:48 ` Eric Dumazet
2010-10-21 6:54 ` H. Peter Anvin
2010-10-21 6:10 ` H. Peter Anvin
2010-10-21 7:40 ` [tip:x86/mm] x86-32, percpu: Correct the ordering of the percpu readmostly section tip-bot for H. Peter Anvin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-c957ef2c59e952803766ddc22e89981ab534606f@git.kernel.org \
--to=shaohua.li@intel.com \
--cc=eric.dumazet@gmail.com \
--cc=hpa@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.