| View previous topic :: View next topic |
| Author |
Message |
termite Guru

Joined: 06 May 2007 Posts: 465
|
Posted: Tue Aug 05, 2008 2:37 pm Post subject: |
|
|
| The new kernel won't get to portage (except git-sources, where it will be soon) until 2.6.27 is released in 2-3 months. |
|
| Back to top |
|
 |
alex.blackbit Veteran

Joined: 26 Jul 2005 Posts: 2113
|
Posted: Tue Aug 05, 2008 4:57 pm Post subject: |
|
|
i have similar problems and just tried out kernel 2.6.27-rc1 with CONFIG_MTRR_SANITIZER, but that did not help. | Code: | # grep -E "(^\(WW\)|^\(EE\)|^\(NI\)|^\(??\))" /var/log/Xorg.0.log
(WW) VESA(0): Failed to set up write-combining range (0xd8000000,0x2000000)
# cat /proc/mtrr
reg00: base=0x00000000 ( 0MB), size=198656MB: write-back, count=1
reg01: base=0x80000000 (2048MB), size=197632MB: write-back, count=1
reg02: base=0x100000000 (4096MB), size=197632MB: write-back, count=1
# grep MemTotal /proc/meminfo
MemTotal: 4041308 kB
# |
32Mbyte for the graphics adapter is correct.
in which order should i disable the mtrr's?
and what ranges should i set up afterwards? i do not really get the point, how large should the ranges before and after the graphics adapter be?
could someone please give me the echo commands i need? |
|
| Back to top |
|
 |
termite Guru

Joined: 06 May 2007 Posts: 465
|
Posted: Tue Aug 05, 2008 5:16 pm Post subject: |
|
|
Try | Quote: | CONFIG_MTRR=y
CONFIG_MTRR_SANITIZER=y
CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=1
CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1 | and add | Quote: | | mtrr_gran_size=64m mtrr_chunk_size=1024m | to your kernel options. |
|
| Back to top |
|
 |
alex.blackbit Veteran

Joined: 26 Jul 2005 Posts: 2113
|
Posted: Tue Aug 05, 2008 5:35 pm Post subject: |
|
|
ok, i'll give that a try, i had CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=0
why should i set mtrr_gran_size to 64m? |
|
| Back to top |
|
 |
alex.blackbit Veteran

Joined: 26 Jul 2005 Posts: 2113
|
Posted: Tue Aug 05, 2008 5:40 pm Post subject: |
|
|
i just rebooted with the new kernel and options. nothing changed. |
|
| Back to top |
|
 |
termite Guru

Joined: 06 May 2007 Posts: 465
|
Posted: Tue Aug 05, 2008 9:32 pm Post subject: |
|
|
| ok, then you should email LKML, because that's supposed to fix it. |
|
| Back to top |
|
 |
alex.blackbit Veteran

Joined: 26 Jul 2005 Posts: 2113
|
Posted: Wed Aug 06, 2008 8:25 am Post subject: |
|
|
ok, termite. could you help me doing that?
i never posted on the LKML before and do not want to make any mistakes. |
|
| Back to top |
|
 |
termite Guru

Joined: 06 May 2007 Posts: 465
|
Posted: Wed Aug 06, 2008 8:36 am Post subject: |
|
|
Send an email to linux-kernel@vger.kernel.org.
Detail the kernel and distro you're running, what the problem is (including details such as /proc/mtrr and any relevant parts of dmesg) and the last kernel version it worked with (if ever).
Detail also the fixes you've tried, especially these latest kernel options (and add in any changes those attempted fixes have made to /proc/mtrr and dmesg).
Ask to be cc'd on replies, since you're not subscribed to the list. Mostly likely, a guy called Yinghai Lu will reply to you and ask you to do some diagnostics that should eventually fix things.
PS Sorry I'm not more helpful - I'd like this problem to be permanently solved rather than providing individual fixes. |
|
| Back to top |
|
 |
alex.blackbit Veteran

Joined: 26 Jul 2005 Posts: 2113
|
Posted: Wed Aug 06, 2008 9:13 am Post subject: |
|
|
| thanks. mail sent. hopefully somebody replies. |
|
| Back to top |
|
 |
termite Guru

Joined: 06 May 2007 Posts: 465
|
Posted: Wed Aug 06, 2008 9:25 am Post subject: |
|
|
| If you do get it fixed, please come back and write how. |
|
| Back to top |
|
 |
rejon n00b

Joined: 11 Aug 2007 Posts: 4
|
|
| Back to top |
|
 |
alex.blackbit Veteran

Joined: 26 Jul 2005 Posts: 2113
|
Posted: Wed Aug 06, 2008 11:10 am Post subject: |
|
|
okay, until i get a answer from LKML, i have some basic questions.
when i try to fix the stuff manually... the order of disabling seems to be important.
is it the range that starts at 0 that should be disabled last? if yes, then why? where is this info from?
when recreating the ranges, it seems i should create ranges with sizes in powers of two until i reach the start of the graphics adapter memory, right?
if yes, then why? where is this info from?
my graphics adapter memory seems to start at 3456MB, that would mean i should do: 3072+256+128, right? then add my cute 32mb graphics adapter memory, and from then on the rest? these are 608M in my case. or should i do 512+64+32 there too?
when i come home, i will try the following script: | Code: | #!/bin/bash
echo "disable=2" >| /proc/mtrr
echo "\"disable=2\" >| /proc/mtrr"
echo "disable=1" >| /proc/mtrr
echo "\"disable=1\" >| /proc/mtrr"
echo "disable=0" >| /proc/mtrr
echo "\"disable=0\" >| /proc/mtrr"
#base 0 + 3072M
echo "base=0x00000000 size=0xC0000000 type=write-back" >| /proc/mtrr
echo \""base=0x00000000 size=0xC0000000 type=write-back\" >| /proc/mtrr"
#base 3072 + 256M
echo "base=0xC0000000 size=0x10000000 type=write-back" >| /proc/mtrr
echo \""base=0xC0000000 size=0x10000000 type=write-back\" >| /proc/mtrr"
#base 3328 + 128M
echo "base=0xD0000000 size=0x8000000 type=write-back" >| /proc/mtrr
echo \""base=0xD0000000 size=0x8000000 type=write-back\" >| /proc/mtrr"
#base 3456 + 32M for graphics adapter
echo "base=0xD8000000 size=0x2000000 type=write-combining" >| /proc/mtrr
echo "\"base=0xD8000000 size=0x2000000 type=write-combining\" >| /proc/mtrr"
#base 3488 + 608
echo "base=0xDA000000 size=0x26000000 type=write-back" >| /proc/mtrr
echo \""base=0xDA000000 size=0x26000000 type=write-back\" >| /proc/mtrr" |
|
|
| Back to top |
|
 |
termite Guru

Joined: 06 May 2007 Posts: 465
|
Posted: Wed Aug 06, 2008 11:13 am Post subject: |
|
|
That should work.
Powers of two is some MTRR voodoo. I saw it somewhere long ago and remembered. |
|
| Back to top |
|
 |
HotBBQ Apprentice


Joined: 03 Mar 2004 Posts: 265 Location: West Melbourne, FL
|
Posted: Wed Aug 06, 2008 12:26 pm Post subject: |
|
|
| alex.blackbit wrote: | okay, until i get a answer from LKML, i have some basic questions.
when i try to fix the stuff manually... the order of disabling seems to be important.
is it the range that starts at 0 that should be disabled last? if yes, then why? where is this info from? |
My understanding is that the order is only important if the blocks of memory overlap. In that case you would need to remove the newest first, I think. _________________ "If tyranny and oppression come to this land, it will be in the guise of fighting a foreign enemy." -- James Madison |
|
| Back to top |
|
 |
termite Guru

Joined: 06 May 2007 Posts: 465
|
Posted: Wed Aug 06, 2008 12:46 pm Post subject: |
|
|
| Correct. |
|
| Back to top |
|
 |
alex.blackbit Veteran

Joined: 26 Jul 2005 Posts: 2113
|
Posted: Wed Aug 06, 2008 1:14 pm Post subject: |
|
|
my first range of 3072M was not accepted. i had to split it in 2048+1024. please don't ask me why.
after removing a typo i everything works except the range above the graphics adapter memory.
i can only assign 32M of my remaining 608M. very weird.
and although everything up to the graphics adapter memory looks good, the system is damn slow, no chance to work in X.
very, very weird problem.
current script: | Code: | #!/bin/bash
echo "\"disable=2\" >| /proc/mtrr"
echo "disable=2" >| /proc/mtrr
echo "\"disable=1\" >| /proc/mtrr"
echo "disable=1" >| /proc/mtrr
echo "\"disable=0\" >| /proc/mtrr"
echo "disable=0" >| /proc/mtrr
#base 0 + 3072M
#echo \""base=0x00000000 size=0xC0000000 type=write-back\" >| /proc/mtrr"
#echo "base=0x00000000 size=0xC0000000 type=write-back" >| /proc/mtrr
#base 0 + 2048M
echo \""base=0x00000000 size=0x80000000 type=write-back\" >| /proc/mtrr"
echo "base=0x00000000 size=0x80000000 type=write-back" >| /proc/mtrr
#base 2048 + 1024M
echo \""base=0x80000000 size=0x40000000 type=write-back\" >| /proc/mtrr"
echo "base=0x80000000 size=0x40000000 type=write-back" >| /proc/mtrr
#base 3072 + 256M
echo \""base=0xC0000000 size=0x10000000 type=write-back\" >| /proc/mtrr"
echo "base=0xC0000000 size=0x10000000 type=write-back" >| /proc/mtrr
#base 3328 + 128M
echo \""base=0xD0000000 size=0x8000000 type=write-back\" >| /proc/mtrr"
echo "base=0xD0000000 size=0x8000000 type=write-back" >| /proc/mtrr
#base 3456 + 32M for graphics adapter
echo "\"base=0xD8000000 size=0x2000000 type=write-combining\" >| /proc/mtrr"
echo "base=0xD8000000 size=0x2000000 type=write-combining" >| /proc/mtrr
#base 3488 + 608
echo \""base=0xDA000000 size=0x26000000 type=write-back\" >| /proc/mtrr"
echo "base=0xDA000000 size=0x26000000 type=write-back" >| /proc/mtrr |
|
|
| Back to top |
|
 |
termite Guru

Joined: 06 May 2007 Posts: 465
|
Posted: Wed Aug 06, 2008 1:23 pm Post subject: |
|
|
| You need to have no holes and make sure that the entire range that you get covered in /proc/mtrr without any modification is the same as you range you're covering by modifying the table. |
|
| Back to top |
|
 |
alex.blackbit Veteran

Joined: 26 Jul 2005 Posts: 2113
|
Posted: Wed Aug 06, 2008 1:42 pm Post subject: |
|
|
ok, what values should i try for the last memory segment?
this is mtrr before any modification | Code: | # cat /proc/mtrr
reg00: base=0x00000000 ( 0MB), size=198656MB: write-back, count=1
reg01: base=0x80000000 (2048MB), size=197632MB: write-back, count=1
reg02: base=0x100000000 (4096MB), size=197632MB: write-back, count=1
# |
| Code: | # grep MemTotal /proc/meminfo
MemTotal: 4041308 kB
# |
p.s. the brand new .27-rc2 did not help either. |
|
| Back to top |
|
 |
termite Guru

Joined: 06 May 2007 Posts: 465
|
Posted: Wed Aug 06, 2008 2:55 pm Post subject: |
|
|
Yikes. I have no idea why your table covers so much - maybe you don't need to cover all that range.
I don't think you can do this with only 32M for the graphics adaptor. The best you could do is 512M, followed by 64M. Or you could try just one 1024M and over-cover, but I'm not sure that will work. |
|
| Back to top |
|
 |
alex.blackbit Veteran

Joined: 26 Jul 2005 Posts: 2113
|
Posted: Mon Sep 01, 2008 12:59 pm Post subject: |
|
|
after many exchanged emails between yinghai and me, things get better.
kernel 2.6.27-rc5 gives much better results on my machine.
anyhow i have to echo a "disable" in /proc/mtrr.
doing this with /etc/conf.d/local.start and /etc/init.d/local is although not really possible, because it is started after everything else, but i would need that before xdm (gdm).
how did you other do that? i know i can modify the init scripts, but i do not really want to. |
|
| Back to top |
|
 |
termite Guru

Joined: 06 May 2007 Posts: 465
|
Posted: Mon Sep 01, 2008 1:04 pm Post subject: |
|
|
I modified init scripts.
Do you add any kernel options with 2.6.27-rc5? Mine works perfectly with the kernel options I posted above. |
|
| Back to top |
|
 |
alex.blackbit Veteran

Joined: 26 Jul 2005 Posts: 2113
|
Posted: Mon Sep 01, 2008 2:34 pm Post subject: |
|
|
i currently have | Code: | | Command line: root=/dev/sda1 video=uvesafb:1280x1024p-97,mtrr:2 debug show_msr=1 |
what modifications have you done? |
|
| Back to top |
|
 |
termite Guru

Joined: 06 May 2007 Posts: 465
|
Posted: Mon Sep 01, 2008 3:27 pm Post subject: |
|
|
| Quote: | | kernel /boot/kernel-2.6.27-rc4-zen1 root=/dev/sda5 video=uvesafb:1680x1050-32,mtrr:3,ywrap mtrr_gran_size=64m mtrr_chunk_size=1024m |
|
|
| Back to top |
|
 |
alex.blackbit Veteran

Joined: 26 Jul 2005 Posts: 2113
|
Posted: Tue Sep 02, 2008 4:19 am Post subject: |
|
|
sorry, you got me wrong.
i should have described better what i meant.
what modifications did you make to your init scripts? |
|
| Back to top |
|
 |
termite Guru

Joined: 06 May 2007 Posts: 465
|
Posted: Tue Sep 02, 2008 7:54 am Post subject: |
|
|
Ah, sorry. I just added an init script called fixmtrr that calls the original script above to disable and rewrite the mtrr table. I made it before xdm, before local and after *:
| Code: | #!/sbin/runscript
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
depend() {
before xdm
before local
after *
}
start() {
ebegin "Fixing MTRR registers"
/usr/sbin/fixmtrr.sh || retval=$?
eend ${retval}
} |
I added it to default. I think it caused some circular dependencies, but it worked... |
|
| Back to top |
|
 |
|