From owner-freebsd-stable@FreeBSD.ORG Fri Apr 8 12:14:16 2011 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BAF2106566B; Fri, 8 Apr 2011 12:14:16 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 600EF8FC0A; Fri, 8 Apr 2011 12:14:14 +0000 (UTC) Received: by bwz12 with SMTP id 12so3519863bwz.13 for ; Fri, 08 Apr 2011 05:14:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=s+3rCIwTChJBg4otuw5qeQzEZ25xtH9lhER1usKloCI=; b=knxk7KqpYAiCembC0UFFP7sDX/f4TMi3k/d9gq1FL9yLM/2brlogGwKqwSirqcTZxi 0yuHThmsSgR+Gz3ptjs++PHshgURyG7dZPIyRI7aEv+W9j6rB3eS0qWNmHKc9eVrEnOr 8tQRDBpQwBmPjuH492UYh7u2FTFqV5HqgGzyk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=OMX0PQ/nv4GXWf0jm0ZJh3oihEgtU4ZQwk7xwxni/N0gDxF8khrJqva9BDRtAaJlEE KtZdkZxcoBJyYsvIV+06CcEy5XBP9JWZriI+aOs3rMHoU/2A7TBDjeDmDkfEqt6yZtob o0upJa1o2OjjWLVNKT3CmPEDdNlsPH+9hRJuA= Received: by 10.204.19.16 with SMTP id y16mr1865589bka.186.1302262961363; Fri, 08 Apr 2011 04:42:41 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (95-109-204-34.dialup.umc.net.ua [95.109.204.34]) by mx.google.com with ESMTPS id q24sm1597766bks.21.2011.04.08.04.42.33 (version=SSLv3 cipher=OTHER); Fri, 08 Apr 2011 04:42:40 -0700 (PDT) Sender: Alexander Motin Message-ID: <4D9EF48C.9070907@FreeBSD.org> Date: Fri, 08 Apr 2011 14:42:04 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110310 Thunderbird/3.1.9 MIME-Version: 1.0 To: =?windows-1252?Q?Daniel_Ger=9Eo?= References: <4D9EEDAF.3020803@rulez.sk> In-Reply-To: <4D9EEDAF.3020803@rulez.sk> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Cc: stable@freebsd.org, brucec@freebsd.org Subject: Re: powerd / cpufreq question 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: Fri, 08 Apr 2011 12:14:16 -0000 Hi. On 08.04.2011 14:12, Daniel Geržo wrote: > I have a new machine with Xeon(R) CPU X5650 2666.77-MHz and I would like > to utilize powerd(8) on it however, when I run `powerd -v -r90' I see > something like this: > > load 64%, current freq 2668 MHz ( 0), wanted freq 5336 MHz > load 120%, current freq 2668 MHz ( 0), wanted freq 5336 MHz > load 173%, current freq 2668 MHz ( 0), wanted freq 5336 MHz > load 62%, current freq 2668 MHz ( 0), wanted freq 5336 MHz > load 82%, current freq 2668 MHz ( 0), wanted freq 5336 MHz > load 110%, current freq 2668 MHz ( 0), wanted freq 5336 MHz > > even though the machine is according to top(1) ~90% idle; So I realized, > that powerd might take the load as the sum of loads of all the cores > (12), so I tried to tweak powerd arguments like this: > > `powerd -v -r 1000 -i 600' > > but that errors for me with: > > root@[s1-a ~]# powerd -v -r 1000 -i 600 > powerd: 1000 is not a valid percent > > Well, that makes sense, but why powerd itself knows about load > 100% > but doesn't allow me to specify it? Is this bug? I suppose not if it > works for other people... It is reasonable limitation. powerd can't know how load distributed among multiple cores in time. If all cores are equally busy at lets say 10% (that gives 120% total) and cores are never waiting for each other then obviously frequency could be reduced. But if the same 120% mean 100%+20%, or if load is equally spread, but processes on different cores are waiting for each other, then reducing frequency will reduce performance. powerd can't know that and so stays on a safe side. > Other question would be why powerd wants to set freq 5336, when it is > not available at all (would be nice to have it heh.): You may see there it is a "wanted" frequency, not real one. :) It is internal implementation details. In such way powerd implements keeping a full frequency for some time after the load dropped. It's not a bug. On multi-core systems like this power management can better be done on per-core bases. Powerd can't control frequencies on per-core basis (also because it require non-trivial interoperation with scheduler). But if your ACPI BIOS allows, you can try to put unused cores into deeper C-states, that may give better power saving and TurboBoost on busy cores as a bonus. It works better on 9-CURRENT, but on 8-STABLE some bonuses still could be achieved. You may want to look here: http://wiki.freebsd.org/TuningPowerConsumption -- Alexander Motin