From patchwork Sun Jan 14 00:40:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ian Eure X-Patchwork-Id: 58856 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1A2D927BBE9; Sun, 14 Jan 2024 00:41:36 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 598EA27BBE2 for ; Sun, 14 Jan 2024 00:41:34 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rOoYj-0007fK-Ok; Sat, 13 Jan 2024 19:41:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOoYh-0007er-P1 for guix-patches@gnu.org; Sat, 13 Jan 2024 19:41:03 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rOoYh-0004Mu-HD for guix-patches@gnu.org; Sat, 13 Jan 2024 19:41:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rOoYg-0000sm-6P for guix-patches@gnu.org; Sat, 13 Jan 2024 19:41:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68309] [PATCH 1/2] gnu: Add powertop-service-type. References: <20240107212122.21810-1-ian@retrospec.tv> In-Reply-To: <20240107212122.21810-1-ian@retrospec.tv> Resent-From: Ian Eure Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 14 Jan 2024 00:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68309 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68309@debbugs.gnu.org Cc: Ian Eure Received: via spool by 68309-submit@debbugs.gnu.org id=B68309.17051928373339 (code B ref 68309); Sun, 14 Jan 2024 00:41:02 +0000 Received: (at 68309) by debbugs.gnu.org; 14 Jan 2024 00:40:37 +0000 Received: from localhost ([127.0.0.1]:41359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOoYH-0000rm-90 for submit@debbugs.gnu.org; Sat, 13 Jan 2024 19:40:37 -0500 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:40803) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOoYF-0000rV-Ek for 68309@debbugs.gnu.org; Sat, 13 Jan 2024 19:40:36 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 6F4CD5C007C; Sat, 13 Jan 2024 19:40:30 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sat, 13 Jan 2024 19:40:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=retrospec.tv; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:message-id:mime-version:reply-to :subject:subject:to:to; s=fm1; t=1705192830; x=1705279230; bh=xr wr6lWSvmvdPfw1YGL0Z4/QEXJtHhFuf8u5XXoyxKc=; b=mJZVI9Z7I/I4khrAwr YkmV1w5Q0BQz9nJAD6V/XEa8UlLtdq2yHiWQisft5SubnwFUcOs/O3xD+4/5syTH mgBd0ljkBDfAwYhEpNLfOKPlzbF5dFIVR32qiZG5rX6ASFu9PhJ9Vd4BgZPPyqOV ytGVP4hE37AeEyMoGloOopMaTKqK+0Qa83Th8enj0kMNx7XSL8Ie27zdMZpt8SIi Gl8cT8aDtOi7YE9DuIX3KvpXUxNS0XFbGtQYaMNfzlG5y3WvB5IT5l/UiPIQw3Qy +yddpCEPOCAR3c/58PaMyDdLihZeft9cJugbYbmxq9du+4OEu6lBxaWdbKZWhEer C0cA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1705192830; x=1705279230; bh=xrwr6lWSvmvdP fw1YGL0Z4/QEXJtHhFuf8u5XXoyxKc=; b=9CXKGnRzRKkP13NFcVkfDWGB55bjo Talw9YPDK+xxRBB29O+EblkvHiv4ktL8BxqLaXZAZTIB3VKfADAIOhMUIuXQSr3+ rMl3ummFw2zmqkv3dWdsH4p64fPMIiPwUVRg1fAeL9TcEqOJ6c6g3p7Aroy30xtn hxWxmmJa2sOHk3QPrjCvy+4gwpZd8c1z8jRN1BvkcyEMCL+9UtmosTfMkIjZzpL7 sHagyK+9c/NlqVO8G6+44QuRbsQ9W+VQ/yt4o0hEv1gfnSVO68Xfy7Vakbb8aW7X Aict5DDX1wgIR7jE6cS1hHnhAHOhYNzflFMDvlgYzzuTD2C7DpBY+gB/Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeikedgvdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffogggtgfesthekre dtredtjeenucfhrhhomhepkfgrnhcugfhurhgvuceoihgrnhesrhgvthhrohhsphgvtgdr thhvqeenucggtffrrghtthgvrhhnpeejuefghefgffefteehvddtuddutefhvddtfeduhf dugfdvvdeulefgfefhhefhheenucffohhmrghinhepghhnuhdrohhrghenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehirghnsehrvghtrhhosh hpvggtrdhtvh X-ME-Proxy: Feedback-ID: id9014242:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 13 Jan 2024 19:40:29 -0500 (EST) From: Ian Eure Date: Sat, 13 Jan 2024 16:40:17 -0800 Message-ID: <20240114004019.5019-1-ian@retrospec.tv> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/services/pm.scm (powertop-shepherd-service): New variable. * gnu/services/pm.scm (powertop-service-type): New variable. * gnu/services/pm.scm (powertop-configuration): New variable. * doc/guix.texi (Power Management Services): Document powertop-service-type. Change-Id: I1c5ef855526458ad54f62ca6e755da82acce1c4a --- doc/guix.texi | 24 ++++++++++++++++++++++++ gnu/services/pm.scm | 43 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 66 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 811edd0bf7..a48aa655ae 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -34798,6 +34798,30 @@ Ignore cpuid check for supported CPU models. @item @code{thermald} (default: @var{thermald}) Package object of thermald. +@cindex powertop +@cindex Power tuning with PowerTOP +@subsubheading PowerTOP + +The @code{(gnu services pm)} module provides a Guix service definition +for PowerTOP. When started, it tunes kernel settings to reduce power +consumption. + +@defvar powertop-service-type +The service type for PowerTOP. No configuration is necessary. When the +service starts, it executes @code{powertop --auto-tune}. + +@lisp +(service powertop-service-type) + +@end defvar + +Available @code{powertop-configuration} fields are: + +@deftypevr {@code{powertop-configuration} parameter} package powertop +The PowerTOP package. Defaults to @code{powertop}. + +@end deftypevr + @end table @end deftp diff --git a/gnu/services/pm.scm b/gnu/services/pm.scm index 3daf484cc1..13a153ab1d 100644 --- a/gnu/services/pm.scm +++ b/gnu/services/pm.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Mathieu Othacehe +;;; Copyright © 2024 Ian Eure ;;; ;;; This file is part of GNU Guix. ;;; @@ -17,6 +18,8 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu services pm) + #:use-module (srfi srfi-1) + #:use-module (ice-9 match) #:use-module (guix gexp) #:use-module (guix packages) #:use-module (guix records) @@ -31,7 +34,10 @@ (define-module (gnu services pm) tlp-configuration thermald-configuration - thermald-service-type)) + thermald-service-type + + powertop-configuration + powertop-service-type)) (define (uglify-field-name field-name) (let ((str (symbol->string field-name))) @@ -466,3 +472,38 @@ (define thermald-service-type (default-value (thermald-configuration)) (description "Run thermald, a CPU frequency scaling service that helps prevent overheating."))) + + + +;;; +;;; powertop +;;; +;;; Calls `powertop --auto-tune' to reduce energy consumption. + + + +(define-configuration powertop-configuration + (powertop (package powertop) "PowerTOP package to use.")) + +(define powertop-shepherd-service + (match-lambda + (($ powertop) + (shepherd-service + (documentation "Tune kernel power settings at boot.") + (provision '(powertop powertop-auto-tune)) + (requirement '(user-processes)) + (one-shot? #t) + (start #~(lambda _ + (zero? (system* #$(file-append powertop "/sbin/powertop") + "--auto-tune")))))))) + +(define powertop-service-type + (service-type + (name 'powertop) + (extensions + (list + (service-extension shepherd-root-service-type + (compose list powertop-shepherd-service)))) + (compose concatenate) + (default-value (powertop-configuration)) + (description "Tune power-related kernel parameters to reduce energy consumption."))) From patchwork Sun Jan 14 00:40:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Eure X-Patchwork-Id: 58855 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 330AA27BBE9; Sun, 14 Jan 2024 00:41:30 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id DEF0C27BBE2 for ; Sun, 14 Jan 2024 00:41:26 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rOoYl-0007fP-0O; Sat, 13 Jan 2024 19:41:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOoYi-0007ey-2B for guix-patches@gnu.org; Sat, 13 Jan 2024 19:41:05 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rOoYh-0004N8-QP for guix-patches@gnu.org; Sat, 13 Jan 2024 19:41:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rOoYg-0000su-Km for guix-patches@gnu.org; Sat, 13 Jan 2024 19:41:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68309] [PATCH 2/2] gnu: Correct package description. Resent-From: Ian Eure Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 14 Jan 2024 00:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68309 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68309@debbugs.gnu.org Cc: Ian Eure Received: via spool by 68309-submit@debbugs.gnu.org id=B68309.17051928423354 (code B ref 68309); Sun, 14 Jan 2024 00:41:02 +0000 Received: (at 68309) by debbugs.gnu.org; 14 Jan 2024 00:40:42 +0000 Received: from localhost ([127.0.0.1]:41364 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOoYL-0000s2-RT for submit@debbugs.gnu.org; Sat, 13 Jan 2024 19:40:42 -0500 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:34387) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOoYH-0000rZ-GU for 68309@debbugs.gnu.org; Sat, 13 Jan 2024 19:40:38 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 7B4D85C0113; Sat, 13 Jan 2024 19:40:33 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Sat, 13 Jan 2024 19:40:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=retrospec.tv; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1705192833; x= 1705279233; bh=ljUlfQP5YLSmrmtRdK6YmkiHaibElqJTI0Kp879Hm8E=; b=S 5aVXihtSMk3i1fgDy5EdcacX7eHnvoJ63emzJjw+4BVb66MLgIftqzxMa9DGQWHb 1l7LayhRXTqgUg5wnBmWzGYqJgaHWJsT6Mc1u2YgFS/P6VTxVGxDFHTi+A8Pec05 SsqvsKdjnc1efxKWTwOTklVlIzGDzFqYvvfkAqoumJG/k4vGtQeNRnMtLMLhCtEO 5S2mcPRidVQxy6/DWevyinN1WpOn1v709kwOk7mPNXfbPUAl6iIoV1q5aj/lqZwj sVMMbD6TTJ/lrBDnUvCJzIZ+A8JOe3UebJabVb4fCh72gQJAlb7T6e67zj8+EWHn wpybhDQbogWMJ8k1XIKUw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1705192833; x= 1705279233; bh=ljUlfQP5YLSmrmtRdK6YmkiHaibElqJTI0Kp879Hm8E=; b=6 mzobsQJBQYyvQ0oaW4D7S2bLwKlObN1QLr5QZH5JZWeAHxrH8H2phgqgoCBMV977 wB9fqsdLq9Uz189lBABkHWYRJvl+8eKHXEtNveYK58poFcrBAZ/SX0bPN8NZvTC/ re9kXY/Txz64NrOaBL7XL0wlaJygdBPl12PsA9F5E10NK+jlI1/vuYs+JHjzsFq5 G5UX0Nw3yEHK7E/vedNud+X78pjNPf8IKXbY70AP0NXOn2xMFLI0/1b009tkqI0E V3YQJtwRGGuc0knkrcS93T3CutqYs5a1ilLfMP482zUmCA3H4DorJ1t09buWMAhR zkhNxRshj6uq987LkaZ+A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeikedgvdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefkrghnucfguhhrvgcuoehirghnsehrvghtrhhoshhpvggt rdhtvheqnecuggftrfgrthhtvghrnhepgfeiveehgeeijeeifeekfedthfejudduhfduhe ehjeeuhfettdehkedthfegudeinecuffhomhgrihhnpedtuddrohhrghenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehirghnsehrvghtrhhosh hpvggtrdhtvh X-ME-Proxy: Feedback-ID: id9014242:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 13 Jan 2024 19:40:32 -0500 (EST) From: Ian Eure Date: Sat, 13 Jan 2024 16:40:18 -0800 Message-ID: <20240114004019.5019-2-ian@retrospec.tv> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240114004019.5019-1-ian@retrospec.tv> References: <20240114004019.5019-1-ian@retrospec.tv> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/linux.scm (powertop): Correct package description. Change-Id: Ifc81ed62158df8b3c235d335731590e977dcc725 --- gnu/packages/linux.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 716f5907f0..3cd63df6ee 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -3634,7 +3634,7 @@ (define-public powertop (inputs (list kmod libnl ncurses pciutils zlib)) (home-page "https://01.org/powertop/") - (synopsis "Analyze power consumption on Intel-based laptops") + (synopsis "Analyze power consumption on x86-based laptops") (description "PowerTOP is a Linux tool to diagnose issues with power consumption and power management. In addition to being a diagnostic tool, PowerTOP also has