Skip to content

Commit 876db20

Browse files
authored
Merge pull request #115 from intel/intel_lpmd_next
Intel lpmd next
2 parents b3d2f89 + 8c150e6 commit 876db20

16 files changed

Lines changed: 349 additions & 190 deletions

README.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
# Intel Low Power Mode Daemon
22

3-
Intel Low Power Mode Daemon (lpmd) is a Linux daemon designed to optimize active idle power. It selects the most power-efficient CPUs based on a configuration file or CPU topology. Depending on system utilization and other hints, it puts the system into Low Power Mode by activating the power-efficient CPUs and disabling the rest, and restores the system from Low Power Mode by activating all CPUs.
3+
Intel Low Power Mode Daemon (lpmd) is a Linux daemon designed to optimize active
4+
idle power. It selects the most power-efficient CPUs based on a configuration
5+
file or CPU topology. Depending on system utilization and other hints, it puts
6+
the system into Low Power Mode by activating the power-efficient CPUs and
7+
disabling the rest, and restores the system from Low Power Mode by activating
8+
all CPUs.
49

5-
## Usage
10+
## Before You Start
11+
12+
**Please note** that the installed configuration files serve as templates of
13+
best practices for specific platform models and disable lpmd by default. For
14+
LPMD to start the user is expected to either edit the main
15+
"intel_lpmd_config.xml" config file or after starting the program, enable LPMD
16+
by using the intel_lpmd_control tool.
617

718
Refer to the man pages for command line arguments and XML configurations:
819

@@ -40,10 +51,13 @@ make
4051
sudo make install
4152
```
4253

43-
The generated artifacts are copied to respective directories under `/usr/local`. If a custom install path is preferred other than system default, make sure `--localstatedir` and `--sysconfdir` are set to the right path that the system can understand. If installed via RPM then artifacts would be under `/usr`.
44-
45-
Example command for installation using prefix under `/opt/lpmd_install` dir with `--localstatedir` and `--sysconfdir` set to system default
54+
The generated artifacts are copied to respective directories under `/usr/local`.
55+
If a custom install path is preferred other than system default, make sure
56+
`--localstatedir` and `--sysconfdir` are set to the right path that the system
57+
can understand. If installed via RPM then artifacts would be under `/usr`.
4658

59+
Example command for installation using prefix under `/opt/lpmd_install` dir with
60+
`--localstatedir` and `--sysconfdir` set to system default
4761

4862
```sh
4963
./autogen.sh prefix=/opt/lpmd_install --localstatedir=/var --sysconfdir=/etc
@@ -87,8 +101,8 @@ Start `lpmd` using:
87101
sudo sh tests/lpm_test_interface.sh 4
88102
```
89103

90-
Run a workload and monitor `lpmd` to ensure it puts the system in the appropriate state based on the load.
91-
104+
Run a workload and monitor `lpmd` to ensure it puts the system in the
105+
appropriate state based on the load.
92106

93107
## Releases
94108

configure.ac

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AC_PREREQ(1.0)
1+
AC_PREREQ([1.0])
22

33
m4_define([lpmd_major_version], [0])
44
m4_define([lpmd_minor_version], [1.0])
@@ -9,36 +9,36 @@ AC_INIT([intel_lpmd], [lpmd_version], [], [intel_lpmd])
99
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
1010

1111
AC_CONFIG_MACRO_DIR([m4])
12-
AC_CONFIG_AUX_DIR(build-aux)
12+
AC_CONFIG_AUX_DIR([build-aux])
1313
AC_CONFIG_HEADERS([config.h])
1414

1515
AM_INIT_AUTOMAKE([1.11 foreign no-define subdir-objects])
1616
AM_MAINTAINER_MODE([enable])
1717

1818
GTK_DOC_CHECK([1.11],[--flavour no-tmpl])
1919

20-
AC_ARG_WITH(dbus-sys-dir, AS_HELP_STRING([--with-dbus-sys-dir=DIR], [where D-BUS system.d directory is]))
21-
if test -n "$with_dbus_sys_dir" ; then
20+
AC_ARG_WITH([dbus-sys-dir], [AS_HELP_STRING([--with-dbus-sys-dir=DIR], [where D-BUS system.d directory is])])
21+
AS_IF([test -n "$with_dbus_sys_dir"], [
2222
DBUS_SYS_DIR="$with_dbus_sys_dir"
23-
else
23+
], [
2424
DBUS_SYS_DIR="/etc/dbus-1/system.d"
25-
fi
26-
AC_SUBST(DBUS_SYS_DIR)
25+
])
26+
AC_SUBST([DBUS_SYS_DIR])
2727

2828
# paths
29-
AC_SUBST(lpmd_binary, "$sbindir/$PACKAGE", [Binary executable])
30-
AC_SUBST(lpmd_confdir, "$sysconfdir/$PACKAGE", [Configuration directory])
31-
AC_SUBST(lpmd_rundir, "$localstatedir/run/$PACKAGE", [Runtime state directory])
29+
AC_SUBST([lpmd_binary], ["$sbindir/$PACKAGE"], [Binary executable])
30+
AC_SUBST([lpmd_confdir], ["$sysconfdir/$PACKAGE"], [Configuration directory])
31+
AC_SUBST([lpmd_rundir], ["$localstatedir/run/$PACKAGE"], [Runtime state directory])
3232

3333
PKG_PROG_PKG_CONFIG
3434
AC_ARG_WITH([systemdsystemunitdir],
35-
AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
36-
[], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
37-
if test "x$with_systemdsystemunitdir" != xno; then
35+
[AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],
36+
[], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
37+
AS_IF([test "x$with_systemdsystemunitdir" != xno], [
3838
AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
39-
fi
39+
])
4040

41-
AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
41+
AM_CONDITIONAL([HAVE_SYSTEMD], [test -n "$with_systemdsystemunitdir" && test "x$with_systemdsystemunitdir" != xno])
4242

4343
# print configuration
4444
echo
@@ -52,26 +52,26 @@ echo " lpmd_rundir: $lpmd_rundir"
5252
echo
5353

5454
GETTEXT_PACKAGE=intel_lpmd
55-
AC_SUBST(GETTEXT_PACKAGE)
56-
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
55+
AC_SUBST([GETTEXT_PACKAGE])
56+
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [Gettext package])
5757

5858
GLIB_VERSION_DEFINES="-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_26"
5959

60-
PKG_CHECK_MODULES(GLIB, gio-unix-2.0 >= 2.22 gmodule-2.0 glib-2.0 gobject-2.0)
60+
PKG_CHECK_MODULES([GLIB], [gio-unix-2.0 >= 2.22 gmodule-2.0 glib-2.0 gobject-2.0])
6161
GLIB_CFLAGS="$GLIB_CFLAGS $GLIB_VERSION_DEFINES"
62-
AC_SUBST(GLIB_CFLAGS)
63-
AC_SUBST(GLIB_LIBS)
62+
AC_SUBST([GLIB_CFLAGS])
63+
AC_SUBST([GLIB_LIBS])
6464

65-
PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.4)
65+
PKG_CHECK_MODULES([XML], [libxml-2.0 >= 2.4])
6666

67-
PKG_CHECK_MODULES(libnl30, [libnl-3.0], libnl30=yes, libnl30=no)
68-
PKG_CHECK_MODULES(libnlgenl30, [libnl-genl-3.0], libnlgenl30=yes, libnlgenl30=no)
67+
PKG_CHECK_MODULES([libnl30], [libnl-3.0], [libnl30=yes], [libnl30=no])
68+
PKG_CHECK_MODULES([libnlgenl30], [libnl-genl-3.0], libnlgenl30=yes, libnlgenl30=no)
6969

7070
PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [],
7171
[PKG_CHECK_MODULES([SYSTEMD], [libsystemd-daemon], [],
72-
AC_MSG_ERROR([libsystemd support requested but found]))])
72+
[AC_MSG_ERROR([libsystemd support requested but not found])])])
7373

74-
PKG_CHECK_MODULES(UPOWER, upower-glib)
74+
PKG_CHECK_MODULES([UPOWER], [upower-glib])
7575

7676
AC_PATH_PROG([GDBUS_CODEGEN],[gdbus-codegen])
7777

@@ -81,14 +81,14 @@ AC_C_CONST
8181
AC_C_INLINE
8282
AC_TYPE_SIZE_T
8383

84-
AC_ARG_ENABLE(werror, AS_HELP_STRING([--disable-werror], [Disable -Werror]))
84+
AC_ARG_ENABLE([werror], [AS_HELP_STRING([--disable-werror], [Disable -Werror])])
8585
AS_IF([test "x$enable_werror" != "xno"], [CFLAGS="$CFLAGS -Werror"])
8686

8787
AC_CONFIG_FILES([Makefile
8888
data/Makefile
8989
tools/Makefile])
9090

91-
AC_ARG_ENABLE(gdbus,
91+
AC_ARG_ENABLE([gdbus],
9292
[AS_HELP_STRING([--disable-gdbus],
9393
[Switch DBus backend to glib-dbus. (Default: GDBus)])],
9494
[],

data/intel_lpmd_config_F6_M204.xml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,19 +146,19 @@ for Intel Energy Optimizer (LPMD) daemon
146146
<ID> 1 </ID>
147147
<Name> UTIL_IDLE </Name>
148148
<WLTType> 1 </WLTType>
149-
<ActiveCPUs>16-19</ActiveCPUs>
149+
<ActiveCPUs>12-15</ActiveCPUs>
150150
</State>
151151
<State>
152152
<ID> 2 </ID>
153153
<Name> UTIL_IDLE_SUSTAIN </Name>
154154
<WLTType> 2 </WLTType>
155-
<ActiveCPUs>0-19</ActiveCPUs>
155+
<ActiveCPUs>0-15</ActiveCPUs>
156156
</State>
157157
<State>
158158
<ID> 3 </ID>
159159
<Name> UTIL_IDLE_BURSTY </Name>
160160
<WLTType> 3 </WLTType>
161-
<ActiveCPUs>0-19</ActiveCPUs>
161+
<ActiveCPUs>0-15</ActiveCPUs>
162162
</State>
163163
</States>
164164

@@ -186,4 +186,28 @@ for Intel Energy Optimizer (LPMD) daemon
186186
</State>
187187
</States>
188188

189+
<States>
190+
<CPUFamily> 6 </CPUFamily>
191+
<CPUModel> 204 </CPUModel>
192+
<CPUConfig> 4P0E4L-25W </CPUConfig>
193+
<State>
194+
<ID> 1 </ID>
195+
<Name> UTIL_IDLE </Name>
196+
<WLTType> 1 </WLTType>
197+
<ActiveCPUs>4-7</ActiveCPUs>
198+
</State>
199+
<State>
200+
<ID> 2 </ID>
201+
<Name> UTIL_IDLE_SUSTAIN </Name>
202+
<WLTType> 2 </WLTType>
203+
<ActiveCPUs>0-7</ActiveCPUs>
204+
</State>
205+
<State>
206+
<ID> 3 </ID>
207+
<Name> UTIL_IDLE_BURSTY </Name>
208+
<WLTType> 3 </WLTType>
209+
<ActiveCPUs>0-7</ActiveCPUs>
210+
</State>
211+
</States>
212+
189213
</Configuration>

data/org.freedesktop.intel_lpmd.conf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,5 @@
1616
<deny send_destination="org.freedesktop.intel_lpmd"/>
1717
<allow receive_sender="org.freedesktop.intel_lpmd"/>
1818
</policy>
19-
<policy group="power">
20-
<allow send_destination="org.freedesktop.intel_lpmd"/>
21-
<allow receive_sender="org.freedesktop.intel_lpmd"/>
22-
</policy>
2319

2420
</busconfig>

man/intel_lpmd.8

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
.\"
2222
.\" Copyright (C) 2012 Intel Corporation. All rights reserved.
2323
.\"
24-
.TH intel_lpmd "8" "1 Jun 2023"
24+
.TH intel_lpmd "8" "08 Apr 2026"
2525

2626
.SH NAME
2727
intel_lpmd \- Intel Energy Optimizer (LPMD) Daemon
@@ -31,25 +31,24 @@ intel_lpmd \- Intel Energy Optimizer (LPMD) Daemon
3131

3232
.SH DESCRIPTION
3333
.B intel_lpmd
34-
is a Linux daemon used for energy optimization on Intel hybrid systems.
35-
This daemon uses a configuration file "intel_lpmd_config.xml".
36-
Based on the configuration, it will choose right set of CPUs
37-
to enable. For example, this daemon can monitor system utilization
38-
and choose a set of low power CPUs to enable and disable the rest.
39-
This enable disable of CPUs are done using Linux cpuset feature
40-
of intel power clamp driver.
41-
42-
There is a control utility distributed along with this daemon.
43-
This control utility is called "intel_lpmd_control". This utility
44-
can be used to set different modes for this daemon.
45-
For example:
46-
intel_lpmd_control ON
47-
To turn on low power mode operation.
48-
intel_lpmd_control OFF
49-
To turn off low power mode operation.
50-
intel_lpmd_control AUTO
51-
To turn on low power mode operation in auto mode, which
52-
allows low power mode based on system utilization.
34+
is a Linux daemon used for energy optimization on Intel hybrid systems. This
35+
daemon uses a configuration file called "intel_lpmd_config.xml". The other
36+
installed configuration files are to be treated as best practice templates. The
37+
main configuration file should be edited by the user to enable LPMD and it's
38+
desired functionalities. Based on the configuration and system utilization LPMD
39+
can:
40+
41+
- choose the best set of CPU cores to enable for a given moment in time
42+
43+
- choose the best EPP (energe performance preference) and EPB (energy
44+
performance bias) value
45+
46+
- pick the best SoC power slider settings
47+
48+
There is a control utility distributed along with this daemon. It's called
49+
"intel_lpmd_control" and it can be used to change modes in the running LPMD
50+
instance.
51+
5352
.SH OPTIONS
5453
.TP
5554
.B -h --help
@@ -88,8 +87,13 @@ Run intel_lpmd with log directed to stdout
8887
.B intel_lpmd --systemd --dbus-enable
8988
Run intel_lpmd as a service with logs directed to system journal
9089

90+
.TP
91+
.B sudo systemctl enable intel_lpmd.service --now
92+
Enable and run intel_lpmd as a systemd service that's persistent after system
93+
reboot.
94+
9195
.SH SEE ALSO
92-
intel_lpmd_config.xml(5)
96+
intel_lpmd_config.xml(5), intel_lpmd_control(8)
9397

9498
.SH AUTHOR
9599
Written by Zhang Rui <rui.zhang@intel.com>

0 commit comments

Comments
 (0)