From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id qEbhOZMDjWJ5CgEAbAwnHQ (envelope-from ) for ; Tue, 24 May 2022 18:11:00 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id GDa+OZMDjWL9JgAAauVa8A (envelope-from ) for ; Tue, 24 May 2022 18:10:59 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 6CBDE3FF58 for ; Tue, 24 May 2022 18:10:59 +0200 (CEST) Received: from localhost ([::1]:35524 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntX7Z-00076C-Nb for larch@yhetil.org; Tue, 24 May 2022 12:10:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43406) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntWgY-00070V-DH for bug-guix@gnu.org; Tue, 24 May 2022 11:43:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59248) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ntWgY-0005bN-42 for bug-guix@gnu.org; Tue, 24 May 2022 11:43:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ntWgX-0003hN-WD for bug-guix@gnu.org; Tue, 24 May 2022 11:43:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#54783: ZRAM default priority wrong Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 24 May 2022 15:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54783 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Josselin Poiret Cc: 54783@debbugs.gnu.org, Stefan Baums Received: via spool by 54783-submit@debbugs.gnu.org id=B54783.165340694414171 (code B ref 54783); Tue, 24 May 2022 15:43:01 +0000 Received: (at 54783) by debbugs.gnu.org; 24 May 2022 15:42:24 +0000 Received: from localhost ([127.0.0.1]:53145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntWfs-0003gQ-54 for submit@debbugs.gnu.org; Tue, 24 May 2022 11:42:24 -0400 Received: from mail-qt1-f182.google.com ([209.85.160.182]:37771) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntWfn-0003gB-W3 for 54783@debbugs.gnu.org; Tue, 24 May 2022 11:42:19 -0400 Received: by mail-qt1-f182.google.com with SMTP id y15so10707315qtx.4 for <54783@debbugs.gnu.org>; Tue, 24 May 2022 08:42:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=Kncdkz13YYGR+WVG5WVZBa6x3Mbn5QoDQTL55Sr1SAA=; b=iquANuv2RCHnuMZZ90hpOpMlemuxbMdJuCQ+bfuiLjvJ2bL3PH3D+CdEPMpT71u/Wk VqqtMGIXfoxuZiPOAPu27Ewv5DGrpZ9QTfL3R6sIc06QG2uD8ncZDmqCGZGfM/JfP+dP 0XeDxeM7LEe8zeXVPNisYHTIDPwxroUNL6OOtyjUod1gJL3wvfLYBOxdmmkcxzI/KcBn F2IKO2H3urUXEupEalurlhSddtS23PYj7P+IBPrjs/jcNcp2W8Bnuc4X4Wk3xJ9+FD71 ku6+5UZfxChYYT3MhaOVsS7h+28pHH3ulrShAmx4xKfp/B2+p8BBdFDC7IGy1fIOBRyi 833w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=Kncdkz13YYGR+WVG5WVZBa6x3Mbn5QoDQTL55Sr1SAA=; b=4B4N7MlBPdj+tIjmnN/haP/eq9wOsIViV+cxdTGGD1x9hcrOvpsbzsBJeQgVRx90A+ k3T3tAtL1/KluabkgiMXIcoB5CBUqYDUAWN5nrbbeiQdMeKI2pc+t6bQ53fxmEiLp0nb ZYP1P0rcBuLBfZZwLMG75fmAjt92orucmQltuIL5yS0YUpLnbOlDW/uvyk7uGqSRaB4f NKPuVW75dNwMnagOGexlDfTiAZMVTVp9LWCs0tdXyTso7ON2DkNTnWG8A2+kH/MjeSNQ COkp2J1DtcfOU28ZUD2jP+U8OD4IeXGvz9aOb9/QUJNCI9KRzz4SERa+tvFHLJuN5mkF dwpQ== X-Gm-Message-State: AOAM53072cO4PByF1GPvJlj5yCIXEJu28lF6FeRTXXIlIva4Qh+DclRb sRfCOgkE0ofA/1JiyUeVFlfLhzHBWCtt9A== X-Google-Smtp-Source: ABdhPJwU8Q0Z1Rxxkqkq53zpLnK+Z/6WjSMKmlOMmSFgZzc8ioXfy1UHDtf8JqmzdettYmA4imZPWQ== X-Received: by 2002:ac8:5b87:0:b0:2f8:ab4:a050 with SMTP id a7-20020ac85b87000000b002f80ab4a050mr20718420qta.183.1653406930097; Tue, 24 May 2022 08:42:10 -0700 (PDT) Received: from hurd (dsl-157-33.b2b2c.ca. [66.158.157.33]) by smtp.gmail.com with ESMTPSA id d19-20020ac85353000000b002f3ad89629dsm6251091qto.2.2022.05.24.08.42.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 May 2022 08:42:09 -0700 (PDT) From: Maxim Cournoyer References: <87sfq6g96j.fsf@jpoiret.xyz> <20220421134921.1505-1-dev@jpoiret.xyz> Date: Tue, 24 May 2022 11:42:08 -0400 In-Reply-To: <20220421134921.1505-1-dev@jpoiret.xyz> (Josselin Poiret's message of "Thu, 21 Apr 2022 15:49:20 +0200") Message-ID: <87o7zn3pkf.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653408659; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Kncdkz13YYGR+WVG5WVZBa6x3Mbn5QoDQTL55Sr1SAA=; b=ftTOBnzRzJJg1TRDB6V3uVN4qJEkgT30MX6d05JwU7AKiJ+QiQZdUfoRbqBD6XpotUkyBg 6UR0T1Zun9rqVGBoP7Mqk2eDVPI+Np+EekGE77Fr1+iv5t+0+3rEcQeNnQ3KfvOzxLUAI2 3jebq7x44ZAYVP92xbToDTAiC4P403CaKNapWb5csaHIeNWPWzddOWECDHCZGMx99VjZsg Fbp9qUp5k9XAnPcl0LNOEGr7XrOHH/ewUI4LCbwWtzfagMum+qgNwUa1tEp+xlMw+712Rr EyFGLX0VKZraHx1QGSxL+b42Xb641yKSg6Tbi97sAWGqOhE2b/DxGsAvgRy45w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653408659; a=rsa-sha256; cv=none; b=oQpeYGuBiEZwpD6QfXJbNAgv85apE7PNHOtXtxMJ+zkwmtKTuD/zNnW9FDTeA1Nv4Wj2RN NWfdVlExyPqh4TorxQ+HTG4g4uYLqL2b0utPBF+chXka3Z/oRYstmiyvrQkUDQapIPZf1q QXtHZmlmoDax6EwL/jZdN2NQ262mZPjiM48xuL8+0Hi78Oon1W/0KgnZ5ElJVy3diQRzb8 W11ealcBorbax6ETpRoHilkEVCBu2yViy/bdh2v9vpF2lI+UY0+kFkk04vq6mENs0V1DBN NZPgKsMPhLbKs1dHLOFIi5i5Vj2Wl+m3DHslafjc1WTasax73WvijIe0VgHKOg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=iquANuv2; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 4.95 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=iquANuv2; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 6CBDE3FF58 X-Spam-Score: 4.95 X-Migadu-Scanner: scn0.migadu.com X-TUID: acJ7P41HQELv Hi, Josselin Poiret writes: > * gnu/services/linux.scm > (zram-device-configuration) [priority]: Adapt to use #f or an integer > from 0 to 32767. Add sanitizer to warn for the change and delay the > field. > (zram-device-configuration->udev-string): Adapt as above. > * doc/guix.texi (Zram Device Service): Change priority description to > refer to the Swap Space one, and suggest not leaving the default #f on > to properly use zram. > --- > doc/guix.texi | 10 +++++----- > gnu/services/linux.scm | 26 +++++++++++++++++++++++--- > 2 files changed, 28 insertions(+), 8 deletions(-) > > diff --git a/doc/guix.texi b/doc/guix.texi > index b7005f0ef1..31f391357d 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -96,7 +96,7 @@ Copyright @copyright{} 2021 Domagoj Stolfa@* > Copyright @copyright{} 2021 Hui Lu@* > Copyright @copyright{} 2021 pukkamustard@* > Copyright @copyright{} 2021 Alice Brenon@* > -Copyright @copyright{} 2021 Josselin Poiret@* > +Copyright @copyright{} 2021, 2022 Josselin Poiret@* > Copyright @copyright{} 2021 Andrew Tropin@* > Copyright @copyright{} 2021 Sarah Morgensen@* > Copyright @copyright{} 2021 Josselin Poiret@* > @@ -34650,11 +34650,11 @@ that compression will be 2:1, it is possible th= at uncompressable data > can be written to swap and this is a method to limit how much memory can > be used. It accepts a string and can be a number of bytes or use a > suffix, eg.: @code{"2G"}. > -@item @code{priority} (default @code{-1}) > +@item @code{priority} (default @code{#f}) > This is the priority of the swap device created from the zram device. > -@code{swapon} accepts values between -1 and 32767, with higher values > -indicating higher priority. Higher priority swap will generally be used > -first. > +@xref{Swap Space} for a description of swap priorities. You might want > +to set a specific priority for the zram device, otherwise it could end > +up not being used much for the reasons described there. > @end table >=20=20 > @end deftp > diff --git a/gnu/services/linux.scm b/gnu/services/linux.scm > index 2eb02ac5a3..9f598b2826 100644 > --- a/gnu/services/linux.scm > +++ b/gnu/services/linux.scm > @@ -4,6 +4,7 @@ > ;;; Copyright =C2=A9 2020 Efraim Flashner > ;;; Copyright =C2=A9 2021 raid5atemyhomework > ;;; Copyright =C2=A9 2021 B. Wilson > +;;; Copyright =C2=A9 2022 Josselin Poiret > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -21,9 +22,11 @@ > ;;; along with GNU Guix. If not, see . >=20=20 > (define-module (gnu services linux) > + #:use-module (guix diagnostics) > #:use-module (guix gexp) > #:use-module (guix records) > #:use-module (guix modules) > + #:use-module (guix i18n) > #:use-module (gnu services) > #:use-module (gnu services base) > #:use-module (gnu services shepherd) > @@ -252,7 +255,19 @@ (define-record-type* > (memory-limit zram-device-configuration-memory-limit > (default 0)) ; string or integer > (priority zram-device-configuration-priority > - (default -1))) ; integer > + (default #f) ; integer | #f > + (delayed) I'm curious, what does delaying the field buys us here? Is it to avoid printing the warning multiple times when the record is evaluated? > + (sanitize warn-zram-priority-change))) > + > +(define-with-syntax-properties > + (warn-zram-priority-change (priority properties)) > + (if (eqv? priority -1) > + (begin > + (warning (source-properties->location properties) > + (G_ "Using -1 for zram priority is deprecated to align = with \ > +the corresponding swap-space field, please use #f from now on.~%")) > + #f) > + priority)) By convention, a warning message should not be a complete sentence (no capitalized first letter nor last period) and be short. To provide a human friendly hint/message, you could use 'display-hint' (combined with a more succinct warning). The rest LGTM. Maxim