SATA link power management – large power savings

The powertop utility suggests “SATA link power management” be enabled.

Enabling this, which can be done manually with: 

echo 'min_power'> /sys/class/scsi_host/host0/link_power_management_policy

saves a shocking 900mW, almost 20% of system power consumption at idle, on my NB10 with Crucial M500 SSD. This extends the runtime of the idle system on battery power by a full hour, from 4h30 to 5h30.

The ‘medium_power’ setting saves approximately 250mW over the default ‘max_performance’ setting and has no noticeable performance impact.

Disk performance is affected if ‘min_power’ is used. Sustained transfers do not drop much – for example (measured with ‘hdparm -Tt /dev/sda’) the drop is under 10% – from 1500MB/sec reads to 1400.

I tested a small data transfer on a completely idle system with:

sync ; echo 3 > /proc/sys/vm/drop_caches ; sleep 5 ;\
time dd if=/dev/zero of=/tmp/emptyfile bs=1024k count=1 ;\
rm emptyfile

The “min_power” setting increases the time it takes complete this 1Mbyte disk write from from 20ms to 120ms – quite dramatic.

The performance loss comes from the time taken to wake the SATA electronics up. Once awake, it’s little slower (if at all), until it goes back to sleep again. A sustained transfer (for example substituting “1000” for “1” in the “count” of the dd command above) sees little difference in performance.

The best option is likely to be, using min_power when on battery, and max_performance when on mains power. The pm-utils package can manage this for you.

There is a possibility of drive corruption and data loss with use of medium_power and min_power settings – although in the great majority of cases, no problems will be seen. I’ve used my NB10+M500 combination intensively with ‘min_power’ enabled and am reasonably happy that it is safe.

Advertisements

NB10 power consumption – N2810 and N3510 (dual/quad core) comparison

I had the opportunity to compare the same build of Debian Linux running on two different NB10s. Both were otherwise identical (same RAM, disk, installation). The quad-core (N3510) unit arrived with BIOS 1.00, so it was possible to gather statistics on this unit with both the original BIOS, and the latest version at time of testing (1.20).

The full table of results is available in a Google Docs spreadsheet.

Summary of results:

  • The quad-core unit uses no extra power at idle.
  • BIOS version 1.20 uses approximately 200mW less power than BIOS version 1.00 in all states.
  • With two CPU cores fully utilised and two idle, the dual- and quad- core units’ power consumption is almost identical.
  • With a greater CPU load, the quad-core unit can use more power than the dual-core.

This in itself does not mean that, for a given use case, that the quad-core unit will have a shorter battery life. More CPU power can allow a given operation to complete, and the system (CPUs and disks) to return to idle state, more quickly.

  • The difference between minimum and maximum screen brightness is 1.4W.
  • These results are with all powertop suggestions enabled. These in total save about a watt – highly significant on a 5W computer.

NB10 bluetooth

The NB10 ships with an Atheros QCA9565/AR9565 mini-pcie card, which is a combined wireless ethernet and bluetooth device.

The ar9565 (wlan) part works out-of-the-box.

In Debian jessie, the qca9565 (bluetooth) controller requires that the “firmware-atheros” package be installed. Before this is done, an error like this will be seen from the kernel on boot:

usb x-y: firmware: failed to load ar3k/AthrBT_0x31910000.dfu (-2)
usb x-y: firmware: Direct firmware failed to load with error -2

and “hcitool dev” will show no devices. In this state the bluetooth icon (from the bluetooth-applet program) will not appear on the desktop and the system will appear to not have bluetooth connectivity.

So long as the “bluetooth” and “bluetooth-gnome” packages are installed, this is all you need; the blueooth icon will then appear in the GNOME notification area and bluetooth apps & devices will be available as normal. If you don’t use Blueooth it should probably be disabled for security reasons.

This device is relatively new and kernel support for it is quite modern. Older distributions/kernels may have more trouble. This works for me using 3.14rc7.

Powertop’s power consumption measurement is only a rough measure, but it suggests there’s no impact on power consumption from loading the bluetooth driver. There will obviously be some impact if bluetooth connectivity is used.

NB10 CPU thermal throttling – unanswered questions

Like the popular Macbook Air and many other laptops, the NB10 is not able to run the CPUs and GPUs indefinitely at maximum effort, due to overheating. Unlike the Macbook Air, the NB10 is fanless.

The NB10 CPUs and GPUs will throttle as the system temperature rises, reducing both performance and heat output. The notebookcheck.net review notes that under a stress test, the dual-core N2810 variants will throttle down from 2GHz to 1.6GHz and the GPU down from 756MHz to 711MHz.

The same article notes that the CPU cores’ maximum temperature is 69C.

Under Linux, this throttling appears to be happening automatically (and without any effect on usability & perceived performance that I have been able to observe). When the CPU throttles, and then unthrottes, Machine Check Exception (MCE) lines are generated in the kernel ring buffer (“dmesg”) and further details are logged which can be collected and examined with the “mcelog” tool.

The throttling events look like this in the syslog:

Mar 30 08:12:14 hostname kernel: [78131.019009] CPU0: Core temperature/speed normal
Mar 30 08:12:14 hostname kernel: [78131.019019] CPU1: Core temperature/speed normal
Mar 30 08:12:35 hostname kernel: [78151.388917] mce: [Hardware Error]: Machine check events logged
Mar 30 08:23:17 hostname mcelog: Processor 1 heated above trip temperature. Throttling enabled.
Mar 30 08:23:17 hostname mcelog: Please check your system cooling. Performance will be impacted
Mar 30 08:23:17 hostname mcelog: Processor 0 heated above trip temperature. Throttling enabled.
Mar 30 08:23:17 hostname mcelog: Please check your system cooling. Performance will be impacted
Mar 30 08:23:17 hostname mcelog: Processor 1 below trip temperature. Throttling disabled
Mar 30 08:23:17 hostname mcelog: Processor 0 below trip temperature. Throttling disabled

And in the mcelog output:

mcelog: failed to prefill DIMM database from DMI data
mcelog: Unsupported new Family 6 Model 37 CPU: only decoding architectural errors
Hardware event. This is not a software error.
MCE 0
CPU 1 THERMAL EVENT TSC 4fe066a71219
TIME 1396163533 Sun Mar 30 08:12:13 2014
Processor 1 heated above trip temperature. Throttling enabled.
Please check your system cooling. Performance will be impacted
STATUS 8832000f MCGSTATUS 0
MCGCAP 806 APICID 2 SOCKETID 0
CPUID Vendor Intel Family 6 Model 55
mcelog: Unsupported new Family 6 Model 37 CPU: only decoding architectural errors
Hardware event. This is not a software error.
MCE 1
CPU 0 THERMAL EVENT TSC 4fe066a7467b
TIME 1396163533 Sun Mar 30 08:12:13 2014
Processor 0 heated above trip temperature. Throttling enabled.
Please check your system cooling. Performance will be impacted
STATUS 8833000f MCGSTATUS 0
MCGCAP 806 APICID 0 SOCKETID 0
CPUID Vendor Intel Family 6 Model 55

And the unthrottling:

mcelog: failed to prefill DIMM database from DMI data
mcelog: Unsupported new Family 6 Model 37 CPU: only decoding architectural errors
Hardware event. This is not a software error.
MCE 0
CPU 1 THERMAL EVENT TSC 4fe066a71219
TIME 1396163533 Sun Mar 30 08:12:13 2014
Processor 1 heated above trip temperature. Throttling enabled.
Please check your system cooling. Performance will be impacted
STATUS 8832000f MCGSTATUS 0
MCGCAP 806 APICID 2 SOCKETID 0
CPUID Vendor Intel Family 6 Model 55
mcelog: Unsupported new Family 6 Model 37 CPU: only decoding architectural errors
Hardware event. This is not a software error.
MCE 1
CPU 0 THERMAL EVENT TSC 4fe066a7467b
TIME 1396163533 Sun Mar 30 08:12:13 2014
Processor 0 heated above trip temperature. Throttling enabled.
Please check your system cooling. Performance will be impacted
STATUS 8833000f MCGSTATUS 0
MCGCAP 806 APICID 0 SOCKETID 0
CPUID Vendor Intel Family 6 Model 55

I’ve not been able to reliably generate these errors – I’ve seen only a handful. Running typical load-testing tools such as “stress” is not reliably generating these errors.

The “sensors” command output may not be giving accurate data; certainly the 100C thresholds it’s reporting do not appear to be accurate. After running ‘stress’ cpu hogs for 20 minutes, I see no mce log events, the bottom of the case remains cool to the touch, and ‘sensors’ reports:

acpitz-virtual-0
Adapter: Virtual device
temp1:        +29.0°C  (crit = +98.0°C)

coretemp-isa-0000
Adapter: ISA adapter
Core 0:       +39.0°C  (high = +100.0°C, crit = +100.0°C)
Core 1:       +39.0°C  (high = +100.0°C, crit = +100.0°C)

There seems to be little to no impact on interactive usage of the machine from this occasional throttling. What I’m curious about is:

  • What is the actual maximum temperature of the CPU?
  • Is “sensors” truly displaying the current temperature?
  • Is the throttling configurable in any way?

Fixing Toshiba NB10 Linux resume-from-suspend issues

I found that the NB10 would reliably go in to suspend, but would not reliably resume. Resuming sometimes resulted on a power-on and the backlight coming back on, but nothing showing on the screen. Pressing the caps-lock key did toggle the light, and the laptop’s IP did answer pings and incoming ssh requests after resume, showing that the system was alive.

This appears to have been caused by a problem with the keyboard controller (which also runs the trackpad) not being correctly re-initialised on resume. The screen remains blank because of the inactivity timeout.

Appending “i8042.reset i8042.nomux=1” to the kernel commandline fixes this.

After this, I found both suspend-to-RAM and suspend-to-disk (hibernate) to work reliably.

The built-in Realtek RTL8101E wired ethernet remains broken after a resume from either suspend or hibernation, irrespective of whether the nonfree firmware-realtek package is installed.

NB10 links

I intend to keep this post up-to-date as I discover new sources of information

Finding information about the current NB10 online is complicated by Toshiba having made a model called NB10 before.

The previous NB10 was a netbook from the 2007/2008 vintage with the old Atom N270 CPU. It’s not clear to me how widely it was sold – I suspect it was restricted to a limited number of countries.

Reviews:

  • Notebookcheck review – very comprehensive with lots of technical detail. Not very complimentary and does not recommend the NB10.
  • Revoo (crowdsourced) reviews – much less technical.
  • I’ve started a linlap.com page about it.

Driver downloads:

  • Toshiba site – note that there are no Windows 7 drivers. You can download the BIOS from here (current version at time of writing is 1.20) – unfortunately you will need Windows to run the BIOS flashing program.

Other forums:

  • Toshiba appear to have several forums: Europe has some information. There’s also a US/World forum (with nothing useful at time of writing). These forums appear to be heavily “curated” with threads suggestive of difficulty with the product being silently disappeared. At the time I made my purchase, a forum search for NB10 would find numerous threads about problems with UEFI booting. All of these threads have vanished now.
  • Toshiba have a website and a mailing list about running Linux on their hardware. Sadly, both appear to be abandoned.

UK Suppliers:

  • I bought my NB10 in the UK from Argos. Their returns policy is relatively friendly if a machine turns out not to be suitable and their stores are everywhere. I paid £299.99 – prices seem to change daily.
  • There are several suppliers on Amazon and Ebay. There seem to be several different models on offer – check carefully which one you are buying.
  • John Lewis stock it.
  • PC World stock it.
  • So do the co-op and Misco at the time of writing.
  • If you’re in the UK, always check Hotukdeals for offers before making a major purchase like a laptop.