public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* mtrr failure, 3.1-rc1
@ 2011-08-25  7:03 Anders Eriksson
  2011-08-25 15:55 ` Linus Torvalds
  2011-08-25 22:10 ` Bob Tracy
  0 siblings, 2 replies; 11+ messages in thread
From: Anders Eriksson @ 2011-08-25  7:03 UTC (permalink / raw)
  To: torvalds, linux-kernel, aeriksson



My old P-II has 640MB ram, but the bios only sets up WC for the first 512, so i 
add this early in the boot process:
echo "base=0x20000000 size=0x8000000 type=write-back" > /proc/mtrr

For reasons I have forgot I also have to add 'disable_mtrr_check' to the 
command line. Works great.

As of merge dc43d9fa73d82083656fb9c02f4823bcdcfb9f91 This no longer works.
Adding that line to /proc/mtrr no longer has any effect (cat /proc/mtrr shows
only the reg00 entry).

Reverting that merge on top of rc3 brings things back to normal and /proc/mtrr 
shows:
reg00: base=0x000000000 (    0MB), size=  512MB, count=1: write-back
reg01: base=0x048000000 ( 1152MB), size=  128MB, count=1: write-combining
reg02: base=0x020000000 (  512MB), size=  128MB, count=2: write-back

Any ideas how to track this down futher? Would be good to get it fixed for 3.1

-Anders



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: mtrr failure, 3.1-rc1
  2011-08-25  7:03 mtrr failure, 3.1-rc1 Anders Eriksson
@ 2011-08-25 15:55 ` Linus Torvalds
  2011-08-25 16:46   ` Tejun Heo
  2011-08-25 22:10 ` Bob Tracy
  1 sibling, 1 reply; 11+ messages in thread
From: Linus Torvalds @ 2011-08-25 15:55 UTC (permalink / raw)
  To: Anders Eriksson, Suresh Siddha, Peter Anvin, Ingo Molnar,
	Tejun Heo, Sergei Shtylyov
  Cc: linux-kernel

Hmm. Some of those commits are marked for stable too.

I'm adding appropriate parties to the discussion (authors and
sign-offs from the five commits that that merge brings in), but it
would also be great if you could bisect exactly which commit broke for
you. You can make it quick by just doing

  git bisect start
  git bisect bad dc43d9fa73d82083656fb9c02f4823bcdcfb9f91
  git bisect good dc43d9fa73d82083656fb9c02f4823bcdcfb9f91^

and it should take just a couple of tests. I *assume* it's the
stop_machine changes by Tejun &co, but who knows..

Anders, is this a single-CPU system?

                            Linus

On Thu, Aug 25, 2011 at 12:03 AM, Anders Eriksson <aeriksson@fastmail.fm> wrote:
>
> My old P-II has 640MB ram, but the bios only sets up WC for the first 512, so i
> add this early in the boot process:
> echo "base=0x20000000 size=0x8000000 type=write-back" > /proc/mtrr
>
> For reasons I have forgot I also have to add 'disable_mtrr_check' to the
> command line. Works great.
>
> As of merge dc43d9fa73d82083656fb9c02f4823bcdcfb9f91 This no longer works.
> Adding that line to /proc/mtrr no longer has any effect (cat /proc/mtrr shows
> only the reg00 entry).
>
> Reverting that merge on top of rc3 brings things back to normal and /proc/mtrr
> shows:
> reg00: base=0x000000000 (    0MB), size=  512MB, count=1: write-back
> reg01: base=0x048000000 ( 1152MB), size=  128MB, count=1: write-combining
> reg02: base=0x020000000 (  512MB), size=  128MB, count=2: write-back
>
> Any ideas how to track this down futher? Would be good to get it fixed for 3.1
>
> -Anders
>
>
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: mtrr failure, 3.1-rc1
  2011-08-25 15:55 ` Linus Torvalds
@ 2011-08-25 16:46   ` Tejun Heo
  2011-08-25 17:21     ` anders eriksson
                       ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Tejun Heo @ 2011-08-25 16:46 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Anders Eriksson, Suresh Siddha, Peter Anvin, Ingo Molnar,
	Sergei Shtylyov, linux-kernel

Hello,

On Thu, Aug 25, 2011 at 08:55:12AM -0700, Linus Torvalds wrote:
> Hmm. Some of those commits are marked for stable too.
> 
> I'm adding appropriate parties to the discussion (authors and
> sign-offs from the five commits that that merge brings in), but it
> would also be great if you could bisect exactly which commit broke for
> you. You can make it quick by just doing
> 
>   git bisect start
>   git bisect bad dc43d9fa73d82083656fb9c02f4823bcdcfb9f91
>   git bisect good dc43d9fa73d82083656fb9c02f4823bcdcfb9f91^
> 
> and it should take just a couple of tests. I *assume* it's the
> stop_machine changes by Tejun &co, but who knows..
> 
> Anders, is this a single-CPU system?

Indeed, while removing custom rendezvous code and switching to
stop_machine, commit 192d8857427d "x86, mtrr: use stop_machine APIs
for doing MTRR rendezvous" completely dropped mtrr setting code on
!CONFIG_SMP.

Anders, if your kernel didn't have SMP turned on, can you please
verify the following patch fixes the problem?

Thanks.

diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c
index 08119a3..6b96110 100644
--- a/arch/x86/kernel/cpu/mtrr/main.c
+++ b/arch/x86/kernel/cpu/mtrr/main.c
@@ -149,7 +149,6 @@ struct set_mtrr_data {
  */
 static int mtrr_rendezvous_handler(void *info)
 {
-#ifdef CONFIG_SMP
 	struct set_mtrr_data *data = info;
 
 	/*
@@ -171,7 +170,6 @@ static int mtrr_rendezvous_handler(void *info)
 	} else if (mtrr_aps_delayed_init || !cpu_online(smp_processor_id())) {
 		mtrr_if->set_all();
 	}
-#endif
 	return 0;
 }
 

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: mtrr failure, 3.1-rc1
  2011-08-25 16:46   ` Tejun Heo
@ 2011-08-25 17:21     ` anders eriksson
  2011-08-25 17:43     ` Suresh Siddha
  2011-08-25 19:47     ` mtrr failure, 3.1-rc1 anders eriksson
  2 siblings, 0 replies; 11+ messages in thread
From: anders eriksson @ 2011-08-25 17:21 UTC (permalink / raw)
  To: Tejun Heo
  Cc: Linus Torvalds, Suresh Siddha, Peter Anvin, Ingo Molnar,
	Sergei Shtylyov, linux-kernel

On 2011-08-25 18:46, Tejun Heo wrote:
> Indeed, while removing custom rendezvous code and switching to
> stop_machine, commit 192d8857427d "x86, mtrr: use stop_machine APIs
> for doing MTRR rendezvous" completely dropped mtrr setting code on
> !CONFIG_SMP.
>
> Anders, if your kernel didn't have SMP turned on, can you please
> verify the following patch fixes the problem?
Yes. It's single CPU compiled with !CONFIG_SMP. I'm compiling w/ this 
patch right now.
Takes a while on vintage equipment... ;-)


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: mtrr failure, 3.1-rc1
  2011-08-25 16:46   ` Tejun Heo
  2011-08-25 17:21     ` anders eriksson
@ 2011-08-25 17:43     ` Suresh Siddha
  2011-08-25 17:43       ` Linus Torvalds
  2011-08-25 19:47     ` mtrr failure, 3.1-rc1 anders eriksson
  2 siblings, 1 reply; 11+ messages in thread
From: Suresh Siddha @ 2011-08-25 17:43 UTC (permalink / raw)
  To: Tejun Heo
  Cc: Linus Torvalds, Anders Eriksson, Peter Anvin, Ingo Molnar,
	Sergei Shtylyov, linux-kernel@vger.kernel.org

On Thu, 2011-08-25 at 09:46 -0700, Tejun Heo wrote:
> Hello,
> 
> On Thu, Aug 25, 2011 at 08:55:12AM -0700, Linus Torvalds wrote:
> > Hmm. Some of those commits are marked for stable too.
> > 
> > I'm adding appropriate parties to the discussion (authors and
> > sign-offs from the five commits that that merge brings in), but it
> > would also be great if you could bisect exactly which commit broke for
> > you. You can make it quick by just doing
> > 
> >   git bisect start
> >   git bisect bad dc43d9fa73d82083656fb9c02f4823bcdcfb9f91
> >   git bisect good dc43d9fa73d82083656fb9c02f4823bcdcfb9f91^
> > 
> > and it should take just a couple of tests. I *assume* it's the
> > stop_machine changes by Tejun &co, but who knows..
> > 
> > Anders, is this a single-CPU system?
> 
> Indeed, while removing custom rendezvous code and switching to
> stop_machine, commit 192d8857427d "x86, mtrr: use stop_machine APIs
> for doing MTRR rendezvous" completely dropped mtrr setting code on
> !CONFIG_SMP.

oops. My bad. Linus, Bad commit is not marked for stable.

I was able to reproduce the issue and tested the below patch. It looks
good.

Thanks.

Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>

> 
> Anders, if your kernel didn't have SMP turned on, can you please
> verify the following patch fixes the problem?
> 
> Thanks.
> 
> diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c
> index 08119a3..6b96110 100644
> --- a/arch/x86/kernel/cpu/mtrr/main.c
> +++ b/arch/x86/kernel/cpu/mtrr/main.c
> @@ -149,7 +149,6 @@ struct set_mtrr_data {
>   */
>  static int mtrr_rendezvous_handler(void *info)
>  {
> -#ifdef CONFIG_SMP
>  	struct set_mtrr_data *data = info;
>  
>  	/*
> @@ -171,7 +170,6 @@ static int mtrr_rendezvous_handler(void *info)
>  	} else if (mtrr_aps_delayed_init || !cpu_online(smp_processor_id())) {
>  		mtrr_if->set_all();
>  	}
> -#endif
>  	return 0;
>  }
>  



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: mtrr failure, 3.1-rc1
  2011-08-25 17:43     ` Suresh Siddha
@ 2011-08-25 17:43       ` Linus Torvalds
  2011-08-25 17:46         ` [PATCH] mtrr: fix UP breakage caused during switch to stop_machine Tejun Heo
  0 siblings, 1 reply; 11+ messages in thread
From: Linus Torvalds @ 2011-08-25 17:43 UTC (permalink / raw)
  To: Suresh Siddha
  Cc: Tejun Heo, Anders Eriksson, Peter Anvin, Ingo Molnar,
	Sergei Shtylyov, linux-kernel@vger.kernel.org

On Thu, Aug 25, 2011 at 10:43 AM, Suresh Siddha
<suresh.b.siddha@intel.com> wrote:
>
> I was able to reproduce the issue and tested the below patch. It looks
> good.
>
> Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>

Tejun, sign-off?

                   Linus

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] mtrr: fix UP breakage caused during switch to stop_machine
  2011-08-25 17:43       ` Linus Torvalds
@ 2011-08-25 17:46         ` Tejun Heo
  2011-08-25 18:00           ` H. Peter Anvin
  0 siblings, 1 reply; 11+ messages in thread
From: Tejun Heo @ 2011-08-25 17:46 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Suresh Siddha, Anders Eriksson, Peter Anvin, Ingo Molnar,
	Sergei Shtylyov, linux-kernel@vger.kernel.org

While removing custom rendezvous code and switching to stop_machine,
commit 192d8857427d "x86, mtrr: use stop_machine APIs for doing MTRR
rendezvous" completely dropped mtrr setting code on !CONFIG_SMP
breaking MTRR settting on UP.  Fix it by removing the incorrect
CONFIG_SMP.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Anders Eriksson <aeriksson@fastmail.fm>
Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
---
 arch/x86/kernel/cpu/mtrr/main.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c
index 08119a3..6b96110 100644
--- a/arch/x86/kernel/cpu/mtrr/main.c
+++ b/arch/x86/kernel/cpu/mtrr/main.c
@@ -149,7 +149,6 @@ struct set_mtrr_data {
  */
 static int mtrr_rendezvous_handler(void *info)
 {
-#ifdef CONFIG_SMP
 	struct set_mtrr_data *data = info;
 
 	/*
@@ -171,7 +170,6 @@ static int mtrr_rendezvous_handler(void *info)
 	} else if (mtrr_aps_delayed_init || !cpu_online(smp_processor_id())) {
 		mtrr_if->set_all();
 	}
-#endif
 	return 0;
 }
 

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] mtrr: fix UP breakage caused during switch to stop_machine
  2011-08-25 17:46         ` [PATCH] mtrr: fix UP breakage caused during switch to stop_machine Tejun Heo
@ 2011-08-25 18:00           ` H. Peter Anvin
  2011-08-25 18:03             ` Linus Torvalds
  0 siblings, 1 reply; 11+ messages in thread
From: H. Peter Anvin @ 2011-08-25 18:00 UTC (permalink / raw)
  To: Tejun Heo
  Cc: Linus Torvalds, Suresh Siddha, Anders Eriksson, Ingo Molnar,
	Sergei Shtylyov, linux-kernel@vger.kernel.org

On 08/25/2011 10:46 AM, Tejun Heo wrote:
> While removing custom rendezvous code and switching to stop_machine,
> commit 192d8857427d "x86, mtrr: use stop_machine APIs for doing MTRR
> rendezvous" completely dropped mtrr setting code on !CONFIG_SMP
> breaking MTRR settting on UP.  Fix it by removing the incorrect
> CONFIG_SMP.
> 
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Reported-by: Anders Eriksson <aeriksson@fastmail.fm>
> Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>
> Cc: Linus Torvalds <torvalds@linux-foundation.org>

Acked-by: H. Peter Anvin <hpa@zytor.com>

Linus, are you picking this up from email or should I put it in x86/urgent?

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] mtrr: fix UP breakage caused during switch to stop_machine
  2011-08-25 18:00           ` H. Peter Anvin
@ 2011-08-25 18:03             ` Linus Torvalds
  0 siblings, 0 replies; 11+ messages in thread
From: Linus Torvalds @ 2011-08-25 18:03 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Tejun Heo, Suresh Siddha, Anders Eriksson, Ingo Molnar,
	Sergei Shtylyov, linux-kernel@vger.kernel.org

On Thu, Aug 25, 2011 at 11:00 AM, H. Peter Anvin <hpa@zytor.com> wrote:
>
> Linus, are you picking this up from email or should I put it in x86/urgent?

I took it directly,

                    Linus

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: mtrr failure, 3.1-rc1
  2011-08-25 16:46   ` Tejun Heo
  2011-08-25 17:21     ` anders eriksson
  2011-08-25 17:43     ` Suresh Siddha
@ 2011-08-25 19:47     ` anders eriksson
  2 siblings, 0 replies; 11+ messages in thread
From: anders eriksson @ 2011-08-25 19:47 UTC (permalink / raw)
  To: Tejun Heo
  Cc: Linus Torvalds, Suresh Siddha, Peter Anvin, Ingo Molnar,
	Sergei Shtylyov, linux-kernel

On 2011-08-25 18:46, Tejun Heo wrote:
> Anders, if your kernel didn't have SMP turned on, can you please
> verify the following patch fixes the problem?
>
> Thanks.
>
> diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c
> index 08119a3..6b96110 100644
> --- a/arch/x86/kernel/cpu/mtrr/main.c
> +++ b/arch/x86/kernel/cpu/mtrr/main.c
> @@ -149,7 +149,6 @@ struct set_mtrr_data {
>    */
>   static int mtrr_rendezvous_handler(void *info)
>   {
> -#ifdef CONFIG_SMP
>   	struct set_mtrr_data *data = info;
>
>   	/*
> @@ -171,7 +170,6 @@ static int mtrr_rendezvous_handler(void *info)
>   	} else if (mtrr_aps_delayed_init || !cpu_online(smp_processor_id())) {
>   		mtrr_if->set_all();
>   	}
> -#endif
>   	return 0;
>   }
>
Tested. Works as expected. Thanks!

-A

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: mtrr failure, 3.1-rc1
  2011-08-25  7:03 mtrr failure, 3.1-rc1 Anders Eriksson
  2011-08-25 15:55 ` Linus Torvalds
@ 2011-08-25 22:10 ` Bob Tracy
  1 sibling, 0 replies; 11+ messages in thread
From: Bob Tracy @ 2011-08-25 22:10 UTC (permalink / raw)
  To: Anders Eriksson; +Cc: torvalds, linux-kernel

On Thu, Aug 25, 2011 at 09:03:35AM +0200, Anders Eriksson wrote:
> (mtrr issues)

Similar MTRR issue here with a K6-III/450, which I noticed when the X11
server was no longer able to allocate/configure a MTRR.  "cat /proc/mtrr"
shows nothing configured regardless of whether the X11 server is running.
I only see a diagnostic message to the effect of the MTRR not existing
when X11 exits.

Possibly significant: prior 3.X kernel versions would cause the X11
server to exit with a corrupted display after about 3-5 invocations.
Machine was otherwise usable, but had to reboot remotely to recover the
console display.  The "no MTRR" issue in 3.1-rc1 has thus far meant no
display corruption on X11 server exit: have run "startx" at least 10
times since booting 3.1-rc1.

-- 
------------------------------------------------------------------------
Bob Tracy          |  "Every normal man must be tempted at times to spit
rct@frus.com       |   upon his hands, hoist the black flag, and begin
                   |   slitting throats."	-- H.L. Mencken
------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-08-25 22:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-25  7:03 mtrr failure, 3.1-rc1 Anders Eriksson
2011-08-25 15:55 ` Linus Torvalds
2011-08-25 16:46   ` Tejun Heo
2011-08-25 17:21     ` anders eriksson
2011-08-25 17:43     ` Suresh Siddha
2011-08-25 17:43       ` Linus Torvalds
2011-08-25 17:46         ` [PATCH] mtrr: fix UP breakage caused during switch to stop_machine Tejun Heo
2011-08-25 18:00           ` H. Peter Anvin
2011-08-25 18:03             ` Linus Torvalds
2011-08-25 19:47     ` mtrr failure, 3.1-rc1 anders eriksson
2011-08-25 22:10 ` Bob Tracy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox