freebsd:tuning_power_consumption

差分

このページの2つのバージョン間の差分を表示します。

この比較画面にリンクする

次のリビジョン
前のリビジョン
freebsd:tuning_power_consumption [2015-03-23 12:46]
Decomo 作成
freebsd:tuning_power_consumption [2019-12-01 19:16] (現在)
Decomo
行 1: 行 1:
 ====== FreeBSD WikiのTuningPowerConsumptionの日本語訳 ====== ====== FreeBSD WikiのTuningPowerConsumptionの日本語訳 ======
  
-TuningPowerConsumption+家鯖の消費電力を下げるべく情報を集めていたところ、FreeBSD Wikiの[[https://wiki.freebsd.org/TuningPowerConsumption|TuningPowerConsumption]]記事が非常に参考になったので日本語訳してみた。
  
-Alexandar Motin writes:+===== 消費電力チューニング =====
  
-I would like to summarize some of my knowledge on reducing FreeBSD power consumption and describe some new things implemented in FreeBSD 8.x/9.x. The main character of this story is my 12" Acer TravelMate 6292 laptop with C2D T7700 2.4GHz CPU, 965GM chipset and SATA HDD.+Alexandar Motin 記す:
  
-Modern systems, especially laptops, are implementing big number of power-saving technologiesSome of them are working automatically, other have significant requirements and need special system tuning or trade-offs to be effectively used.+FreeBSDでの消費電力削減に関して私の知るところをまとめ、FreeBSD 8.x/9.xで実装されたいくつかの新しい事柄を説明しようと思います。このストーリーの主人公は、C2D T7700 2.4GHz CPU、965GMチップセット、SATA HDDを搭載した私の12インチAcer TravelMate 6292ラップトップです。
  
-So here is the steps:+現代のシステム、とりわけラップトップは数多くの省エネ技術を搭載しています。それらのいくつかは自動で機能するものの、その他は効果を発揮するための明示的な設定と特別なシステムチューニング、トレードオフが存在します。
  
-1. CPU 
  
-CPU is the most consuming part of the system. Under the full load it alone may consume more then 40W of power, but for real laptop usage the most important is idle consumption. Core2Duo T7700 CPU has 2 cores, runs on 2.4GHz frequency, supports EIST technology with P-states at 2400, 2000, 1600, 1200 and 800MHz levels, supports C1, C2 and C3 idle C-states, plus throttling. So how can we use it:+ここから順にみていきます:
  
-P-states and throttling 
  
-Enabling powerd allows to effectively control CPU frequency/voltage depending on CPU load. powerd on recent system can handle it quite transparently. By default, frequency controlled via mix of EIST and throttling technologies. First one controls both core frequency and voltage, second - only core frequency. Both technologies give positive power-saving effect. But effect of throttling is small and can be completely hidden by using C2 state, that's why I recommend to disable throttling control by adding to /boot/loader.conf:+==== 1. CPU ====
  
 +CPUはシステム内で最も電力を消費する部分です。
 +最大負荷時では、CPUだけで40W以上を消費するでしょうが、実際のラップトップ利用において最も重要なのはアイドル時消費電力です。
 +Core2Duo T7700 CPUは2つのコアを持ち、2.4GHzで駆動し、2400/2000/1600/1200/800MHzのPステートからなるEISTテクノロジに対応し、C1/C2/C3の待機Cステートに加えスロットリングをサポートします。
 +ではどのようにそれらを使えばいいのでしょうか:
 +
 +=== Pステートとスロットリング ===
 +
 +''powerd(8)''を有効にし、システム負荷に応じたCPU周波数の調整により消費電力を抑えます。
 +
 +r265329以前では、周波数はEISTとスロットリング技術を混合して制御されていました。
 +前者がコア周波数と電圧の両方を制御し、後者はコア周波数のみを制御します。
 +両技術は電力削減に良い影響をもたらしますが、スロットリングの効果は小さく、C2ステートを使うことで完全に隠れてしまうでしょう。
 +そんなわけで、''/boot/loader.conf''に設定を追加しスロットリング制御を無効化することをお勧めします:
 +
 +<conf code>
 hint.p4tcc.0.disabled=1 hint.p4tcc.0.disabled=1
 hint.acpi_throttle.0.disabled=1 hint.acpi_throttle.0.disabled=1
 +</code>
  
-After this sysctl reports only EIST frequencies:+これ以後、''sysctl''EIST周波数のみを表示します:
  
 +<code>
 dev.cpu.0.freq_levels: 2400/35000 2000/28000 1600/22000 1200/16000 800/14000 dev.cpu.0.freq_levels: 2400/35000 2000/28000 1600/22000 1200/16000 800/14000
 +</code>
  
-ACPI may report extra performance level with frequency 1MHz above the nominal to control Intel Turbo Boost operation. For example, on Core i7-870 you may see:+新規インストールにおいて、ACPIとP4TCCスロットリングは、今やデフォルトで無効になっています。
  
 +Intel TurboBoost動作の制御のため、ACPIは公称周波数より1MHz高い追加の性能レベルを表示するかもしれません。
 +例えばCore i7-870では以下のように見えるでしょう:
 +
 +
 +<code>
 dev.cpu.0.freq_levels: 2934/106000 2933/95000 2800/82000 ... dev.cpu.0.freq_levels: 2934/106000 2933/95000 2800/82000 ...
 +</code>
 +
 +値の2933は2.93GHzを意味しますが、2934は状況に依存し3.2~3.6GHzを意味します。
  
-, where value 2933 means 2.93GHz, but 2934, depending on situation, means 3.2-3.6GHz.+私のケースでは、周波数/電圧制御により約5Wのアイドル電力を削減しました。
  
-In my case frequency/voltage control saves about 5W of idle power. 
  
-C-states+=== Cステート ===
  
-C1 stops clock on some parts of CPU core during inactivity. It is safe, cheap and supported by CPUs for ages. System uses C1 state by default.+C1ステートはCPUが活動していない間、コアのいくつかの部分のクロックを停止します。 
 +これは安全で、性能へのインパクトも少なく、昔からCPUでサポートされています。 
 +システムは標準でC1ステートを使います。
  
-C2 state allows CPU to turn off all core clocks on idle. It is also cheap, but requires correct ACPI-chipset-CPU interoperation to be used. Use of C2 state can be enabled by adding to /etc/rc.conf:+C2ステートは待機時にCPUの全コアクロックの停止を可能にします。 
 +これもまた安上がりですが、利用にあたりACPI/チップセット/CPU間の正確な協調動作が求められます。 
 +C2ステートの有効化は''/etc/rc.conf''に以下の記述を追加します:
  
 +<code conf>
 performance_cx_lowest="Cmax" performance_cx_lowest="Cmax"
 economy_cx_lowest="Cmax" economy_cx_lowest="Cmax"
 +</code>
  
-Effect from this state is not so big when powerd is used, but still noticeable,+''powerd''の利用時は、本ステートの影響はそれほど大きくありませんが、依然として注目に値します。
  
-C3 state allows CPU completely stop all internal clocks, reduce voltage and disconnect from system bus. This state gives additional power saving effect, but it is not cheap and require trade-offs. As soon as CPU is completely stopped in C3 state, local APIC timers in each CPU core, used by FreeBSD as event sources on SMP, are not functioning. It stops system time, breaks scheduling that makes system close to dead. The only solution for this problem is to use some external timers.+C3ステートは、CPUの完全な内部クロック停止、電圧の削減、そしてシステムバスからの切り離しを可能にします。 
 +このステートは更なる省エネ効果をもたらすものの、安上がりではなく、トレードオフが求められます。 
 +C3ステートでCPUが完全に止まるや否や、FreeBSDSMP環境でイベントソースとして利用する各CPUコア内のローカルAPICタイマーは機能しなくなります。システムタイムが止まり、スケジューリングを破壊し、これはシステムを死へと誘います。 
 +この問題に対する唯一の解決策は、いくつかの外部タイマを使う事です。
  
-There is also pseudo-state known as C1E. It is a workaround in modern CPUs to work better with OS without C-states support. When enabled in BIOS, it makes CPU to enter some deeper C-state when C1 state is requested by the OS.+C1Eとして知られる疑似ステートもあります。 
 +これは、現代的なCPUとCステート非対応のOSとがより良く動くための次善策です。 
 +BIOSで有効にすると、OSからC1ステートが要求された際、CPUはより深いCステートに入れるようになります。
  
-It is typical for AMD CPUs BIOSes to not expose real C-states to OS, but instead use only C1E mechanism. For example, it may work this way: when OS requests C1 for some CPU core, it enters C2, but when all cores of some CPU package are in C2, the whole package goes into C3. Unluckily that functionality is completely hidden from the OS.+典型的にAMD CPUとBIOSは実際のCステートをOSに見せませんが、かわりにC1Eメカニズムを用いるのみです。 
 +例えば次のように働くでしょう:OSがいくつかのCPUコアにC1を要求するとコアはC2に入りますが、CPUパッケージの全コアがC2である時は、パッケージの全てがC3になるという具合です。 
 +あいにく、この働きはOSから完全に隠蔽されています。
  
-FreeBSD 8.x 
  
-Originally, before SMP era, FreeBSD used i8254 (for HZ) and RTC (for stats) chipset timers. FreeBSD 8.x resurrect them for SMP systems. To use them, you can disable local APIC timers by adding to /boot/loader.conf:+== FreeBSD 8.x ==
  
 +もともと、SMP時代以前、FreeBSDはi8254(周波数用)とRTC(ステータス用)のチップセットタイマを使っていました。
 +FreeBSD 8.xはこれらをSMPシステム用に復活させました。
 +これらを使うために、''/boot/loader.conf''でローカルAPICタイマを無効化することができます:
 +
 +<code conf>
 hint.apic.0.clock=0 hint.apic.0.clock=0
 +</code>
  
-Also, to drop/rise voltage on C3CPU needs time (57us for my system). It means that C3 state can't be effectively used when system is waking up often. To increase inactivity periods we should reduce interrupt rate as much as possible by adding to loader.conf:+C3の電圧昇降には、もちろんCPUは時間を必要とします(私のシステムでは57マイクロ秒)。 
 +これはつまり、頻繁にアクティブになるシステムにおいて、C3ステートは効率的に利用されないという事です。 
 +非アクティブ期間を増やすため、可能な限り割り込みレートを下げるべきです。''loader.conf''に以下を追加します:
  
 +<code conf>
 kern.hz=100 kern.hz=100
 +</code>
  
-It may increase system response time a bit, but it is not significant for laptop. Also we may avoid additional 128 interrupts per second per core, by the cost of scheduling precision, with using i8254 timer also for statistic collection purposes instead of RTC clock, by using another newly added option:+システムの応答時間がわずかに増えるかもしれませんが、ラップトップでは重大事ではありません。 
 +同様に、RTCクロックの代わりに静的コレクション用途のi8254タイマーを用いて、スケジューリング精度に必要な1コアあたり秒間128回の追加割り込みを避けるとよいかもしれません。そのためには別の新規オプションを追加します:
  
 +<code conf>
 hint.atrtc.0.clock=0 hint.atrtc.0.clock=0
 +</code>
  
-As result, system has only 100 interrupts per core and CPUs are using C3 with high efficiency:+結果として、システムはコアあたり100回の割り込みで済み、CPUは効率的にC3を使っています:
  
 +<code>
 %sysctl dev.cpu |grep cx %sysctl dev.cpu |grep cx
 dev.cpu.0.cx_supported: C1/1 C2/1 C3/57 dev.cpu.0.cx_supported: C1/1 C2/1 C3/57
行 74: 行 123:
 dev.cpu.1.cx_lowest: C3 dev.cpu.1.cx_lowest: C3
 dev.cpu.1.cx_usage: 0.00% 0.00% 100.00% last 2235us dev.cpu.1.cx_usage: 0.00% 0.00% 100.00% last 2235us
 +</code>
  
-Result of effective C3 state usage, comparing to C2+powerd, is about 2W.+効率的なC3使用の結果、C2+powerdと比べて約2Wの削減です。
  
-As soon as entering C1E on AMD CPUs may result in unexpected and uncontrolled entering C3 and resulting local APIC timer stop, FreeBSD 8.x blocks C1E functionality completely.+AMD CPUにおいてC1Eステートへの突入は、予期せぬ制御不能なC3ステートへ突入しているかもしれず、ローカルAPICタイマーの停止を引き起こす可能性があるため、FreeBSD 8.xC1E機能を完全にブロックします。
  
-FreeBSD 9.x 
  
-FreeBSD 9.x included new event timers subsystem -- eventtimers(4), that allows to support more types of the timer hardware, including HPET, present in most of modern chipsets and invariant to CPU power management. System automatically chooses timer it consider best, but you may check and dynamically change timer to use via sysctl.+== FreeBSD 9.x ==
  
-Also eventtimers(4) adds support for one-shot timer operation mode, when interrupts generated only when there is some work to do. That allows to not reduce kern.hz variable -- even multicore system should have only about 50-100 interrupts per second total when idle. But you still may want to do it, to reduce effect of some power-ineffectively written applications.+FreeBSD 9.xは新イベントタイマーサブシステム''eventtimers(4)''を含みます。これは、殆どの現代的なチップセットに存在しCPU電源管理のための不変のHPETを含む、より多くの種類のタイマーハードウェアに対応しています。 
 +システムは最適と思われるタイマーを自動的に選択しますが、''sysctl''を通してタイマーの確認と動的な変更が可能です。
  
-FreeBSD 9.x adds check whether it safe to use specific C-state with present event timer and may automatically block C2/C3 states, making it mostly safe. Nevertheless, due to possible performance degradation on some workloads, C-states use is not enabled by default now, you should enable it manually. Same time, on newer CPUs, enabling deeper C-states allows to use TurboBoost technology, that may increase performance of single-threaded applications.+また''eventtimers(4)''は、何かする必要が出た時にだけ割り込みを生成する、ワンショットタイマー制御モードに対応します。 
 +これにより''kern.hz''変数値を減らす必要がなくなり、マルチコアシステムでさえアイドル時の秒間合計割り込み数がたった50~100回程度になります。 
 +それでもなお''kern.hz''の削減は、いくつかの電源効率を考慮せずに作られたアプリケーションに対して有効です。
  
-On AMD CPUs FreeBSD 9.x blocks C1E only when local APIC timer is used. If the local APIC timer was ever used since boot, C1E will be blocked till the next reboot. You may want to force some other timer to be used in order to allow C1E to work.+FreeBSD 9.xでは具体的なCステートと現在のイベントタイマが安全に使えるかどうかのチェックが追加され、場合によってはより安全となるようC2/C3が自動的にブロックされます。 
 +そうはいっても、いくつかのワークロードにおいて性能低下の可能性があるため、Cステートの利用は現在デフォルトでは有効になっておらず、手動で有効にしなければなりません。 
 +それと同時に、より新しいCPUにおいて、深いCステートを有効にすることはTurboBoost技術の利用を可能とし、これはシングルスレッドアプリケーションの性能向上につながります。
  
-2Screen / Video+AMD CPUの場合、FreeBSD 9.xはローカルAPICタイマが使われている場合のみC1Eステートをブロックします。 
 +起動の時点でローカルAPICタイマが使われていた場合、次回再起動までC1Eはブロックされるでしょう。 
 +C1Eの動作を許可するには、他のタイマが使われるよう強制する必要があるかもしれません。
  
-Screen back light can consume much power. From 1.5W with minimal, up to 4W with maximal brightness on my laptop. So you should find the way (hardware or software) to control it and tune for level minimally required in specific conditions. In my case it is controlled via hardware buttons. Some other laptops allow to control brightness via hw.acpi.video.lcd0.brightness sysctl, supported by acpi_video(4). Graphics chip may consume significant amount of power, that may depend on used driver and its settings.+==== 2画面/ビデオ ====
  
-Intel GPUs+画面のバックライトは、そこそこ電気を食います。 
 +私のラップトップでは、明るさによって最小1.5W~最大4Wでした。 
 +したがって、明るさを(ハード的またはソフト的に)制御する方法を見つけ、状況に応じて最小限のレベルに合わせるのが良いでしょう。 
 +私の場合、それはハードウェアのボタンで制御されます。 
 +他のいくつかのラップトップでは、明るさ制御を''acpi_video(4)''でサポートされる''sysctl''の''hw.acpi.video.lcd0.brightness''を通して制御できます。 
 +グラフィックチップは使うドライバやその設定に応じて、著しい量の電力を消費する可能性があります。
  
-On laptops with SandyBridge/IvyBridge CPUs graphics using new KMS-based "intel" driver may increase power consumption by 3W, comparing to the "vesa" driver. Addition to the /boot/loader.conf line: 
  
 +=== Intel GPU ===
 +
 +SandyBridge/IvyBridge CPUのラップトップのグラフィックスについて、新しいKMSべースの"intel"ドライバは"vesa"ドライバと比べて消費電力が3W増加するかもしれません。
 +''/boot/loader.conf''に以下の行を追加します:
 +
 +<code conf>
 drm.i915.enable_rc6=7 drm.i915.enable_rc6=7
 +</code>
  
-enables using power-saving idle states of the GPU and reduces power consumption.+電力を抑えるGPUの待機ステートの使用を有効化し、消費電力を削減します。
  
-NVIDIA Optimus+<note warning>このヒントは最近のシステムには時代遅れかもしれません。''sysctl -d -a | grep rc6''を実行し、変数名が変わってないか確認してください。</note>
  
-If you have a Laptop with an NVIDIA Optimus GPU where you cannot switch off either GPU off in the Laptop's BIOSthere is a handy script that will probe all known ACPI calls used to disable the dedicated NVIDIA GPU:+参考: 
 +  * [[https://lists.freebsd.org/pipermail/freebsd-x11/2015-February/016066.html|Intel i915 support for RC6 (freebsd-x11 mailing list archives2015.2.6)]] 
 +  * [[https://github.com/FreeBSDDesktop/kms-drm|https://github.com/FreeBSDDesktop/kms-drm]] 
 +    * ''i915_params.c''を探してください。
  
 +=== NVIDIA Optimus ===
 +
 +NVIDIA Optimus対応GPU搭載のラップトップを持っており、BIOSでGPUオフができなければ、単体NVIDIA GPUの無効化に使われる全ての基地のACPIコールを調査するお手製スクリプトがあります:
 +
 +<code>
 % fetch https://people.freebsd.org/~xmj/turn_off_gpu.sh % fetch https://people.freebsd.org/~xmj/turn_off_gpu.sh
 % make -C /usr/ports/sysutils/acpi_call install clean % make -C /usr/ports/sysutils/acpi_call install clean
 % vim turn_off_gpu.sh  # read it before executing! % vim turn_off_gpu.sh  # read it before executing!
 % sh turn_off_gpu.sh   # as root user % sh turn_off_gpu.sh   # as root user
 +</code>
  
-Once successful, it will store the succeeded call in+成功したACPIコールは、以下に格納されます。
  
 +<code>
 /root/.gpu_method /root/.gpu_method
 +</code>
 +
 +そして後続の処理で使用されます。
 +ASUSのウルトラブックにおいて、これは6~8Wを節約し、バッテリー駆動時間を少なくとも3時間延ばします。
 +起動時にGPUを無効化するために、''rc.local''あるいは他のカスタムrc.dスクリプトに入れることができます。
 +上述のIntel GPUセクションに加えて''/boot/loader.conf''で利用することもできます。
 +
  
-and use it on subsequent tries. On an ASUS UltraBook, this saves about 6-8W and raises battery lifetime by a third at least. It can be put into rc.local or other custom rc.d scripts to disable the GPU on boot. It can be used in addition to the /boot/loader.conf line mentioned above in the Intel GPU section.+==== 3メモリ ====
  
-3Memory+このラップトップは2枚の1GB DDR2-667 SODIMMメモリモジュールが組み込まれています。 
 +そのうち1枚を取ることで約1Wの節約、2枚の1GBモジュールを1枚の2GBモジュールに置き換えることでも約0.5Wの節約です。
  
-This laptop has two 1GB DDR2-667 SODIMM memory modules installed. Removing one of them saves about 1W, Replacing two 1GB modules with single 2GB module also saves about 0.5W. 
  
-4. PCI devices+==== 4. PCIデバイス ==== 
  
-PCI bus provides method to control device power. For example, I have completely no use for my FireWire controller and most of time - EHCI USB controller. Disabling them allows me to save about 3W of power. To disable all unneeded PCI devices you should build kernel without their drivers and add to loader.conf:+PCIバスはデバイスの電源管理手法を提供します。 
 +たとえば、私は全く使わないFireWireコントローラと殆ど使うことがないEHCI USBコントローラを持っています。 
 +これらを無効化することで3Wの電力削減ができます。 
 +全ての不要なPCIデバイスの無効化のために、それらのドライバを外したカーネルをビルドし、''loader.conf''に以下の行を追加するべきです:
  
 +<code conf>
 hw.pci.do_power_nodriver=3 hw.pci.do_power_nodriver=3
 +</code>
  
-To enable devices back all you need to do is just load their drivers as modulesNew EHCI USB driver in 8.x consumes much less power then previous one.+デバイスを再び有効化するために必要なことは、それらのドライバをモジュールとして単に読み込むだけです。 
 +8.xの新しいEHCI USBドライバは以前のものよりも消費電力が少なくなっています。
  
-5. Radios 
  
-WiFi and Bluetooth adapters can consume significant power when used (up to 2W when my iwn(4) WiFi is connected) or just enabled (0.5W).+==== 5無線 ==== 
  
-Some WiFi adapters (like my iwn(4)) support power-saving mode, disabling radio during inactivity periodsIt can be enabled by adding+WiFiとBluetoothアダプタは、使用時(私の場合''iwn(4)'' WiFiが接続されている時で最大2W)ないし単に有効にしただけ(0.5W)でも無視できない電力を消費します
  
 +ある種のWiFiアダプタ(私の''iwm(4)''のように)は省エネモードに対応し、非アクティブ時に無線通信を停止します。
 +これは
 +<code conf>
 powersave powersave
 +</code>
 +オプションを''ifconfig''インタフェースを追加することで有効になります。
 +わずかな接続レイテンシの増加と引き換えに、大幅なWiFi消費電力を削減するでしょう。
  
-option to the ifconfig interface options. This may significantly reduce WiFi power consumption by the price of slightly increased link latency. 
  
-6. HDA modem+==== 6. HDAモデム ==== 
  
-I was surprised, but integrated HDA modem consumed about 1W of power even when not used. I have used the most radical solution - removed it mechanically from socket. Case surface in that area become much cooler.+私は驚いたのですが、内蔵HDAモデムは使用していなくとも約1Wの電力を消費していました。 
 +私は最も過激な解決策、すなわちソケットから物理的に取り外す選択をしました。 
 +モデムがあった場所のケース表面温度は下がりました。
  
-7. HDA sound+==== 7. HDAサウンド ==== 
  
-To reduce number of sound generated interrupts I have added to the loader.conf:+サウンドが生成する割り込み数を減らすため、''loader.conf''に以下を追加しました:
  
 +<code conf>
 hw.snd.latency=7 hw.snd.latency=7
 +</code>
  
-On FreeBSD before 9-STABLE of 2012-03-10 also may be useful to increase maximal buffer sizes:+2012-03-10のFreeBSD 9-STABLE以前では、最大バッファサイズを増やすことも有益かもしれません:
  
 +<code conf>
 hint.pcm.0.buffersize=65536 hint.pcm.0.buffersize=65536
 hint.pcm.1.buffersize=65536 hint.pcm.1.buffersize=65536
 +</code>
  
-8. HDD+==== 8. HDD ==== 
  
-First common recommendation is use tmpfs for temporary files. RAM is cheap, fast and anyway with you. Also you may try to setup automatic idle drive spin-down, but if it is the only system drive you should be careful, as every spin-up reduces drive's life time. For several months (until I have bought SATA SSD) I have successfully used SDHC card in built-in PCI sdhci card reader as main file system. On random read requests it is much faster then HDD, but it is very slow on random write. Same time it consumes almost nothing. USB drives could also be used, but effect is much less as EHCI USB controller consumes much power. Spinning-down my 2.5" Hitachi SATA HDD saves about 1W of power. Removing it completely saves 2W.+まず、よくある推奨方法は一時ファイル用に''tmpfs''を使う事です。 
 +RAMは消費電力への影響が少なく、速くanyway with you。 
 +待機ドライブの自動スピンダウン設定を試したくなるかもしれませんが、システムドライブしかないのであれば注意すべきです。スピンアップはドライブの寿命を縮めます。 
 +SATA SSDを買うまでの)数ヵ月間、私は内蔵のPCI ''sdhci''カードリーダをメインファイルシステムとして使う事に成功しました。 
 +ランダムリード要求についてはHDDより高速ですが、ランダムライトは非常に低速です。 
 +加えて、SDカードは殆ど電力を食いません。 
 +USBフラッシュドライブを使う事も可能ですが、EHCI USBコントローラの消費電力に比べれば効果は限定的です。 
 +私の2.5インチ日立製SATA HDDをスピンダウンすると、約1Wの削減です。 
 +完全に取り外すと2Wの削減です。
  
-9. SATA 
  
-Comparing to PATA, SATA interface uses differential signaling for data transferTo work properly it has to transmit pseudo-random scrambled sequence even when idle. As you understand, that requires power. But SATA implements two power saving modes: PARTIAL and SLUMBER. These modes could be activated by either host or device if both sides support them. PARTIAL mode just stops scrambling, but keeps neutral link state, resume time is 50-100us. SLUMBER mode powers down interface completely, but respective resume time is 3-10ms.+==== 9. SATA ==== 
  
-The ata(4) driver has support for the SATA power management. There are hint.ata.X.pm_level loader tunables can be used to control it. Setting it to 1 allows drive itself to initiate power saving, when it wish. Values and 3 make AHCI-compatible controller to initiate PARTIAL and SLUMBER transitions after every command completion. New ahci(4) driver also has hint.ahcich.X.pm_level tunable. It also support modes 4 and 5 for minimal performance degradation. Note that SATA power saving complicates drive hot-swap, as controller may be unable to detect drive presence when link is powered-down.+PATAと比べると、SATAインタフェースはデータ転送に差動シグナルを用います。 
 +正常動作のため、アイドル時でも疑似的なランダムスクランブルシーケンスを転送しなければなりません。 
 +お察しの通り、これは電力を要求します。 
 +しかしSATAは2つの省エネモードを実装しています:PARTIALSLUMBERです。 
 +これらモードは、ホストとデバイの両方が対応していれば、どちらからでも有効にできます。 
 +PARTIALモードはスクランブル化を止めるだけで、ニュートラルなリンク状態を保ち、復帰時間は50~100マイクロ秒です。 
 +SLUMBERモードはインタフェースの電源を完全に落とし、各復帰時間は3~10ミリ秒です。
  
-In my case PARTIAL mode saves 0.5W and SLUMBER - 0.8W of power.+''ata(4)''ドライバはSATA電源管理に対応しています。 
 +''hint.ata.X.pm_level''チューニング変数で制御することができます。 
 +1にするとドライブ自身の省エネ状態が開始されます。 
 +2と3で、AHCI互換コントローラが毎コマンド完了後にPARTIAL/SLUMBERへの遷移を許可します。 
 +新しい''ahci(4)''ドライバは''hint.ahcich.X.pm_level''チューニング変数も持っています。 
 +これは4と5のモードもサポートし、性能劣化を最小化するモードです。 
 +SATA省エネモードはドライブのホットスワップを困難にすることに留意してください。なぜなら、リンクの電源が落ちている時、コントローラはドライブの存在を検出することが不可能だろうからです。
  
-10USB+私の場合、PARTIALモードは0.5W、SLUMBERは0.8Wの削減です。
  
-USB devices can individually be switched to and from power save mode by running the following commands:+==== 10. USB ==== 
  
-This command will enable automatic suspend of the USB device when no data traffic is pending.+以下のコマンドを実行することで、USBデバイスは個々に省エネモードの切り替えができます: 
 + 
 +<code> 
 +このコマンドはデータトラフィックがない間のUSBデバイスの自動サスペンドを有効にします
 usbconfig -d X.Y power_save usbconfig -d X.Y power_save
 +</code>
  
-This command will disable USB power save for the given device.+<code> 
 +このコマンドは与USBデバイスの省エネモードを無効にします
 usbconfig -d X.Y power_on usbconfig -d X.Y power_on
 +</code>
  
-The default for all devices except USB HUBs is power on. You should check the configuration descriptor of your device, that the "bmAttributes" field indicates that the device supports remote wakeup before enabling power save on a random USB device. It is not recommended to set the system timer tick rate below 250 HZ and enable USB power save, due to some USB suspend and resume delays which must comply to the USB specification. The power save feature also applies in the same way to USB device/gadget mode.+USBハブを除く全てのデバイスのデフォルト値は"power on"です。 
 +USBデバイスの省エネモードを有効にする前に、デバイスのコンフィギュレーションでスクリプタ、すなわち"bmAttributes"フィールドがデバイスが遠隔起動に対応しているかを確認すべきです。 
 +USBのサスペンド/レジューム遅延を規格に適合させるため、システムタイマーのティック間隔が250Hz未満でUSB省エネモードを有効にするのは非推奨です。 
 +省エネ機能は同様にUSBデバイス/ガジェットモードにも適用可能です。
  
-Results 
  
-So what have I got? To monitor real system power consumption I am using information provided by ACPI battery via acpiconf -i0 command:+==== 結果 ====
  
-Original system:+私は何を得たでしょうか? 
 +実際のシステム消費電力をモニタするため、''acpiconf -i0''コマンドでACPIバッテリが提供する情報を見てみましょう:
  
 +元のシステム:
 +<code>
 Design capacity:        4800 mAh Design capacity:        4800 mAh
 Last full capacity:     4190 mAh Last full capacity:     4190 mAh
行 200: 行 330:
 Present rate:           1621 mA Present rate:           1621 mA
 Voltage:                12033 mV Voltage:                12033 mV
 +</code>
  
-Tuned system: +チューニングしたシステム: 
 +<code>
 %acpiconf -i0 %acpiconf -i0
 Design capacity:        4800 mAh Design capacity:        4800 mAh
行 221: 行 352:
 Present rate:           826 mA Present rate:           826 mA
 Voltage:                12231 mV Voltage:                12231 mV
 +</code>
  
-So I have really doubled my on-battery time by this tuning - 4:47 hours instead of 2:24 with default settings. Cooling fan, previously running all the time, now idle most of time, when system is idle. Preinstalled vendor-tuned Windows XP on the same system, provides maximum 3:20 hours.+このチューニングにより、なんとバッテリー駆動時間が2倍、デフォルト設定の2時間24分から4時間47分になりました。 
 +冷却ファンは以前は常に動いていましたが、今ではシステムがアイドル時は殆ど待機状態です、 
 +同じシステムのメーカーチューニングされたプリインストールのWindows XPでは、最大3時間20分ということでした。
  
 -- Alexander Motin  -- Alexander Motin 
 +
 +===== 翻訳履歴 =====
 +
 +  * 2019-12-01 [[https://wiki.freebsd.org/action/recall/TuningPowerConsumption?action=recall&rev=29|原文Rev.#29]]で翻訳しなおし
 +  * 2015-03-23 翻訳開始
 +
  • freebsd/tuning_power_consumption.1427082374.txt.gz
  • 最終更新: 2015-03-23 12:46
  • by Decomo