From: Adrian Bunk <bunk@stusta.de>
To: Andrew Morton <akpm@linux-foundation.org>,
Alexey Dobriyan <adobriyan@openvz.org>
Cc: linux-kernel@vger.kernel.org, Dave Jones <davej@codemonkey.org.uk>
Subject: [-mm patch] {rd,wr}msr_on_cpu SMP=n optimization
Date: Tue, 20 Feb 2007 01:07:13 +0100 [thread overview]
Message-ID: <20070220000713.GP13958@stusta.de> (raw)
In-Reply-To: <20070215051408.a7fb7d81.akpm@linux-foundation.org>
On Thu, Feb 15, 2007 at 05:14:08AM -0800, Andrew Morton wrote:
>...
> Changes since 2.6.20-rc6-mm3:
>...
> +rdmsr_on_cpu-wrmsr_on_cpu.patch
>...
> x86 updates
>...
Let's save a few bytes in the CONFIG_SMP=n case.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
BTW: currently -ENOUSERS
arch/i386/lib/Makefile | 2 +-
arch/i386/lib/msr-on-cpu.c | 12 ------------
arch/x86_64/lib/Makefile | 3 ++-
include/asm-i386/msr.h | 11 +++++++++++
include/asm-x86_64/msr.h | 11 +++++++++++
5 files changed, 25 insertions(+), 14 deletions(-)
--- linux-2.6.20-mm1/arch/i386/lib/Makefile.old 2007-02-16 14:13:20.000000000 +0100
+++ linux-2.6.20-mm1/arch/i386/lib/Makefile 2007-02-16 14:14:22.000000000 +0100
@@ -8,4 +8,4 @@
lib-$(CONFIG_X86_USE_3DNOW) += mmx.o
-obj-y = msr-on-cpu.o
+obj-$(CONFIG_SMP) += msr-on-cpu.o
--- linux-2.6.20-mm1/arch/x86_64/lib/Makefile.old 2007-02-16 14:13:52.000000000 +0100
+++ linux-2.6.20-mm1/arch/x86_64/lib/Makefile 2007-02-16 14:14:14.000000000 +0100
@@ -4,7 +4,8 @@
CFLAGS_csum-partial.o := -funroll-loops
-obj-y := io.o iomap_copy.o msr-on-cpu.o
+obj-y := io.o iomap_copy.o
+obj-$(CONFIG_SMP) += msr-on-cpu.o
lib-y := csum-partial.o csum-copy.o csum-wrappers.o delay.o \
usercopy.o getuser.o putuser.o \
--- linux-2.6.20-mm1/include/asm-i386/msr.h.old 2007-02-16 14:14:43.000000000 +0100
+++ linux-2.6.20-mm1/include/asm-i386/msr.h 2007-02-16 14:16:00.000000000 +0100
@@ -83,8 +83,19 @@
: "c" (counter))
#endif /* !CONFIG_PARAVIRT */
+#ifdef CONFIG_SMP
void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h);
void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h);
+#else /* CONFIG_SMP */
+static inline void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h)
+{
+ rdmsr(msr_no, *l, *h);
+}
+static inline void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
+{
+ wrmsr(msr_no, l, h);
+}
+#endif /* CONFIG_SMP */
/* symbolic names for some interesting MSRs */
/* Intel defined MSRs. */
--- linux-2.6.20-mm1/include/asm-x86_64/msr.h.old 2007-02-16 14:16:12.000000000 +0100
+++ linux-2.6.20-mm1/include/asm-x86_64/msr.h 2007-02-16 14:16:50.000000000 +0100
@@ -160,8 +160,19 @@
#define MSR_IA32_UCODE_WRITE 0x79
#define MSR_IA32_UCODE_REV 0x8b
+#ifdef CONFIG_SMP
void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h);
void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h);
+#else /* CONFIG_SMP */
+static inline void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h)
+{
+ rdmsr(msr_no, *l, *h);
+}
+static inline void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
+{
+ wrmsr(msr_no, l, h);
+}
+#endif /* CONFIG_SMP */
#endif
--- linux-2.6.20-mm1/arch/i386/lib/msr-on-cpu.c.old 2007-02-16 14:17:06.000000000 +0100
+++ linux-2.6.20-mm1/arch/i386/lib/msr-on-cpu.c 2007-02-16 14:17:49.000000000 +0100
@@ -3,7 +3,6 @@
#include <linux/smp.h>
#include <asm/msr.h>
-#ifdef CONFIG_SMP
struct msr_info {
u32 msr_no;
u32 l, h;
@@ -54,17 +53,6 @@
}
preempt_enable();
}
-#else
-void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h)
-{
- rdmsr(msr_no, *l, *h);
-}
-
-void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
-{
- wrmsr(msr_no, l, h);
-}
-#endif
EXPORT_SYMBOL(rdmsr_on_cpu);
EXPORT_SYMBOL(wrmsr_on_cpu);
next prev parent reply other threads:[~2007-02-20 0:20 UTC|newest]
Thread overview: 81+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-15 13:14 2.6.20-mm1 Andrew Morton
2007-02-15 14:28 ` 2.6.20-mm1 [kernel BUG at mm/swap.c:442] James Morris
2007-02-15 14:37 ` James Morris
2007-02-15 21:51 ` Andrew Morton
2007-02-15 22:39 ` Christoph Lameter
2007-02-16 14:30 ` James Morris
2007-02-16 14:59 ` James Morris
2007-02-16 15:57 ` Christoph Lameter
2007-02-16 21:28 ` James Morris
2007-02-15 14:37 ` 2.6.20-mm1 Michal Piotrowski
2007-02-15 22:02 ` 2.6.20-mm1 Andrew Morton
2007-02-15 22:38 ` 2.6.20-mm1 Eric W. Biederman
2007-02-15 23:24 ` 2.6.20-mm1 Michal Piotrowski
2007-02-16 0:04 ` [PATCH] shm: Fix the locking and cleanup error handling in do_shmat Eric W. Biederman
2007-02-16 0:16 ` Michal Piotrowski
2007-02-16 0:21 ` Michal Piotrowski
2007-02-16 3:34 ` Eric W. Biederman
2007-02-16 4:10 ` Wu, Bryan
2007-02-16 0:16 ` 2.6.20-mm1 Andrew Morton
2007-02-15 15:01 ` [-mm patch] MARKERS should depend on, not select MODULES Adrian Bunk
2007-02-15 19:27 ` Mathieu Desnoyers
2007-02-15 16:01 ` sparse chokes on arch/i386/kernel/i8253.c (was: 2.6.20-mm1) Tilman Schmidt
2007-02-15 22:41 ` Andrew Morton
2007-02-15 22:46 ` Mathieu Desnoyers
2007-02-15 23:44 ` Andrew Morton
2007-02-16 0:37 ` Mathieu Desnoyers
2007-02-16 1:22 ` Andrew Morton
2007-02-16 18:05 ` [PATCH] Move include linux/marker.h to kernel.h Mathieu Desnoyers
2007-02-16 18:43 ` Andrew Morton
2007-02-16 18:52 ` [PATCH] Move include linux/marker.h from Makefile Mathieu Desnoyers
2007-02-17 12:50 ` [PATCH] Move include linux/marker.h to kernel.h Tim Schmielau
2007-02-16 0:23 ` [PATCH] sparse chokes on arch/i386/kernel/i8253.c Mathieu Desnoyers
2007-02-16 0:37 ` Andrew Morton
2007-02-16 0:58 ` Mathieu Desnoyers
2007-02-16 1:31 ` Andrew Morton
2007-02-15 16:27 ` 2.6.20-mm1 Artem Bityutskiy
2007-02-15 17:33 ` 2.6.20-mm1 Valdis.Kletnieks
2007-02-15 18:00 ` 2.6.20-mm1 Marcin Juszkiewicz
2007-02-15 18:27 ` 2.6.20-mm1 Richard Purdie
2007-02-15 19:29 ` 2.6.20-mm1 Mattia Dongili
2007-02-15 19:39 ` 2.6.20-mm1 Richard Purdie
2007-02-15 21:30 ` 2.6.20-mm1 J.A. Magallón
2007-02-15 23:31 ` 2.6.20-mm1 Andrew Morton
2007-02-15 23:39 ` 2.6.20-mm1 J.A. Magallón
2007-02-16 5:30 ` 2.6.20-mm1 Andrew Morton
2007-02-16 23:50 ` 2.6.20-mm1 J.A. Magallón
2007-02-15 22:51 ` 2.6.20-mm1 Bartlomiej Zolnierkiewicz
2007-02-15 23:56 ` [PATCH 1/1] unify queue_delayed_work and queue_delayed_work_on fix Jiri Slaby
2007-02-16 0:10 ` Jiri Slaby
2007-02-16 13:55 ` Oleg Nesterov
2007-02-16 16:37 ` 2.6.20-mm1 Steve Fox
2007-02-16 16:55 ` 2.6.20-mm1 Randy Dunlap
2007-02-19 16:10 ` 2.6.20-mm1 Steve Fox
2007-02-16 16:41 ` [-mm patch] pci_iomap_regions error handling fix (was Re: 2.6.20-mm1) Frederik Deweerdt
2007-02-15 23:50 ` Andrew Morton
2007-02-16 17:14 ` 2.6.20-mm1 - undefined reference to `delete_module' on x86 Steve Fox
2007-02-16 18:37 ` Andrew Morton
2007-02-20 0:02 ` [-mm patch] make struct vmi_ops static Adrian Bunk
2007-02-20 0:02 ` [-mm patch] marker exports must be EXPORT_SYMBOL_GPL Adrian Bunk
2007-02-20 23:15 ` Mathieu Desnoyers
2007-02-20 0:07 ` Adrian Bunk [this message]
2007-02-20 0:14 ` [-mm patch] {rd,wr}msr_on_cpu SMP=n optimization Dave Jones
2007-02-20 0:21 ` Adrian Bunk
2007-02-20 0:29 ` Dave Jones
2007-02-20 13:50 ` Alexey Dobriyan
2007-02-20 19:25 ` Dave Jones
2007-02-20 0:07 ` [-mm patch] drivers/net/vioc/: possible cleanups Adrian Bunk
2007-02-20 0:07 ` [-mm patch] make dvb_usb_gl861_debug static Adrian Bunk
2007-02-20 16:13 ` [v4l-dvb-maintainer] " Michael Krufky
2007-02-20 0:07 ` [-mm patch] make pvr2_encoder_prep_config() static Adrian Bunk
2007-02-20 0:07 ` [-mm patch] make drivers/usb/misc/iowarrior.c:iowarrior_ids[] static Adrian Bunk
2007-02-20 0:07 ` [-mm patch] make fs/partitions/msdos.c:check_sane_values() static Adrian Bunk
2007-02-20 0:07 ` [-mm patch] make kernel/kmod.c:kmod_mk static Adrian Bunk
2007-02-20 0:07 ` [-mm patch] make ipc/shm.c:shm_nopage() static Adrian Bunk
2007-02-20 2:13 ` Eric W. Biederman
2007-02-20 0:07 ` [-mm patch] mm/{,tiny-}shmem.c cleanups Adrian Bunk
2007-02-20 0:08 ` 2.6.20-mm1: PTRACE=y, PROC_FS=n compile error Adrian Bunk
2007-02-21 10:15 ` Roland McGrath
2007-02-22 3:35 ` Christoph Hellwig
2007-02-20 0:08 ` [-mm patch] include/linux/ptrace.h must #include <linux/errno.h> Adrian Bunk
2007-02-21 9:57 ` Roland McGrath
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=20070220000713.GP13958@stusta.de \
--to=bunk@stusta.de \
--cc=adobriyan@openvz.org \
--cc=akpm@linux-foundation.org \
--cc=davej@codemonkey.org.uk \
--cc=linux-kernel@vger.kernel.org \
/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 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).