2004-11-18 21:23:29

by Magnus Damm

[permalink] [raw]
Subject: e820 and shared VGA memory problem

Heya,

The machine is a Uniwill 223II0 equipped with 2GiB RAM and BIOS
1.03US. The graphics are 855GM, aka "Intel Extreme Graphics 2", ie a
chunk of system RAM is used as graphics memory. The BIOS does not
allow me to setup the amount of VGA RAM.

I am running a vanilla 2.6.9-kernel configured with highmem enabled.

The problem is that the machine is slow as hell if the kernel is
booted without limiting the amount of system ram with the command line
option "ram=xM". And by that I mean that executing user space programs
is _extremely_ slow - I've never taken the time to go through the
rc-scripts.

If I limit down the memory passed to the kernel to 2017M, the
performance is better but still not good. If I limit the amount of RAM
to 2016M everything is fine and dandy.

Funny enough, 2016M is the same as 2048 - 32 MiB. And the log of Xorg say:
..
(==) I810(0): VideoRAM: 32768 kByte
..

The "changelog" for the BIOS between 1.02 and 1.03 say:
..
2-1. VGA default share memory change from 8MB to 16MB
..

And the CMOS setup thinks that the amount of system memory is 2032MB.

This is the e820 output from the kernel when I limit to 2016 MiB.
..
BIOS-provided physical RAM map:
BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 000000007efd0000 (usable)
BIOS-e820: 000000007efd0000 - 000000007efdf000 (ACPI data)
BIOS-e820: 000000007efdf000 - 000000007f000000 (ACPI NVS)
user-defined physical RAM map:
user: 0000000000000000 - 000000000009fc00 (usable)
user: 000000000009fc00 - 00000000000a0000 (reserved)
user: 00000000000e0000 - 0000000000100000 (reserved)
user: 0000000000100000 - 000000007e000000 (usable)
1120MB HIGHMEM available.
896MB LOWMEM available.
...

So, the CMOS setup, the BIOS changelog, the e820 data all seem to
think that 16 MiB are used as VGA RAM. But I suspect that the extreme
slowdowns are because 32 MiB VGA RAM is used. Any ideas? Is the BIOS
funky, or are we doing something wrong in the kernel?

Thanks!

/ magnus


2004-11-18 21:47:48

by Dave Jones

[permalink] [raw]
Subject: Re: e820 and shared VGA memory problem

On Thu, Nov 18, 2004 at 10:20:48PM +0100, Magnus Damm wrote:

> So, the CMOS setup, the BIOS changelog, the e820 data all seem to
> think that 16 MiB are used as VGA RAM. But I suspect that the extreme
> slowdowns are because 32 MiB VGA RAM is used. Any ideas? Is the BIOS
> funky, or are we doing something wrong in the kernel?

In the past such problems have been attributed to BIOS's not
setting up MTRRs correctly, or in extreme situations, running
out of available MTRRS. How does /proc/mtrr look ?

Dave

2004-11-18 21:55:16

by Magnus Damm

[permalink] [raw]
Subject: Re: e820 and shared VGA memory problem

On Thu, 18 Nov 2004 16:44:31 -0500, Dave Jones <[email protected]> wrote:
> In the past such problems have been attributed to BIOS's not
> setting up MTRRs correctly, or in extreme situations, running
> out of available MTRRS. How does /proc/mtrr look ?

reg00: base=0x00000000 ( 0MB), size=1024MB: write-back, count=1
reg01: base=0x40000000 (1024MB), size= 512MB: write-back, count=1
reg02: base=0x60000000 (1536MB), size= 256MB: write-back, count=1
reg03: base=0x70000000 (1792MB), size= 128MB: write-back, count=1
reg04: base=0x78000000 (1920MB), size= 64MB: write-back, count=1
reg05: base=0x7c000000 (1984MB), size= 32MB: write-back, count=1
reg06: base=0xf0000000 (3840MB), size= 128MB: write-combining, count=1

Thanks!

/ magnus

2004-11-18 21:59:18

by Pallipadi, Venkatesh

[permalink] [raw]
Subject: RE: e820 and shared VGA memory problem



>-----Original Message-----
>From: [email protected]
>[mailto:[email protected]] On Behalf Of Magnus Damm
>Sent: Thursday, November 18, 2004 1:21 PM
>To: [email protected]
>Subject: e820 and shared VGA memory problem
>
>Heya,
>
>The machine is a Uniwill 223II0 equipped with 2GiB RAM and BIOS
>1.03US. The graphics are 855GM, aka "Intel Extreme Graphics 2", ie a
>chunk of system RAM is used as graphics memory. The BIOS does not
>allow me to setup the amount of VGA RAM.
>
>I am running a vanilla 2.6.9-kernel configured with highmem enabled.
>
>The problem is that the machine is slow as hell if the kernel is
>booted without limiting the amount of system ram with the command line
>option "ram=xM". And by that I mean that executing user space programs
>is _extremely_ slow - I've never taken the time to go through the
>rc-scripts.
>

What does your mtrr settings say? Can you get output of /proc/mtrr for
both case: System running fine with "mem=" and system being slow when
there is no "mem=".

I have seen similar problems on different hardware. And the issue was
due to the fact that BIOS mtrr setting and BIOS E820 doesn't agree with
each other regarding the usable memory. BIOS says some part of memory as
usable in E820 and sets mtrr as uncacheable to the same memory range.

-Venki

2004-11-18 22:16:30

by Pallipadi, Venkatesh

[permalink] [raw]
Subject: RE: e820 and shared VGA memory problem



>-----Original Message-----
>From: Pallipadi, Venkatesh
>Sent: Thursday, November 18, 2004 2:09 PM
>To: 'Magnus Damm'; Dave Jones; [email protected]
>Subject: RE: e820 and shared VGA memory problem
>
>
>
>>-----Original Message-----
>>From: [email protected]
>>[mailto:[email protected]] On Behalf Of Magnus Damm
>>Sent: Thursday, November 18, 2004 1:50 PM
>>To: Dave Jones; Magnus Damm; [email protected]
>>Subject: Re: e820 and shared VGA memory problem
>>
>>On Thu, 18 Nov 2004 16:44:31 -0500, Dave Jones
>><[email protected]> wrote:
>>> In the past such problems have been attributed to BIOS's not
>>> setting up MTRRs correctly, or in extreme situations, running
>>> out of available MTRRS. How does /proc/mtrr look ?
>>
>>reg00: base=0x00000000 ( 0MB), size=1024MB: write-back, count=1
>>reg01: base=0x40000000 (1024MB), size= 512MB: write-back, count=1
>>reg02: base=0x60000000 (1536MB), size= 256MB: write-back, count=1
>>reg03: base=0x70000000 (1792MB), size= 128MB: write-back, count=1
>>reg04: base=0x78000000 (1920MB), size= 64MB: write-back, count=1
>>reg05: base=0x7c000000 (1984MB), size= 32MB: write-back, count=1
>
>The issue is with the bad MTRR setting by BIOS.
>It only sets 0-2016MB as write-back. 2016MB-2048MB is set as
>uncached. Due to this whenever you use that memory you will
>see the slowness. Probably BIOS is assuming that Video will
>always use 32MB.
>

Oops. Probably I spoke a bit too early. Was this mtrr setting for the
working (mem=2026M) case?
Can you get mtrr for one of the non-working case.

-Venki

2004-11-18 22:15:13

by Pallipadi, Venkatesh

[permalink] [raw]
Subject: RE: e820 and shared VGA memory problem



>-----Original Message-----
>From: [email protected]
>[mailto:[email protected]] On Behalf Of Magnus Damm
>Sent: Thursday, November 18, 2004 1:50 PM
>To: Dave Jones; Magnus Damm; [email protected]
>Subject: Re: e820 and shared VGA memory problem
>
>On Thu, 18 Nov 2004 16:44:31 -0500, Dave Jones
><[email protected]> wrote:
>> In the past such problems have been attributed to BIOS's not
>> setting up MTRRs correctly, or in extreme situations, running
>> out of available MTRRS. How does /proc/mtrr look ?
>
>reg00: base=0x00000000 ( 0MB), size=1024MB: write-back, count=1
>reg01: base=0x40000000 (1024MB), size= 512MB: write-back, count=1
>reg02: base=0x60000000 (1536MB), size= 256MB: write-back, count=1
>reg03: base=0x70000000 (1792MB), size= 128MB: write-back, count=1
>reg04: base=0x78000000 (1920MB), size= 64MB: write-back, count=1
>reg05: base=0x7c000000 (1984MB), size= 32MB: write-back, count=1

The issue is with the bad MTRR setting by BIOS.
It only sets 0-2016MB as write-back. 2016MB-2048MB is set as uncached.
Due to this whenever you use that memory you will see the slowness.
Probably BIOS is assuming that Video will always use 32MB.

-Venki