linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: moosotc@gmail.com
To: linux-kernel@vger.kernel.org
Subject: Re: Energy consumption oddity on a Mac-Mini
Date: Sat, 13 Feb 2016 18:27:07 +0300	[thread overview]
Message-ID: <8737swtyus.fsf@gmail.com> (raw)
In-Reply-To: 87k2mauxbb.fsf@gmail.com

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

      reply	other threads:[~2016-02-13 15:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-12  8:50 Energy consumption oddity on a Mac-Mini moosotc
2016-02-13 15:27 ` moosotc [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8737swtyus.fsf@gmail.com \
    --to=moosotc@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).