Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1332588 > unrolled thread

Energy consumption oddity on a Mac-Mini

Started bymoosotc@gmail.com
First post2016-02-12 10:00 +0100
Last post2016-02-13 16:40 +0100
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  Energy consumption oddity on a Mac-Mini moosotc@gmail.com - 2016-02-12 10:00 +0100
    Re: Energy consumption oddity on a Mac-Mini moosotc@gmail.com - 2016-02-13 16:40 +0100

#1332588 — Energy consumption oddity on a Mac-Mini

Frommoosotc@gmail.com
Date2016-02-12 10:00 +0100
SubjectEnergy consumption oddity on a Mac-Mini
Message-ID<r1hK3-4Ac-7@gated-at.bofh.it>
Hello,

Trying to make Linux consume as little(or less) power as OS X does on
this Mac mini (as measured by watt meter that sits between the box and
the power outlet) led me to the following sequence of commands:

[..start script..]
#!/bin/sh
set -e
test "$(id -u)" != "0" && exec sudo "$0" "$@"
echo powersave >/sys/module/pcie_aspm/parameters/policy
echo 1 >/sys/module/snd_hda_intel/parameters/power_save
echo min_power >/sys/class/scsi_host/host0/link_power_management_policy
echo 1 | tee >/dev/null /sys/bus/usb/devices/*/power/autosuspend
echo auto | tee >/dev/null /sys/devices/**/power/control

# Suspend to RAM only to restore in six seconds
# for some reason this step is essential here:
#    product: Macmini7,1 (System SKU#)
#    vendor: Apple Inc.
#    version: 1.0

echo +6 >/sys/class/rtc/rtc0/wakealarm
echo mem >/sys/power/state
echo 0 >/sys/class/rtc/rtc0/wakealarm
[..end script..]

Last 3 lines are the source of my confusion, why is this needed? The
situation is as follows:

* after boot the system consumes 8-9 watts
* with powertop(8) inspired sysfs tweaks but without the suspension 6-7
* with the suspend oscillating around 5-6

Would be nice to really know what's going on here. (My Linux-power-fu is
not too great)

-- 
mailto:moosotc@gmail.com

[toc] | [next] | [standalone]


#1333332

Frommoosotc@gmail.com
Date2016-02-13 16:40 +0100
Message-ID<r1KsG-6Gd-15@gated-at.bofh.it>
In reply to#1332588
moosotc@gmail.com writes:

> Hello,
>
> Trying to make Linux consume as little(or less) power as OS X does on
> this Mac mini (as measured by watt meter that sits between the box and
> the power outlet) led me to the following sequence of commands:
>

Here's a better one, the one that is actually beging used at this very
moment and that almost halves the Linux's power glut (on this particular
box, might be applicable to MBPros with i915 (then again might not)).

#!/bin/sh
set -e

test "$(id -u)" != "0" && exec sudo ${DISPLAY:+-A} "$0" "$@"
printf '\033[?17;0;0c\n' | tee >/dev/null $(seq -f '/dev/tty%g' 1 7)
echo 'powersave' >/sys/module/pcie_aspm/parameters/policy
echo '6000' >/proc/sys/vm/dirty_writeback_centisecs
echo '1' >/sys/module/snd_hda_intel/parameters/power_save
echo 'min_power' >/sys/class/scsi_host/host0/link_power_management_policy
cpupower frequency-set --governor powersave
x86_energy_perf_policy powersave
echo '0' >/proc/sys/kernel/nmi_watchdog
echo '1' | tee >/dev/null /sys/bus/usb/devices/*/power/autosuspend
echo 'auto' | tee >/dev/null /sys/devices/**/power/control
for f in $(find /sys/devices -name product -type f); do
    expr "$(cat $f)" : "USB.*\(Keyboard\|Mouse\)" >/dev/null && {
        echo '0' >$(dirname $f)/power/autosuspend
    } || true
done

# Mysterious part starts here
echo '+6' >/sys/class/rtc/rtc0/wakealarm
echo 'mem' >/sys/power/state
echo '-1' >/sys/class/rtc/rtc0/wakealarm

[..snip..]

-- 
mailto:moosotc@gmail.com

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web