mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yinghai Lu <yinghai@kernel.org>
To: Arkadiusz Miskiewicz <a.miskiewicz@gmail.com>,
	Ingo Molnar <mingo@elte.hu>, "H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: "Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>,
	"Siddha, Suresh B" <suresh.b.siddha@intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: 2.6.29 git master and PAT problems
Date: Tue, 31 Mar 2009 13:45:17 -0700	[thread overview]
Message-ID: <86802c440903311345h2f07977fr5a4b47fe652944b3@mail.gmail.com> (raw)
In-Reply-To: <200903310944.32883.a.miskiewicz@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 5293 bytes --]

On Tue, Mar 31, 2009 at 12:44 AM, Arkadiusz Miskiewicz
<a.miskiewicz@gmail.com> wrote:
> On Tuesday 31 of March 2009, Pallipadi, Venkatesh wrote:
>> On Mon, Mar 30, 2009 at 04:25:11PM -0700, Arkadiusz Miskiewicz wrote:
>> > On Tuesday 31 of March 2009, Arkadiusz Miskiewicz wrote:
>> > > On Monday 30 of March 2009, Pallipadi, Venkatesh wrote:
>> > >
>> > > More info follows. Now I've switched to
>> > > e1c502482853f84606928f5a2f2eb6da1993cda1 which contains latest drm
>> > > fixes and now I get much lower numbers of PAT errors but still.
>> >
>> > Also when I switch t400 into discrete mode (radeon hd 3400 instead
>> > of integrated intel GM45) I get such errors (probably unrelated
>> > to these seen when using intel):
>> >
>> > [  419.187657] X:10550 conflicting memory types cfff0000-d0000000
>> > uncached<->uncached-minus [  419.187670] reserve_memtype failed
>> > 0xcfff0000-0xd0000000, track uncached, req write-back [  419.553914]
>> > X:10550 conflicting memory types cfff0000-d0000000
>> > uncached<->uncached-minus [  419.553923] reserve_memtype failed
>> > 0xcfff0000-0xd0000000, track uncached, req write-back [  419.813592]
>> > X:10550 conflicting memory types cfff0000-d0000000
>> > uncached<->uncached-minus [  419.813601] reserve_memtype failed
>> > 0xcfff0000-0xd0000000, track uncached, req write-back [  420.100102]
>> > X:10550 conflicting memory types cfff0000-d0000000
>> > uncached<->uncached-minus [  420.100111] reserve_memtype failed
>> > 0xcfff0000-0xd0000000, track uncached, req write-back
>>
>> Yes. This is a different problem than the freeing invalid type one. Are
>> these errors also with latest git kernel? Can you try the patch below
>> (which is a part of a bigger cleanup patch I have lined up).
>
> It's a latest git kernel as of today morning
> (latest commit is 15f7176eb1cccec0a332541285ee752b935c1c85)
> + your patch. Problem persists:
>
> [   74.696353] [drm] Setting GART location based on new memory map
> [   74.711520] [drm] Loading RV620 CP Microcode
> [   74.711792] [drm] Loading RV620 PFP Microcode
> [   74.726719] [drm] Resetting GPU
> [   74.726776] [drm] writeback test succeeded in 1 usecs
> [   75.256034] X:5366 conflicting memory types d0000000-e0000000 uncached-minus<->write-combining
> [   75.256043] reserve_memtype failed 0xd0000000-0xe0000000, track uncached-minus, req write-back
> [   75.849951] X:5366 conflicting memory types d0000000-e0000000 uncached-minus<->write-combining
> [   75.849960] reserve_memtype failed 0xd0000000-0xe0000000, track uncached-minus, req write-back
> [   76.054374] X:5366 conflicting memory types d0000000-e0000000 uncached-minus<->write-combining
> [   76.054377] reserve_memtype failed 0xd0000000-0xe0000000, track uncached-minus, req write-back
> [   76.074481] X:5378 freeing invalid memtype d0000000-e0000000
> [   76.176881] X:5366 conflicting memory types d0000000-e0000000 uncached-minus<->write-combining
> [   76.176885] reserve_memtype failed 0xd0000000-0xe0000000, track uncached-minus, req write-back
> [   76.207734] X:5380 freeing invalid memtype d0000000-e0000000
>
> cat /debug/x86/pat_memtype_list
> PAT memtype list:
> uncached-minus @ 0xbfad1000-0xbfad2000
> uncached-minus @ 0xbfad2000-0xbfad3000
> uncached-minus @ 0xbfad3000-0xbfad4000
> uncached-minus @ 0xbfb06000-0xbfb07000
> uncached-minus @ 0xbfb07000-0xbfb08000
> uncached-minus @ 0xbfd6a000-0xbfd6b000
> uncached-minus @ 0xbfd6a000-0xbfd6b000
> uncached-minus @ 0xbfd6a000-0xbfd7a000
> uncached-minus @ 0xbfd79000-0xbfd7a000
> uncached-minus @ 0xbfd79000-0xbfd7a000
> uncached-minus @ 0xbfd79000-0xbfd7a000
> uncached-minus @ 0xbfd79000-0xbfd7a000
> uncached-minus @ 0xbfd79000-0xbfd7a000
> uncached-minus @ 0xbfd79000-0xbfd7a000
> uncached-minus @ 0xbfd79000-0xbfd7a000
> uncached-minus @ 0xbfd7b000-0xbfd7c000
> uncached-minus @ 0xbfd8d000-0xbfd8e000
> uncached-minus @ 0xbfd8e000-0xbfd8f000
> uncached-minus @ 0xbfd8e000-0xbfd8f000
> uncached-minus @ 0xcfff0000-0xd0000000
> uncached-minus @ 0xcfff0000-0xd0000000
> uncached-minus @ 0xcfff0000-0xd0000000
> uncached-minus @ 0xcfff0000-0xd0000000
> uncached-minus @ 0xcfff0000-0xd0000000
> write-combining @ 0xdfff0000-0xe0000000
> uncached-minus @ 0xe0000000-0xe4000000
> uncached-minus @ 0xf4200000-0xf4202000
> uncached-minus @ 0xf4300000-0xf4301000
> uncached-minus @ 0xf4301000-0xf4302000
> uncached-minus @ 0xf4301000-0xf4302000
> uncached-minus @ 0xfc200000-0xfc220000
> uncached-minus @ 0xfc220000-0xfc224000
> uncached-minus @ 0xfc225000-0xfc226000
> uncached-minus @ 0xfc226000-0xfc227000
> uncached-minus @ 0xfc226000-0xfc227000
> uncached-minus @ 0xfc227000-0xfc228000
> uncached-minus @ 0xfed00000-0xfed01000
> uncached-minus @ 0xfed1f000-0xfed20000
> cat /proc/mtrr
> reg00: base=0x13c000000 ( 5056MB), size=   64MB, count=1: uncachable
> reg01: base=0x000000000 (    0MB), size= 2048MB, count=1: write-back
> reg02: base=0x080000000 ( 2048MB), size= 1024MB, count=1: write-back
> reg03: base=0x100000000 ( 4096MB), size= 1024MB, count=1: write-back
> reg04: base=0x0d0000000 ( 3328MB), size=  256MB, count=1: write-combining
>

please try on attached patch on top on tip/master

http://people.redhat.com/mingo/tip.git/readme.txt

YH

[-- Attachment #2: pat_fix.patch --]
[-- Type: text/x-patch, Size: 2895 bytes --]

---
 arch/x86/mm/pat.c |   35 +++++++++++++++--------------------
 1 file changed, 15 insertions(+), 20 deletions(-)

Index: linux-2.6/arch/x86/mm/pat.c
===================================================================
--- linux-2.6.orig/arch/x86/mm/pat.c
+++ linux-2.6/arch/x86/mm/pat.c
@@ -31,7 +31,7 @@
 #ifdef CONFIG_X86_PAT
 int __read_mostly pat_enabled = 1;
 
-void __cpuinit pat_disable(const char *reason)
+static void __cpuinit pat_disable(const char *reason)
 {
 	pat_enabled = 0;
 	printk(KERN_INFO "%s\n", reason);
@@ -176,9 +176,9 @@ static unsigned long pat_x_mtrr_type(u64
 {
 	/*
 	 * Look for MTRR hint to get the effective type in case where PAT
-	 * request is for WB.
+	 * request is for WB or WC.
 	 */
-	if (req_type == _PAGE_CACHE_WB) {
+	if (req_type == _PAGE_CACHE_WB || req_type == _PAGE_CACHE_WC) {
 		u8 mtrr_type;
 
 		mtrr_type = mtrr_type_lookup(start, end);
@@ -191,10 +191,15 @@ static unsigned long pat_x_mtrr_type(u64
 	return req_type;
 }
 
+static unsigned long real_type(struct memtype *entry)
+{
+	return pat_x_mtrr_type(entry->start, entry->end, entry->type);
+}
+
 static int
 chk_conflict(struct memtype *new, struct memtype *entry, unsigned long *type)
 {
-	if (new->type != entry->type) {
+	if (real_type(new) != real_type(entry)) {
 		if (type) {
 			new->type = entry->type;
 			*type = entry->type;
@@ -206,15 +211,16 @@ chk_conflict(struct memtype *new, struct
 	list_for_each_entry_continue(entry, &memtype_list, nd) {
 		if (new->end <= entry->start)
 			break;
-		else if (new->type != entry->type)
+		else if (real_type(new) != real_type(entry))
 			goto conflict;
 	}
 	return 0;
 
  conflict:
 	printk(KERN_INFO "%s:%d conflicting memory types "
-	       "%Lx-%Lx %s<->%s\n", current->comm, current->pid, new->start,
-	       new->end, cattr_name(new->type), cattr_name(entry->type));
+	       "%Lx-%Lx %s <-> %Lx-%Lx%s\n", current->comm, current->pid,
+	       new->start, new->end, cattr_name(new->type),
+	       entry->start, entry->end, cattr_name(entry->type));
 	return -EBUSY;
 }
 
@@ -353,18 +359,7 @@ int reserve_memtype(u64 start, u64 end,
 	}
 
 	if (req_type == -1) {
-		/*
-		 * Call mtrr_lookup to get the type hint. This is an
-		 * optimization for /dev/mem mmap'ers into WB memory (BIOS
-		 * tools and ACPI tools). Use WB request for WB memory and use
-		 * UC_MINUS otherwise.
-		 */
-		u8 mtrr_type = mtrr_type_lookup(start, end);
-
-		if (mtrr_type == MTRR_TYPE_WRBACK)
-			actual_type = _PAGE_CACHE_WB;
-		else
-			actual_type = _PAGE_CACHE_UC_MINUS;
+		actual_type = pat_x_mtrr_type(start, end, _PAGE_CACHE_WB);
 	} else {
 		actual_type = pat_x_mtrr_type(start, end,
 					      req_type & _PAGE_CACHE_MASK);
@@ -386,7 +381,7 @@ int reserve_memtype(u64 start, u64 end,
 
 	new->start	= start;
 	new->end	= end;
-	new->type	= actual_type;
+	new->type	= req_type & _PAGE_CACHE_MASK;
 
 	spin_lock(&memtype_lock);
 

  reply	other threads:[~2009-03-31 20:45 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-30 21:17 Arkadiusz Miskiewicz
2009-03-30 21:22 ` Pallipadi, Venkatesh
2009-03-30 21:31   ` Arkadiusz Miskiewicz
2009-03-30 21:45     ` Pallipadi, Venkatesh
2009-03-30 22:31       ` Arkadiusz Miskiewicz
2009-03-30 23:25         ` Arkadiusz Miskiewicz
2009-03-31  0:21           ` Pallipadi, Venkatesh
2009-03-31  7:44             ` Arkadiusz Miskiewicz
2009-03-31 20:45               ` Yinghai Lu [this message]
2009-04-01 12:10                 ` Arkadiusz Miskiewicz
2009-03-31 23:21               ` Pallipadi, Venkatesh
2009-04-01 10:23                 ` Arkadiusz Miskiewicz
2009-04-01 23:04                   ` Pallipadi, Venkatesh
2009-04-02  6:40                     ` Arkadiusz Miskiewicz
2009-03-31  0:28         ` Pallipadi, Venkatesh
2009-04-02  0:49           ` Pallipadi, Venkatesh
2009-04-03  9:53             ` Alessandro Suardi
2009-04-03 13:59               ` Pallipadi, Venkatesh
2009-04-06 15:37                 ` Alessandro Suardi
2009-04-06 18:40                   ` Pallipadi, Venkatesh
     [not found]             ` <200904020912.23071.a.miskiewicz@gmail.com>
2009-04-06 22:52               ` Pallipadi, Venkatesh
2009-04-07  9:12                 ` Arkadiusz Miskiewicz
2009-04-08  1:30                   ` Pallipadi, Venkatesh
2009-04-08  7:28                     ` Arkadiusz Miskiewicz
2009-04-08  8:17                       ` Ingo Molnar
2009-04-08 22:37                         ` Pallipadi, Venkatesh
2009-04-15 17:45                           ` Arkadiusz Miskiewicz
2009-04-15 18:12                             ` Pallipadi, Venkatesh
2009-04-16 22:47                           ` [tip:x86/urgent] x86, PAT: Remove page granularity tracking for vm_insert_pfn maps tip-bot for Pallipadi, Venkatesh

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=86802c440903311345h2f07977fr5a4b47fe652944b3@mail.gmail.com \
    --to=yinghai@kernel.org \
    --cc=a.miskiewicz@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=suresh.b.siddha@intel.com \
    --cc=tglx@linutronix.de \
    --cc=venkatesh.pallipadi@intel.com \
    /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

all inboxes | Powered by JetHome®