From owner-freebsd-stable@FreeBSD.ORG Wed Aug 12 18:21:39 2009 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AF6F106564A for ; Wed, 12 Aug 2009 18:21:39 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from smtp-vbr17.xs4all.nl (smtp-vbr17.xs4all.nl [194.109.24.37]) by mx1.freebsd.org (Postfix) with ESMTP id C8F538FC1F for ; Wed, 12 Aug 2009 18:21:38 +0000 (UTC) Received: from slackbox.xs4all.nl (slackbox.xs4all.nl [213.84.242.160]) by smtp-vbr17.xs4all.nl (8.13.8/8.13.8) with ESMTP id n7CILbDY018983; Wed, 12 Aug 2009 20:21:37 +0200 (CEST) (envelope-from rsmith@xs4all.nl) Received: by slackbox.xs4all.nl (Postfix, from userid 1001) id 57E5DBA9B; Wed, 12 Aug 2009 20:21:37 +0200 (CEST) Date: Wed, 12 Aug 2009 20:21:37 +0200 From: Roland Smith To: Christian Walther Message-ID: <20090812182137.GC27066@slackbox.xs4all.nl> References: <14989d6e0908120047j29806c80gb92f0aac881bcf1f@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GPJrCs/72TxItFYR" Content-Disposition: inline In-Reply-To: <14989d6e0908120047j29806c80gb92f0aac881bcf1f@mail.gmail.com> X-GPG-Fingerprint: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 X-GPG-Key: http://www.xs4all.nl/~rsmith/pubkey.txt X-GPG-Notice: If this message is not signed, don't assume I sent it! User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: by XS4ALL Virus Scanner Cc: freebsd-stable@freebsd.org Subject: Re: Cpufreq/ACPI problem? (basically still is: "Re: Problem with IBM Thinkpad T30 shutting down due to high temperatures") X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2009 18:21:39 -0000 --GPJrCs/72TxItFYR Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 12, 2009 at 09:47:18AM +0200, Christian Walther wrote: > Hi, >=20 > thank you for all your feedback. > I won't answer all replies in detail, but will summarise what I did to > give you some sort of report. > Doug made me think about the beginning of this situation. I can't tell > you for sure that I had the T30 working flawlessly, because I took the > original install from another, older thinkpad. > But I did change some BIOS settings, Interrupt settings, mainly, that > seem to cause problems with my Wireless NIC in the past. So I restored > the BIOS defaults. This seems to make the problem disappear, but to be > honest: I'm not sure if I messed up the ACPI table at all, or if this > is some sort of performance issue, because I now have all IO bound > devices on IRQ 11: >=20 > vgapci0: port 0x3000-0x30ff mem > 0xe8000000-0xefffffff,0xd0100000-0xd010ffff irq 11 at device 0.0 on > pci1 > uhci0: port > 0x1800-0x181f irq 11 at device 29.0 on pci0 > uhci1: port > 0x1820-0x183f irq 11 at device 29.1 on pci0 > uhci2: port > 0x1840-0x185f irq 11 at device 29.2 on pci0 > cbb0: mem 0x50000000-0x50000fff irq 11 at > device 0.0 on pci2 > cbb1: mem 0x51000000-0x51000fff irq 11 at > device 0.1 on pci2 > fxp0: port 0x8000-0x803f > mem 0xd0200000-0xd0200fff irq 11 at device 8.0 on pci2 > pcm0: port 0x1c00-0x1cff,0x18c0-0x18ff irq 11 > at device 31.5 on pci0 >=20 > This causes screen refresh problems (e.g. urxvt isn't able to draw new > lines as expected). Still, this didn't resolve the issue, so I took a > look at acpi_thermal. > Right now I have the following set in /etc/sysctl.conf >=20 > hw.acpi.thermal.user_override=3D1 According to acpi_thermal(4), you should not use decimal. So it should be 8= 4C instead of 84.0C. > hw.acpi.thermal.tz0._PSV=3D84.0C > hw.acpi.thermal.polling_rate=3D2 >=20 > This basically gives me: >=20 > # sysctl -a|egrep "(temp|freq|acpi.therm|acpi_ibm.*fan)" > kern.acct_chkfreq: 15 > kern.timecounter.tc.i8254.frequency: 1193182 > kern.timecounter.tc.ACPI-fast.frequency: 3579545 > kern.timecounter.tc.TSC.frequency: 2000000000 > net.inet.sctp.sack_freq: 2 > net.inet6.ip6.use_tempaddr: 0 > net.inet6.ip6.temppltime: 86400 > net.inet6.ip6.tempvltime: 604800 > net.inet6.ip6.prefer_tempaddr: 0 > debug.cpufreq.verbose: 0 > debug.cpufreq.lowest: 0 You should look at dev.cpu.N.freq_levels, where N is the number of the core. See cpufreq(4) and below. > hw.acpi.thermal.polling_rate: 2 The polling_rate is just the number of seconds between readings of the temperature. Nothing more. > hw.acpi.thermal.user_override: 1 > hw.acpi.thermal.tz0.temperature: 62.0C > hw.acpi.thermal.tz0.active: 0 > hw.acpi.thermal.tz0.passive_cooling: 1 > hw.acpi.thermal.tz0.thermal_flags: 0 > hw.acpi.thermal.tz0._PSV: 84.0C The _PSV setting means that the system will only start throttling the CPU w= hen temperature reaches 84=B0C! You might want to set that a little lower. The system shuts down at 92=B0C. That seems to be a fine line to walk. > hw.acpi.thermal.tz0._HOT: -1 > hw.acpi.thermal.tz0._CRT: 92.0C > hw.acpi.thermal.tz0._ACx: -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 > hw.acpi.thermal.tz0._TC1: 5 > hw.acpi.thermal.tz0._TC2: 3 > hw.acpi.thermal.tz0._TSP: 600 > machdep.acpi_timer_freq: 3579545 > machdep.tsc_freq: 2000000000 > machdep.i8254_freq: 1193182 > dev.acpi_ibm.0.fan_speed: 4465 > dev.acpi_ibm.0.fan_level: 0 > dev.acpi_ibm.0.fan: 1 > dev.cpu.0.freq: 2000 > dev.cpu.0.freq_levels: 2000/0 1750/0 1500/0 1250/0 1200/0 1050/0 900/0 > 750/0 600/0 450/0 300/0 > dev.acpi_perf.0.freq_settings: 2000/0 1200/0 > dev.cpufreq.0.%driver: cpufreq > dev.cpufreq.0.%parent: cpu0 > dev.p4tcc.0.freq_settings: 10000/-1 8750/-1 7500/-1 6250/-1 5000/-1 > 3750/-1 2500/-1 >=20 > Active cooling doesn't seem to be supported. There is a fan of course, > and I can even set a fan level via dev.acpi_ibm.0.fan, but this is not > related to hw.acpi.thermal.tz0._HOT and hw.acpi.thermal.tz0._ACx > (which is read only anyway). > According to dev.acpi_ibm.0.fan_speed the speed of the fan is > something between 4450 and 4780. >=20 > The interesting bit here is cpufreq and how it behaves. Lets have a > look at the output of the following loop: > # while true ; do temp=3D$( sysctl hw.acpi.thermal.tz0.temperature ) ; > freq=3D$( sysctl dev.cpu.0.freq ) ; printf "%4s %4s\n" $freq[17,$#freq] > $temp[34,$#temp] ; sleep 2 ; done > 2000 84.0C > 2000 85.0C > 2000 85.0C > 2000 85.0C > 2000 86.0C > 300 86.0C > 300 86.0C > 300 86.0C > 300 85.0C > 300 84.0C > 300 82.0C > 300 81.0C >=20 > It appears that cpufreq requires at least eight seconds to reduce the > frequency. There are two issues I'm seeing here: Firstly > hw.acpi.thermal.polling_rate: 2 Either I get this one wrong, or > cpufreq doesn't react after every poll. The latter, I think. > The interesting bit here is cpufreq: Is the behaviour normal and to be > expected, or is this possibly a bug? Cpufreq is just a frequency control framework. It relies on powerd(8) to actually change frequencies. You can set variables in /etc/rc.conf to enable and control powerd. On my desktop I have the following in /etc/rc.conf: # Enable power monitoring. powerd_enable=3D"YES" powerd_flags=3D"-i 95 -r 90" My laptop works best without powerd_flags set. YMMV. Roland --=20 R.F.Smith http://www.xs4all.nl/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) --GPJrCs/72TxItFYR Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) iEYEARECAAYFAkqDCDEACgkQEnfvsMMhpyXDSgCeJjVf01YCSg2LhpCfkpgkdNRK qUEAnRr4YNQUdFV7KCikPMj+D5z++pTR =5lBN -----END PGP SIGNATURE----- --GPJrCs/72TxItFYR--