Re: [-mm patch] {rd,wr}msr_on_cpu SMP=n optimization

2007-02-20 Thread Dave Jones
On Tue, Feb 20, 2007 at 04:50:44PM +0300, Alexey Dobriyan wrote:
 > On Mon, Feb 19, 2007 at 07:14:34PM -0500, Dave Jones wrote:
 > > On Tue, Feb 20, 2007 at 01:07:13AM +0100, Adrian Bunk wrote:
 > >  > 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 <[EMAIL PROTECTED]>
 > >  >
 > >  > ---
 > >  >
 > >  > BTW: currently -ENOUSERS
 > >
 > > There was a follow-on patch that converted p4-clockmod to use it for one.
 > 
 > And patch for powernow-k8 in preparations.

Cool. Can you resend me the p4-clockmod diff, I seem to have lost it.
I've just merged up the *msr_on_cpu diff (and will apply Adrians cleanup too).

thanks,

Dave

-- 
http://www.codemonkey.org.uk
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [-mm patch] {rd,wr}msr_on_cpu SMP=n optimization

2007-02-20 Thread Alexey Dobriyan
On Mon, Feb 19, 2007 at 07:14:34PM -0500, Dave Jones wrote:
> On Tue, Feb 20, 2007 at 01:07:13AM +0100, Adrian Bunk wrote:
>  > 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 <[EMAIL PROTECTED]>
>  >
>  > ---
>  >
>  > BTW: currently -ENOUSERS
>
> There was a follow-on patch that converted p4-clockmod to use it for one.

And patch for powernow-k8 in preparations.

>  > +#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  */
>
> BUG_ON(cpu!=smp_processor_id()) maybe?

This make sense. Fell free to add it.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [-mm patch] {rd,wr}msr_on_cpu SMP=n optimization

2007-02-20 Thread Alexey Dobriyan
On Mon, Feb 19, 2007 at 07:14:34PM -0500, Dave Jones wrote:
 On Tue, Feb 20, 2007 at 01:07:13AM +0100, Adrian Bunk wrote:
   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 [EMAIL PROTECTED]
  
   ---
  
   BTW: currently -ENOUSERS

 There was a follow-on patch that converted p4-clockmod to use it for one.

And patch for powernow-k8 in preparations.

   +#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  */

 BUG_ON(cpu!=smp_processor_id()) maybe?

This make sense. Fell free to add it.

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [-mm patch] {rd,wr}msr_on_cpu SMP=n optimization

2007-02-20 Thread Dave Jones
On Tue, Feb 20, 2007 at 04:50:44PM +0300, Alexey Dobriyan wrote:
  On Mon, Feb 19, 2007 at 07:14:34PM -0500, Dave Jones wrote:
   On Tue, Feb 20, 2007 at 01:07:13AM +0100, Adrian Bunk wrote:
 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 [EMAIL PROTECTED]

 ---

 BTW: currently -ENOUSERS
  
   There was a follow-on patch that converted p4-clockmod to use it for one.
  
  And patch for powernow-k8 in preparations.

Cool. Can you resend me the p4-clockmod diff, I seem to have lost it.
I've just merged up the *msr_on_cpu diff (and will apply Adrians cleanup too).

thanks,

Dave

-- 
http://www.codemonkey.org.uk
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [-mm patch] {rd,wr}msr_on_cpu SMP=n optimization

2007-02-19 Thread Dave Jones
On Tue, Feb 20, 2007 at 01:21:45AM +0100, Adrian Bunk wrote:
 > On Mon, Feb 19, 2007 at 07:14:34PM -0500, Dave Jones wrote:
 > > On Tue, Feb 20, 2007 at 01:07:13AM +0100, Adrian Bunk wrote:
 > >...
 > >  > +#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  */
 > > 
 > > BUG_ON(cpu!=smp_processor_id()) maybe?
 > 
 > This is the CONFIG_SMP=n case.

Yes. If someone is asking for the MSR on a specific CPU in UP mode,
it's a bug.

Dave

-- 
http://www.codemonkey.org.uk
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [-mm patch] {rd,wr}msr_on_cpu SMP=n optimization

2007-02-19 Thread Adrian Bunk
On Mon, Feb 19, 2007 at 07:14:34PM -0500, Dave Jones wrote:
> On Tue, Feb 20, 2007 at 01:07:13AM +0100, Adrian Bunk wrote:
>...
>  > +#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  */
> 
> BUG_ON(cpu!=smp_processor_id()) maybe?

This is the CONFIG_SMP=n case.

>   Dave

cu
Adrian

-- 

   "Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
   "Only a promise," Lao Er said.
   Pearl S. Buck - Dragon Seed

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[-mm patch] {rd,wr}msr_on_cpu SMP=n optimization

2007-02-19 Thread Adrian Bunk
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 <[EMAIL PROTECTED]>

---

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.0 
+0100
+++ linux-2.6.20-mm1/arch/i386/lib/Makefile 2007-02-16 14:14:22.0 
+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.0 +0100
+++ linux-2.6.20-mm1/arch/x86_64/lib/Makefile   2007-02-16 14:14:14.0 
+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.0 
+0100
+++ linux-2.6.20-mm1/include/asm-i386/msr.h 2007-02-16 14:16:00.0 
+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.0 +0100
+++ linux-2.6.20-mm1/include/asm-x86_64/msr.h   2007-02-16 14:16:50.0 
+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.0 +0100
+++ linux-2.6.20-mm1/arch/i386/lib/msr-on-cpu.c 2007-02-16 14:17:49.0 
+0100
@@ -3,7 +3,6 @@
 #include 
 #include 
 
-#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);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [-mm patch] {rd,wr}msr_on_cpu SMP=n optimization

2007-02-19 Thread Dave Jones
On Tue, Feb 20, 2007 at 01:07:13AM +0100, Adrian Bunk wrote:
 > 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 <[EMAIL PROTECTED]>
 > 
 > ---
 > 
 > BTW: currently -ENOUSERS

There was a follow-on patch that converted p4-clockmod to use it for one.

 > +#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  */

BUG_ON(cpu!=smp_processor_id()) maybe?

Dave

-- 
http://www.codemonkey.org.uk
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [-mm patch] {rd,wr}msr_on_cpu SMP=n optimization

2007-02-19 Thread Dave Jones
On Tue, Feb 20, 2007 at 01:07:13AM +0100, Adrian Bunk wrote:
  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 [EMAIL PROTECTED]
  
  ---
  
  BTW: currently -ENOUSERS

There was a follow-on patch that converted p4-clockmod to use it for one.

  +#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  */

BUG_ON(cpu!=smp_processor_id()) maybe?

Dave

-- 
http://www.codemonkey.org.uk
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[-mm patch] {rd,wr}msr_on_cpu SMP=n optimization

2007-02-19 Thread Adrian Bunk
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 [EMAIL PROTECTED]

---

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.0 
+0100
+++ linux-2.6.20-mm1/arch/i386/lib/Makefile 2007-02-16 14:14:22.0 
+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.0 +0100
+++ linux-2.6.20-mm1/arch/x86_64/lib/Makefile   2007-02-16 14:14:14.0 
+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.0 
+0100
+++ linux-2.6.20-mm1/include/asm-i386/msr.h 2007-02-16 14:16:00.0 
+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.0 +0100
+++ linux-2.6.20-mm1/include/asm-x86_64/msr.h   2007-02-16 14:16:50.0 
+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.0 +0100
+++ linux-2.6.20-mm1/arch/i386/lib/msr-on-cpu.c 2007-02-16 14:17:49.0 
+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);
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [-mm patch] {rd,wr}msr_on_cpu SMP=n optimization

2007-02-19 Thread Adrian Bunk
On Mon, Feb 19, 2007 at 07:14:34PM -0500, Dave Jones wrote:
 On Tue, Feb 20, 2007 at 01:07:13AM +0100, Adrian Bunk wrote:
...
   +#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  */
 
 BUG_ON(cpu!=smp_processor_id()) maybe?

This is the CONFIG_SMP=n case.

   Dave

cu
Adrian

-- 

   Is there not promise of rain? Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
   Only a promise, Lao Er said.
   Pearl S. Buck - Dragon Seed

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [-mm patch] {rd,wr}msr_on_cpu SMP=n optimization

2007-02-19 Thread Dave Jones
On Tue, Feb 20, 2007 at 01:21:45AM +0100, Adrian Bunk wrote:
  On Mon, Feb 19, 2007 at 07:14:34PM -0500, Dave Jones wrote:
   On Tue, Feb 20, 2007 at 01:07:13AM +0100, Adrian Bunk wrote:
  ...
 +#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  */
   
   BUG_ON(cpu!=smp_processor_id()) maybe?
  
  This is the CONFIG_SMP=n case.

Yes. If someone is asking for the MSR on a specific CPU in UP mode,
it's a bug.

Dave

-- 
http://www.codemonkey.org.uk
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/