From owner-freebsd-current@FreeBSD.ORG Sun Jul 20 00:36:35 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B66921065672 for ; Sun, 20 Jul 2008 00:36:35 +0000 (UTC) (envelope-from gaijin.k@gmail.com) Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.29]) by mx1.freebsd.org (Postfix) with ESMTP id 8952A8FC1A for ; Sun, 20 Jul 2008 00:36:35 +0000 (UTC) (envelope-from gaijin.k@gmail.com) Received: by yw-out-2324.google.com with SMTP id 9so271932ywe.13 for ; Sat, 19 Jul 2008 17:36:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=BK48/bvQblPgNtTq7qwH15BjFfL+hNZ+BIRQDFGRDG8=; b=VLohEkXXxJ7kuNL56ylhSbnVsV6tRJZIsELBRqIrdT+xx221jkqa8NaWhT1pSXrqVg +vNBhLmkxMCCudkpF6TfgcIOIvZ2BmQUT18UUZqkK1vr0aorcHE9iUqWMbAcmdfQbXKL 141frZa0AulaeuHEWok1fqa+1w4dVBoJVMTO4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=rPVU+JNfWZtRYudzuvGAbmVPL8ibTMrDFLS4SZWNJeKU+eAKgRmnNSnTzv8Plc/LQx yfDo/tDJHjgrodf7YuzCT8BumqHPEflJHt1U1oZD1Jt5oT63KpVi1YREYH+uSsE4HPBt faowf63TqepIdsmjyjinuLr658D73VLh7lEvk= Received: by 10.150.202.3 with SMTP id z3mr1930268ybf.224.1216514193867; Sat, 19 Jul 2008 17:36:33 -0700 (PDT) Received: from ?10.0.3.231? ( [70.111.22.162]) by mx.google.com with ESMTPS id 9sm630998yxs.5.2008.07.19.17.36.32 (version=SSLv3 cipher=RC4-MD5); Sat, 19 Jul 2008 17:36:33 -0700 (PDT) From: "Alexandre \"Sunny\" Kovalenko" To: Giorgos Keramidas In-Reply-To: <87iqv1h1g8.fsf@kobe.laptop> References: <87prpcjrsk.fsf@kobe.laptop> <1216501388.971.6.camel@RabbitsDen> <87mykd5wsl.fsf@kobe.laptop> <87tzelebd7.fsf@kobe.laptop> <1216508230.2172.8.camel@RabbitsDen> <87iqv1h1g8.fsf@kobe.laptop> Content-Type: text/plain; charset=utf-8 Date: Sat, 19 Jul 2008 20:36:22 -0400 Message-Id: <1216514182.2172.28.camel@RabbitsDen> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 8bit Cc: freebsd-current@freebsd.org Subject: Re: Broken APIC on my laptop or bug in FreeBSD? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2008 00:36:35 -0000 On Sun, 2008-07-20 at 02:57 +0300, Giorgos Keramidas wrote: > On Sat, 19 Jul 2008 18:57:10 -0400, "Alexandre \"Sunny\" Kovalenko" wrote: > > On Sun, 2008-07-20 at 01:51 +0300, Giorgos Keramidas wrote: > >> That was it. Thanks! > >> > >> # sysctl -a | egrep -e 'cx_(usage|support)' > >> dev.cpu.0.cx_supported: C1/1 C2/1 C3/57 > >> dev.cpu.0.cx_usage: 100.00% 0.00% 0.00% > >> dev.cpu.1.cx_supported: C1/1 C2/1 C3/57 > >> dev.cpu.1.cx_usage: 100.00% 0.00% 0.00% > >> > >> With anything except "C1" the CPU is obviously too slow to do > >> anything useful :-) > > > > I guess it got worse in CURRENT: > > > > # uname -a > > FreeBSD RabbitsDen.RabbitsLawn.verizon.net 7.0-STABLE FreeBSD 7.0-STABLE > > #0: Wed Jul 9 16:52:35 EDT 2008 > > root@RabbitsDen.RabbitsLawn.verizon.net:/usr/obj/usr/src/sys/TPX60 i386 > > RabbitsDen# sysctl -a | egrep -e 'cx_(usage|support)' > > dev.cpu.0.cx_supported: C1/1 C2/1 C3/57 > > dev.cpu.0.cx_usage: 0.00% 100.00% 0.00% > > dev.cpu.1.cx_supported: C1/1 C2/1 C3/57 > > dev.cpu.1.cx_usage: 0.00% 4.43% 95.56% > > Now that I know what to look for, I see that what is reported in > cx_supported is an array from the `struct acpi_cpu_softc' for each cpu. > The initialization of per-cpu dev.cpu.*.cx_xxx values in the softc of > the cpu is done in sys/dev/acpica/acpi_cpu.c:acpi_cpu_cx_cst(). > > I am probably not qualified to say if 'things got worse' in CURRENT, but > I wish there was a way to find out *before* entering a state where the > CPU is too slow to do basic tasks (i.e. time keeping, and scheduling > processes). > What I meant is that my laptop, runnig RELENG_7 is pretty happy with "C2" (set through /etc/rc.conf as performance_cx_lowest="C2", and even "C3" (set through /etc/sysctl.conf as dev.cpu.1.cx_lowest=C3), so long as cpu0 is not allowed to go into C3. You seemed to indicate that in your case nothing but "C1" worked. If you just did not try the configuration above, would you, please, try it and see if it works. Apart from, hopefully, giving someone the data point, it will make your laptop cooler and less power hungry. Now, as far as finding out how bad coming out of the state is, that's what the numbers after the slash in "supported" are for. Coming out of C3 on my CPU (and yours) will take 57 times longer than coming out of C2. You can play games with your ASL to change that value. I am sure that I am not qualified to say whether it gets honored, though. Few more data points: -- CPU0 and CPU1 are somehow not treated interchangeably by FreeBSD. -- at some point when earth was warm and 7.0 was CURRENT, "C3" used to work on my laptop, even on CPU0. -- I have not filed a PR. If you think it is warranted, you could do it or I can -- it's just I did a couple of embarrassing ones and got somewhat trigger-shy ;) -- Alexandre "Sunny" Kovalenko (Олександр Коваленко)