GNU bug report logs - #26919
[PATCH] Add thermald and thermald-service-type (for cpu frequency scaling)

Previous Next

Package: guix-patches;

Reported by: Christopher Allan Webber <cwebber <at> dustycloud.org>

Date: Sun, 14 May 2017 05:31:01 UTC

Severity: normal

Tags: patch

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 26919 in the body.
You can then email your comments to 26919 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#26919; Package guix-patches. (Sun, 14 May 2017 05:31:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christopher Allan Webber <cwebber <at> dustycloud.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 14 May 2017 05:31:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christopher Allan Webber <cwebber <at> dustycloud.org>
To: guix-patches <at> gnu.org
Subject: [PATCH] Add thermald and thermald-service-type (for cpu frequency
 scaling)
Date: Sun, 14 May 2017 00:29:36 -0500
[Message part 1 (text/plain, inline)]
Trying again, since last time I accidentally sent to bug-guix... oops.

Hello!  I got tired of my laptop crashing so much due to overheating, so
here's a package for thermald as well as a service type.

[0001-gnu-Add-thermald.patch (text/x-patch, inline)]
From 56c7019d58d4a064fe44e626a1396b62cbf808b0 Mon Sep 17 00:00:00 2001
From: Christopher Allan Webber <cwebber <at> dustycloud.org>
Date: Sat, 13 May 2017 19:36:01 -0500
Subject: [PATCH 1/2] gnu: Add thermald.

* gnu/packages/admin.scm (thermald): New variable.
---
 gnu/packages/admin.scm | 54 +++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 53 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index ff0431999..20cb8f180 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -17,6 +17,7 @@
 ;;; Copyright © 2016 John Darrington <jmd <at> gnu.org>
 ;;; Copyright © 2017 Ben Sturmfels <ben <at> sturm.com.au>
 ;;; Copyright © 2017 Ethan R. Jones <doubleplusgood23 <at> gmail.com>
+;;; Copyright © 2017 Christopher Allan Webber <cwebber <at> dustycloud.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -80,7 +81,8 @@
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages kerberos)
-  #:use-module (gnu packages gtk))
+  #:use-module (gnu packages gtk)
+  #:use-module (gnu packages xml))
 
 (define-public aide
   (package
@@ -2130,3 +2132,53 @@ logo, or any ASCII file of your choice.  The main purpose of Neofetch is to be
 used in screenshots to show other users what operating system or distribution
 you are running, what theme or icon set you are using, etc.")
     (license license:expat)))
+
+(define-public thermald
+  (package
+    (name "thermald")
+    (version "1.6")
+    (source
+     (origin
+      (method url-fetch)
+      (uri (string-append "https://github.com/01org/thermal_daemon/archive/v"
+                          version ".tar.gz"))
+      (sha256 (base32
+               "14klz9fnvi9jdlaqwrp61xa5nh051n8ykrs1fh1wxd7j66qf2fn6"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases (modify-phases %standard-phases
+                  (add-after
+                   'unpack 'autogen.sh-and-fix-paths
+                   (lambda* (#:key outputs #:allow-other-keys)
+                     (let ((out (assoc-ref outputs "out")))
+                       ;; upstartconfir is hardcoded to /etc/init and the build
+                       ;; system tries to mkdir that.  We don't even need upstart
+                       ;; files at all; this is a fast and kludgy workaround
+                       (substitute* "data/Makefile.am"
+                         (("upstartconfdir = /etc/init")
+                          (string-append "upstartconfdir = "
+                                         out "/etc/init")))
+                       ;; Now run autogen
+                       (zero? (system* "sh" "autogen.sh"))))))
+       #:configure-flags
+       (let ((out      (assoc-ref %outputs "out")))
+         (list (string-append "--sysconfdir="
+                              out "/etc")
+               (string-append "--with-udev-dir="
+                              out "/lib/udev")
+               (string-append "--with-dbus-sys-dir="
+                              out "/etc/dbus-1/system.d")
+               "--localstatedir=/var"))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("glib" ,glib "bin")             ; for glib-genmarshal, etc.
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("dbus-glib" ,dbus-glib)
+       ("libxml2" ,libxml2)))
+    (home-page "https://01.org/linux-thermal-daemon/")
+    (synopsis "CPU scaling for thermal management")
+    (description "The Linux Thermal Daemon helps monitor and control temperature
+on systems running the Linux kernel.")
+    (license license:gpl2+)))
-- 
2.12.2

[0002-services-Add-thermald-service-type.patch (text/x-patch, inline)]
From de2045cdc81ddef7b01b3445fb731a3252f5b4a8 Mon Sep 17 00:00:00 2001
From: Christopher Allan Webber <cwebber <at> dustycloud.org>
Date: Sat, 13 May 2017 19:37:02 -0500
Subject: [PATCH 2/2] services: Add 'thermald-service-type'.

* gnu/services/admin.scm (<thermald-configuration>): New record type.
(thermald-shepherd-service, thermald-service-type): New variables.
* doc/guix.texi (Thermal Management): New section documenting thermald.
---
 doc/guix.texi          | 23 ++++++++++++++++++++++-
 gnu/services/admin.scm | 51 ++++++++++++++++++++++++++++++++++++++++++++++----
 2 files changed, 69 insertions(+), 5 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 22dc8b3f9..1fee7616c 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -35,7 +35,8 @@ Copyright @copyright{} 2017 Mathieu Othacehe@*
 Copyright @copyright{} 2017 Federico Beffa@*
 Copyright @copyright{} 2017 Carlo Zancanaro@*
 Copyright @copyright{} 2017 Thomas Danckaert@*
-Copyright @copyright{} 2017 humanitiesNerd
+Copyright @copyright{} 2017 humanitiesNerd@*
+Copyright @copyright{} 2017 Christopher Allan Webber
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -14746,6 +14747,26 @@ The following is an example @code{dicod-service} configuration.
                     %dicod-database:gcide))))
 @end example
 
+@subsection Thermal Management
+
+The @code{(gnu services admin)} module provides an interface to
+thermald, a cpu frequency scaling service which helps prevent overheating.
+
+@defvr {Scheme Variable} thermald-service-type
+This is the service type for thermald.
+@end defvr
+
+@deftp {Data Type} thermald-configuration
+Data type representing the configuration of THERMALD-SERVICE.
+
+@table @asis
+@item @code{ignore-cpuid-check?} {default: @code{#f}}
+Ignore cpuid check for supported CPU models.
+
+@end table
+@end deftp
+
+
 @subsubsection Version Control
 
 The @code{(gnu services version-control)} module provides the following services:
diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm
index 6ac24e32b..ec274b416 100644
--- a/gnu/services/admin.scm
+++ b/gnu/services/admin.scm
@@ -32,17 +32,27 @@
             rottlog-configuration
             rottlog-configuration?
             rottlog-service
-            rottlog-service-type))
+            rottlog-service-type
+
+            thermald-configuration
+            thermald-service-type))
 
 ;;; Commentary:
 ;;;
-;;; This module implements configuration of rottlog by writing
+;;; Various administration services.
+;;;
+;;; Code:
+
+
+
+;;;
+;;; Rotlog
+;;;
+;;; This service implements configuration of rottlog by writing
 ;;; /etc/rottlog/{rc,hourly|daily|weekly}.  Example usage
 ;;;
 ;;;     (mcron-service)
 ;;;     (service rottlog-service-type (rottlog-configuration))
-;;;
-;;; Code:
 
 (define %rotated-files
   ;; Syslog files subject to rotation.
@@ -118,4 +128,37 @@
                                         (compose list rottlog-rottlog))))
    (default-value (rottlog-configuration))))
 
+
+
+;;;
+;;; thermald
+;;;
+;;; This service implements cpu scaling.  Helps prevent overheating!
+
+(define-record-type* <thermald-configuration>
+  thermald-configuration make-thermald-configuration
+  thermald-configuration?
+  (ignore-cpuid-check? thermald-ignore-cpuid-check?
+                       (default #f)))
+
+(define (thermald-shepherd-service config)
+  (list
+   (shepherd-service
+    (provision '(thermald))
+    (documentation "Run thermald cpu frequency scaling.")
+    (start #~(make-forkexec-constructor
+              '(#$(file-append thermald "/sbin/thermald")
+                "--no-daemon"
+                #$@(if (thermald-ignore-cpuid-check? config)
+                       '("--ignore-cpuid-check")
+                       '()))))
+    (stop #~(make-kill-destructor)))))
+
+(define thermald-service-type
+  (service-type
+   (name 'thermald)
+   (extensions (list (service-extension shepherd-root-service-type
+                                        thermald-shepherd-service)))
+   (default-value (thermald-configuration))))
+
 ;;; admin.scm ends here
-- 
2.12.2

[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#26919; Package guix-patches. (Sun, 14 May 2017 13:08:02 GMT) Full text and rfc822 format available.

Message #8 received at 26919 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Christopher Allan Webber <cwebber <at> dustycloud.org>
Cc: 26919 <at> debbugs.gnu.org
Subject: Re: bug#26919: [PATCH] Add thermald and thermald-service-type (for
 cpu frequency scaling)
Date: Sun, 14 May 2017 15:07:17 +0200
Hi!

Christopher Allan Webber <cwebber <at> dustycloud.org> skribis:

> Trying again, since last time I accidentally sent to bug-guix... oops.
>
> Hello!  I got tired of my laptop crashing so much due to overheating, so
> here's a package for thermald as well as a service type.

Heheh.  :-)

> From 56c7019d58d4a064fe44e626a1396b62cbf808b0 Mon Sep 17 00:00:00 2001
> From: Christopher Allan Webber <cwebber <at> dustycloud.org>
> Date: Sat, 13 May 2017 19:36:01 -0500
> Subject: [PATCH 1/2] gnu: Add thermald.
>
> * gnu/packages/admin.scm (thermald): New variable.

LGTM!

> From de2045cdc81ddef7b01b3445fb731a3252f5b4a8 Mon Sep 17 00:00:00 2001
> From: Christopher Allan Webber <cwebber <at> dustycloud.org>
> Date: Sat, 13 May 2017 19:37:02 -0500
> Subject: [PATCH 2/2] services: Add 'thermald-service-type'.
>
> * gnu/services/admin.scm (<thermald-configuration>): New record type.
> (thermald-shepherd-service, thermald-service-type): New variables.
> * doc/guix.texi (Thermal Management): New section documenting thermald.

[...]

> +@subsection Thermal Management

Would it make sense to move it under “Power Management Services” rather
than “Miscellaneous Services”?

> +The @code{(gnu services admin)} module provides an interface to
> +thermald, a cpu frequency scaling service which helps prevent overheating.

s/cpu/CPU/ :-)

> +@defvr {Scheme Variable} thermald-service-type
> +This is the service type for thermald.

What about something like this, to give more context:

  … for @uref{https://01.org/linux-thermal-daemon/, thermald}, the Linux
  Thermal Daemon, which is responsible for controlling the thermal state
  of Intel processors and preventing overheating.

?

> +@deftp {Data Type} thermald-configuration
> +Data type representing the configuration of THERMALD-SERVICE.

s/THERMALD-SERVICE/@code{thermald-service-type}/

> +(define-record-type* <thermald-configuration>
> +  thermald-configuration make-thermald-configuration
> +  thermald-configuration?
> +  (ignore-cpuid-check? thermald-ignore-cpuid-check?
> +                       (default #f)))

Could you add a ‘thermald’ field, defaulting to ‘thermald’ (the package)…

> +(define (thermald-shepherd-service config)
> +  (list
> +   (shepherd-service
> +    (provision '(thermald))
> +    (documentation "Run thermald cpu frequency scaling.")
> +    (start #~(make-forkexec-constructor
> +              '(#$(file-append thermald "/sbin/thermald")

… and honor it here, and add it to guix.texi?

OK with these changes, thank you!

Do you think it’s something we should add to ‘%base-services’, or is it
too hardware-dependent?

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#26919; Package guix-patches. (Sun, 14 May 2017 15:51:02 GMT) Full text and rfc822 format available.

Message #11 received at 26919 <at> debbugs.gnu.org (full text, mbox):

From: Christopher Allan Webber <cwebber <at> dustycloud.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 26919 <at> debbugs.gnu.org
Subject: Re: bug#26919: [PATCH] Add thermald and thermald-service-type (for
 cpu frequency scaling)
Date: Sun, 14 May 2017 10:49:59 -0500
[Message part 1 (text/plain, inline)]
Ludovic Courtès writes:

>> +@subsection Thermal Management
>
> Would it make sense to move it under “Power Management Services” rather
> than “Miscellaneous Services”?

Oh sure, I hadn't seen that.

Before I push, do you think this means that I should probably move the
service to (gnu services pm) as well?

>> +The @code{(gnu services admin)} module provides an interface to
>> +thermald, a cpu frequency scaling service which helps prevent overheating.
>
> s/cpu/CPU/ :-)

OK!

>> +@defvr {Scheme Variable} thermald-service-type
>> +This is the service type for thermald.
>
> What about something like this, to give more context:
>
>   … for @uref{https://01.org/linux-thermal-daemon/, thermald}, the Linux
>   Thermal Daemon, which is responsible for controlling the thermal state
>   of Intel processors and preventing overheating.
>
> ?

Yes... except I think it isn't Intel specific, so I removed that word:
  https://askubuntu.com/questions/716189/does-thermald-for-ubuntu-work-with-amd-processors

>> +@deftp {Data Type} thermald-configuration
>> +Data type representing the configuration of THERMALD-SERVICE.
>
> s/THERMALD-SERVICE/@code{thermald-service-type}/

Ah!  Still getting a handle on texinfo :)

>> +(define-record-type* <thermald-configuration>
>> +  thermald-configuration make-thermald-configuration
>> +  thermald-configuration?
>> +  (ignore-cpuid-check? thermald-ignore-cpuid-check?
>> +                       (default #f)))
>
> Could you add a ‘thermald’ field, defaulting to ‘thermald’ (the package)…

Oh, sure... so this allows users to select a custom thermald?  Yes,
sounds good.

>> +(define (thermald-shepherd-service config)
>> +  (list
>> +   (shepherd-service
>> +    (provision '(thermald))
>> +    (documentation "Run thermald cpu frequency scaling.")
>> +    (start #~(make-forkexec-constructor
>> +              '(#$(file-append thermald "/sbin/thermald")
>
> … and honor it here, and add it to guix.texi?
>
> OK with these changes, thank you!

Ok!  Still looking for your feedback on (gnu services pm), which I
assume is probably yes.

> Do you think it’s something we should add to ‘%base-services’, or is it
> too hardware-dependent?
>
> Ludo’.

I think we should provide something.  However, I'm not sure the service
in its current state would be ideal; one problem with it is that I had
to manually turn on the `ignore-cpuid-check?' option.  If thermald can't
tell what your cpu type is, it won't start.  On this libreboot'ed X200
at least, that was the case.  However this probably shouldn't be off by
default, because it seems that thermald uses some better settings if it
*can* find an appropriate CPU.

One option could be to provide a 'maybe option to ignore-cpuid-check?
which we make the default, and wait to see if the service immediately
exits (How would we do this?  Watch for a string from stdout/stderr
along with an error code?)

It's also possible that the tlp package would be better, but it looks
like that conflicts with upower-service, so maybe not.

(If a solution is not obvious, maybe we should open a bug on guix-bugs
with "add a thermal management service to %base-services" and track this
there?)

WDYT?

Anyway, new patches attached.

 - Chris

[0001-gnu-Add-thermald.patch (text/x-patch, inline)]
From 56c7019d58d4a064fe44e626a1396b62cbf808b0 Mon Sep 17 00:00:00 2001
From: Christopher Allan Webber <cwebber <at> dustycloud.org>
Date: Sat, 13 May 2017 19:36:01 -0500
Subject: [PATCH 1/2] gnu: Add thermald.

* gnu/packages/admin.scm (thermald): New variable.
---
 gnu/packages/admin.scm | 54 +++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 53 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index ff0431999..20cb8f180 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -17,6 +17,7 @@
 ;;; Copyright © 2016 John Darrington <jmd <at> gnu.org>
 ;;; Copyright © 2017 Ben Sturmfels <ben <at> sturm.com.au>
 ;;; Copyright © 2017 Ethan R. Jones <doubleplusgood23 <at> gmail.com>
+;;; Copyright © 2017 Christopher Allan Webber <cwebber <at> dustycloud.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -80,7 +81,8 @@
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages kerberos)
-  #:use-module (gnu packages gtk))
+  #:use-module (gnu packages gtk)
+  #:use-module (gnu packages xml))
 
 (define-public aide
   (package
@@ -2130,3 +2132,53 @@ logo, or any ASCII file of your choice.  The main purpose of Neofetch is to be
 used in screenshots to show other users what operating system or distribution
 you are running, what theme or icon set you are using, etc.")
     (license license:expat)))
+
+(define-public thermald
+  (package
+    (name "thermald")
+    (version "1.6")
+    (source
+     (origin
+      (method url-fetch)
+      (uri (string-append "https://github.com/01org/thermal_daemon/archive/v"
+                          version ".tar.gz"))
+      (sha256 (base32
+               "14klz9fnvi9jdlaqwrp61xa5nh051n8ykrs1fh1wxd7j66qf2fn6"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases (modify-phases %standard-phases
+                  (add-after
+                   'unpack 'autogen.sh-and-fix-paths
+                   (lambda* (#:key outputs #:allow-other-keys)
+                     (let ((out (assoc-ref outputs "out")))
+                       ;; upstartconfir is hardcoded to /etc/init and the build
+                       ;; system tries to mkdir that.  We don't even need upstart
+                       ;; files at all; this is a fast and kludgy workaround
+                       (substitute* "data/Makefile.am"
+                         (("upstartconfdir = /etc/init")
+                          (string-append "upstartconfdir = "
+                                         out "/etc/init")))
+                       ;; Now run autogen
+                       (zero? (system* "sh" "autogen.sh"))))))
+       #:configure-flags
+       (let ((out      (assoc-ref %outputs "out")))
+         (list (string-append "--sysconfdir="
+                              out "/etc")
+               (string-append "--with-udev-dir="
+                              out "/lib/udev")
+               (string-append "--with-dbus-sys-dir="
+                              out "/etc/dbus-1/system.d")
+               "--localstatedir=/var"))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("glib" ,glib "bin")             ; for glib-genmarshal, etc.
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("dbus-glib" ,dbus-glib)
+       ("libxml2" ,libxml2)))
+    (home-page "https://01.org/linux-thermal-daemon/")
+    (synopsis "CPU scaling for thermal management")
+    (description "The Linux Thermal Daemon helps monitor and control temperature
+on systems running the Linux kernel.")
+    (license license:gpl2+)))
-- 
2.12.2

[0002-services-Add-thermald-service-type.patch (text/x-patch, inline)]
From 96d1f717fb0f7592e698727cea9822b9f6817848 Mon Sep 17 00:00:00 2001
From: Christopher Allan Webber <cwebber <at> dustycloud.org>
Date: Sat, 13 May 2017 19:37:02 -0500
Subject: [PATCH 2/2] services: Add 'thermald-service-type'.

* gnu/services/admin.scm (<thermald-configuration>): New record type.
(thermald-shepherd-service, thermald-service-type): New variables.
* doc/guix.texi (Thermal Management): New section documenting thermald.
---
 doc/guix.texi          | 28 +++++++++++++++++++++++++-
 gnu/services/admin.scm | 53 ++++++++++++++++++++++++++++++++++++++++++++++----
 2 files changed, 76 insertions(+), 5 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 22dc8b3f9..4736f727e 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -35,7 +35,8 @@ Copyright @copyright{} 2017 Mathieu Othacehe@*
 Copyright @copyright{} 2017 Federico Beffa@*
 Copyright @copyright{} 2017 Carlo Zancanaro@*
 Copyright @copyright{} 2017 Thomas Danckaert@*
-Copyright @copyright{} 2017 humanitiesNerd
+Copyright @copyright{} 2017 humanitiesNerd@*
+Copyright @copyright{} 2017 Christopher Allan Webber
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -14614,6 +14615,31 @@ Defaults to @samp{#f}.
 
 @end deftypevr
 
+
+The @code{(gnu services admin)} module provides an interface to
+thermald, a CPU frequency scaling service which helps prevent overheating.
+
+@defvr {Scheme Variable} thermald-service-type
+This is the service type for
+@uref{https://01.org/linux-thermal-daemon/, thermald}, the Linux
+Thermal Daemon, which is responsible for controlling the thermal state
+of processors and preventing overheating.
+@end defvr
+
+@deftp {Data Type} thermald-configuration
+Data type representing the configuration of @code{thermald-service-type}.
+
+@table @asis
+@item @code{ignore-cpuid-check?} (default: @code{#f})
+Ignore cpuid check for supported CPU models.
+
+@item @code{thermald} (default: @var{thermald})
+Package object of thermald.
+
+@end table
+@end deftp
+
+
 @node Miscellaneous Services
 @subsubsection Miscellaneous Services
 
diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm
index 6ac24e32b..8b398cec0 100644
--- a/gnu/services/admin.scm
+++ b/gnu/services/admin.scm
@@ -32,17 +32,27 @@
             rottlog-configuration
             rottlog-configuration?
             rottlog-service
-            rottlog-service-type))
+            rottlog-service-type
+
+            thermald-configuration
+            thermald-service-type))
 
 ;;; Commentary:
 ;;;
-;;; This module implements configuration of rottlog by writing
+;;; Various administration services.
+;;;
+;;; Code:
+
+
+
+;;;
+;;; Rotlog
+;;;
+;;; This service implements configuration of rottlog by writing
 ;;; /etc/rottlog/{rc,hourly|daily|weekly}.  Example usage
 ;;;
 ;;;     (mcron-service)
 ;;;     (service rottlog-service-type (rottlog-configuration))
-;;;
-;;; Code:
 
 (define %rotated-files
   ;; Syslog files subject to rotation.
@@ -118,4 +128,39 @@
                                         (compose list rottlog-rottlog))))
    (default-value (rottlog-configuration))))
 
+
+
+;;;
+;;; thermald
+;;;
+;;; This service implements cpu scaling.  Helps prevent overheating!
+
+(define-record-type* <thermald-configuration>
+  thermald-configuration make-thermald-configuration
+  thermald-configuration?
+  (ignore-cpuid-check? thermald-ignore-cpuid-check?    ;boolean
+                       (default #f))
+  (thermald            thermald-thermald               ;package
+                       (default thermald)))
+
+(define (thermald-shepherd-service config)
+  (list
+   (shepherd-service
+    (provision '(thermald))
+    (documentation "Run thermald cpu frequency scaling.")
+    (start #~(make-forkexec-constructor
+              '(#$(file-append (thermald-thermald config) "/sbin/thermald")
+                "--no-daemon"
+                #$@(if (thermald-ignore-cpuid-check? config)
+                       '("--ignore-cpuid-check")
+                       '()))))
+    (stop #~(make-kill-destructor)))))
+
+(define thermald-service-type
+  (service-type
+   (name 'thermald)
+   (extensions (list (service-extension shepherd-root-service-type
+                                        thermald-shepherd-service)))
+   (default-value (thermald-configuration))))
+
 ;;; admin.scm ends here
-- 
2.12.2

[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#26919; Package guix-patches. (Sun, 14 May 2017 17:01:01 GMT) Full text and rfc822 format available.

Message #14 received at 26919 <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: Christopher Allan Webber <cwebber <at> dustycloud.org>
Cc: 26919 <at> debbugs.gnu.org, Ludovic Courtès <ludo <at> gnu.org>
Subject: Re: bug#26919: [PATCH] Add thermald and thermald-service-type (for
 cpu frequency scaling)
Date: Sun, 14 May 2017 13:00:34 -0400
[Message part 1 (text/plain, inline)]
Ludovic Courtès writes:
> Do you think it’s something we should add to ‘%base-services’, or is it
> too hardware-dependent?

It does seem like an unusual requirement to me, since most systems
should do thermal management automatically in the CPU and BIOS.

I can run my physical machines (GuixSD or Debian) at full CPU
utilization for extended periods of time without overheating.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#26919; Package guix-patches. (Sun, 14 May 2017 19:57:01 GMT) Full text and rfc822 format available.

Message #17 received at 26919 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Leo Famulari <leo <at> famulari.name>
Cc: Christopher Allan Webber <cwebber <at> dustycloud.org>, 26919 <at> debbugs.gnu.org
Subject: Re: bug#26919: [PATCH] Add thermald and thermald-service-type (for
 cpu frequency scaling)
Date: Sun, 14 May 2017 21:55:51 +0200
Leo Famulari <leo <at> famulari.name> skribis:

> Ludovic Courtès writes:
>> Do you think it’s something we should add to ‘%base-services’, or is it
>> too hardware-dependent?
>
> It does seem like an unusual requirement to me, since most systems
> should do thermal management automatically in the CPU and BIOS.
>
> I can run my physical machines (GuixSD or Debian) at full CPU
> utilization for extended periods of time without overheating.

Yes, same here actually.  Could it be due to this particular Libreboot +
X200 combination?  Or are we just lucky that other systems don’t
overheat as well?

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#26919; Package guix-patches. (Sun, 14 May 2017 23:57:01 GMT) Full text and rfc822 format available.

Message #20 received at 26919 <at> debbugs.gnu.org (full text, mbox):

From: Christopher Allan Webber <cwebber <at> dustycloud.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 26919 <at> debbugs.gnu.org, Leo Famulari <leo <at> famulari.name>
Subject: Re: bug#26919: [PATCH] Add thermald and thermald-service-type (for
 cpu frequency scaling)
Date: Sun, 14 May 2017 18:56:05 -0500
Ludovic Courtès writes:

> Leo Famulari <leo <at> famulari.name> skribis:
>
>> Ludovic Courtès writes:
>>> Do you think it’s something we should add to ‘%base-services’, or is it
>>> too hardware-dependent?
>>
>> It does seem like an unusual requirement to me, since most systems
>> should do thermal management automatically in the CPU and BIOS.
>>
>> I can run my physical machines (GuixSD or Debian) at full CPU
>> utilization for extended periods of time without overheating.
>
> Yes, same here actually.  Could it be due to this particular Libreboot +
> X200 combination?  Or are we just lucky that other systems don’t
> overheat as well?
>
> Ludo’.

I'm on a libreboot + x200 machine.  Notably it never overheats... unless
it's docked.  Then it's liable to overheat, because the circulation
while being docked is, I guess, pretty bad?  Unfortunately, I am docked
pretty much all the time!

Do you use a dock regularly, out of curiosity?  It could be that it's
time to open up and de-dustrabbit :)

 - Chris




Information forwarded to guix-patches <at> gnu.org:
bug#26919; Package guix-patches. (Mon, 15 May 2017 07:48:02 GMT) Full text and rfc822 format available.

Message #23 received at 26919 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Christopher Allan Webber <cwebber <at> dustycloud.org>
Cc: 26919 <at> debbugs.gnu.org, Leo Famulari <leo <at> famulari.name>
Subject: Re: bug#26919: [PATCH] Add thermald and thermald-service-type (for
 cpu frequency scaling)
Date: Mon, 15 May 2017 09:46:48 +0200
Heya,

Christopher Allan Webber <cwebber <at> dustycloud.org> skribis:

> I'm on a libreboot + x200 machine.  Notably it never overheats... unless
> it's docked.  Then it's liable to overheat, because the circulation
> while being docked is, I guess, pretty bad?  Unfortunately, I am docked
> pretty much all the time!

Oh, I see.

> Do you use a dock regularly, out of curiosity?  It could be that it's
> time to open up and de-dustrabbit :)

I do use a dock with my HP laptop (and a Dell one before that), but
never had that problem.

Ludo’.




Reply sent to ludo <at> gnu.org (Ludovic Courtès):
You have taken responsibility. (Tue, 30 May 2017 16:01:03 GMT) Full text and rfc822 format available.

Notification sent to Christopher Allan Webber <cwebber <at> dustycloud.org>:
bug acknowledged by developer. (Tue, 30 May 2017 16:01:03 GMT) Full text and rfc822 format available.

Message #28 received at 26919-done <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Christopher Allan Webber <cwebber <at> dustycloud.org>
Cc: 26919-done <at> debbugs.gnu.org
Subject: Re: bug#26919: [PATCH] Add thermald and thermald-service-type (for
 cpu frequency scaling)
Date: Tue, 30 May 2017 18:00:26 +0200
Howdy!

Forgot to mention it but these two patches were pushed a while back:
589896843854cbdb24f627a53e5a9af628c6e7fb and
d7fa39ccec34bc223d52a04dfc3e1f756e2dfa24.

Thanks!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 28 Jun 2017 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 303 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.