From owner-freebsd-i386@FreeBSD.ORG Sat May 19 08:40:06 2007 Return-Path: X-Original-To: freebsd-i386@hub.freebsd.org Delivered-To: freebsd-i386@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0F99616A402 for ; Sat, 19 May 2007 08:40:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 23CE813C480 for ; Sat, 19 May 2007 08:40:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l4J8e45g084657 for ; Sat, 19 May 2007 08:40:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l4J8e4I2084653; Sat, 19 May 2007 08:40:04 GMT (envelope-from gnats) Resent-Date: Sat, 19 May 2007 08:40:04 GMT Resent-Message-Id: <200705190840.l4J8e4I2084653@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-i386@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Rechistov Grigory Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 50D1116A400 for ; Sat, 19 May 2007 08:38:31 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [69.147.83.33]) by mx1.freebsd.org (Postfix) with ESMTP id 29FA313C447 for ; Sat, 19 May 2007 08:38:31 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l4J8cU61054615 for ; Sat, 19 May 2007 08:38:30 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id l4J8XT7A054186; Sat, 19 May 2007 08:33:29 GMT (envelope-from nobody) Message-Id: <200705190833.l4J8XT7A054186@www.freebsd.org> Date: Sat, 19 May 2007 08:33:29 GMT From: Rechistov Grigory To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.0 Cc: Subject: i386/112778: powerd is using sysctl "dev.cpu.0.freq_levels" instead of correct(?) "dev.est.0.freq_settings" X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2007 08:40:06 -0000 >Number: 112778 >Category: i386 >Synopsis: powerd is using sysctl "dev.cpu.0.freq_levels" instead of correct(?) "dev.est.0.freq_settings" >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-i386 >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat May 19 08:40:04 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Rechistov Grigory >Release: FreeBSD 6.2-STABLE >Organization: >Environment: FreeBSD ipv82-180.rt.private.mipt.ru 6.2-STABLE FreeBSD 6.2-STABLE #0: Sat May 19 00:53:48 MSD 2007 root@ipv82-180.rt.private.mipt.ru:/usr/obj/usr/src/sys/DELL_v7 i386 >Description: I have a notebook with a Pentium M processor. With powerd daemon enabled its frequency is varying dynamically in response to average system load. But in this case it often falls the way too low: $ sysctl dev.cpu.0.freq: 100 $ sysctl dev.cpu.0.freq_levels: 1733/27000 1516/23625 1333/21000 1166/18375 1067/17000 933/14875 800/13000 700/11375 600/9750 500/8125 400/6500 300/4875 200/3250 100/1625 That is, my processor is able to be slowed down to 100 MHz. powerd uses that sysctl to determine what frequencies are availible and then does the throttling. You will agree that 100 MHz is a kind of undesirable option - my music playing is accompanied with scratches and pauses. Windows XP, running on the same machine, slows down the processor not lower than 800 MHz. I've noticed that $ sysctl dev.est.0.freq_settings: 1733/27000 1333/21000 1067/17000 800/13000 has the similar list of frequencies, but hasn't the lowest undesirable options. So I changed a bit the source code: $ diff /usr/src/usr.sbin/powerd/powerd.c powerd.c 335c335 < if (sysctlnametomib("dev.cpu.0.freq_levels", levels_mib, &len)) --- > if (sysctlnametomib("dev.est.0.freq_settings", levels_mib, &len)) So, now the lowest frequency observed is 800 MHz. I suppose that it is desirable to either use this sysctl either to have an option to explicitly set the lowest frequency to powerd daemon. Thank you for your work. >How-To-Repeat: Use powerd with Pentium M and monitor the frequency. >Fix: Replace a line in powerd.c 335c335 < if (sysctlnametomib("dev.cpu.0.freq_levels", levels_mib, &len)) --- > if (sysctlnametomib("dev.est.0.freq_settings", levels_mib, &len)) >Release-Note: >Audit-Trail: >Unformatted: