Skip to content

Instantly share code, notes, and snippets.

@TG9541
Last active December 10, 2023 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TG9541/3edda731799ecb9f31dd7a80c7e1fc64 to your computer and use it in GitHub Desktop.
Save TG9541/3edda731799ecb9f31dd7a80c7e1fc64 to your computer and use it in GitHub Desktop.
Apply "powertop tunables" to Fujitsu Futro S740

S740 Power Settings

The S740 is based on a J4105 6th gen. Intel Core SoC ("Gemini Lake") with 10W TDP. The box runs just fine with Ubuntu 22.04 Server as an always-on box.

In order to reduce power consumption the following service applies "tunables" recommended by Intel PowerTop after while starting the system.

I followed this systemd service howto.

Manual Install

sudo su
cat > /etc/systemd/system/powertop-settings.service
sudo chmod 664 /etc/systemd/system/powertop-settings.service

Contents for /etc/systemd/system/powertop-settings.service:

[Unit]
After=network.target

[Service]
ExecStart=/usr/local/bin/powertop-settings.sh

[Install]
WantedBy=default.target

Now the settings provided by powertop:

cat > /usr/local/bin/powertop-settings.sh
chmod 744 /usr/local/bin/powertop-settings.sh

Contents for /usr/local/bin/powertop-settings.sh:

#!/bin/bash
# powertop settings for Futro S740
echo '0' > '/proc/sys/kernel/nmi_watchdog'
echo '1500' > '/proc/sys/vm/dirty_writeback_centisecs'
echo 'med_power_with_dipm' > '/sys/class/scsi_host/host0/link_power_management_policy'
echo 'med_power_with_dipm' > '/sys/class/scsi_host/host1/link_power_management_policy'
echo 'auto' > '/sys/block/sda/device/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:00.0/power/control' # Gemini Lake Host Bridge
echo 'auto' > '/sys/bus/pci/devices/0000:00:00.1/power/control' # Processor Thermal Framework
echo 'auto' > '/sys/bus/pci/devices/0000:00:00.3/power/control' # Gaussian Mixture Model
echo 'auto' > '/sys/bus/pci/devices/0000:00:02.0/power/control' # UHD Graphics 600
echo 'auto' > '/sys/bus/pci/devices/0000:00:12.0/power/control' # Processor SATA Controller
echo 'auto' > '/sys/bus/pci/devices/0000:00:15.0/power/control' # USB 3.0 xHCI
echo 'auto' > '/sys/bus/pci/devices/0000:00:12.0/ata1/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:12.0/ata2/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.0/power/control' # Processor LPC Controller 
echo 'auto' > '/sys/bus/pci/devices/0000:02:00.0/power/control' # RTL8111 Ethernet Controller

Now reconfigure systemd:

sudo systemctl daemon-reload
sudo systemctl enable powertop-settings.service
@TG9541
Copy link
Author

TG9541 commented Sep 9, 2023

S740: Ubuntu Server 22.04 LTS DHCP on Ethernet hotplug:

Current Ubuntu configurations use netplan for controlling interfaces. The default configuration of Ubuntu Server uses DHCP but it doesn't bring a udev rule.

On my system yhe netplan configuration in `` looks like this:

root@s740:/etc/netplan# cat /etc/netplan/00-installer-config.yaml 
# This is the network config written by 'subiquity'
network:
  ethernets:
    eno1:
      dhcp4: true
  version: 2
root@s740:/etc/netplan#

Adding a udev rule is simple:

root@s740:/etc/netplan# cat > /etc/udev/rules.d/70-dhcp.rules
ACTION=="add", SUBSYSTEM=="net", NAME=="eno1", RUN+="/sbin/dhclient eno1"
root@s740:/etc/netplan# udevadm control --reload-rules && udevadm trigger

Now unplug the Ethernet cable and plug it in again. If the connection still works the system log should show evidence that it works:

root@s740:/etc/netplan# dmesg|tail -2
[ 7833.977979] r8169 0000:02:00.0 eno1: Link is Down
[ 7837.202384] r8169 0000:02:00.0 eno1: Link is Up - 1Gbps/Full - flow control off
root@s740:/etc/netplan#

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment