From unknown Fri Aug 15 14:47:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54783: ZRAM default priority wrong Resent-From: Stefan Baums Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 08 Apr 2022 04:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 54783 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 54783@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.164939163216464 (code B ref -1); Fri, 08 Apr 2022 04:21:02 +0000 Received: (at submit) by debbugs.gnu.org; 8 Apr 2022 04:20:32 +0000 Received: from localhost ([127.0.0.1]:33753 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ncg6q-0004HU-GK for submit@debbugs.gnu.org; Fri, 08 Apr 2022 00:20:32 -0400 Received: from lists.gnu.org ([209.51.188.17]:39678) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nceLa-0001ah-DA for submit@debbugs.gnu.org; Thu, 07 Apr 2022 22:27:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57930) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nceLa-0003wK-70 for bug-guix@gnu.org; Thu, 07 Apr 2022 22:27:38 -0400 Received: from stefanbaums.com ([164.138.27.169]:42806) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nceLY-0005LI-Mp for bug-guix@gnu.org; Thu, 07 Apr 2022 22:27:37 -0400 Received: from deepthought (unknown [185.213.154.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: baums) by stefanbaums.com (Postfix) with ESMTPSA id 3BC9B19E2F5 for ; Fri, 8 Apr 2022 04:27:33 +0200 (CEST) From: Stefan Baums Date: Thu, 07 Apr 2022 22:27:23 -0400 Message-ID: <878rsgfgxg.fsf@lmu.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Received-SPF: pass client-ip=164.138.27.169; envelope-from=baums@stefanbaums.com; helo=stefanbaums.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Mailman-Approved-At: Fri, 08 Apr 2022 00:20:31 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) I have a swap file and zram configured without specifying priority. The swap file was assigned -2, and zram -3, with the effect that zram was never used. I had to manually change the zram priority to something higher that that of the swap file. The manual wrongly claims that the default priority for zram is -1. The same paragraph of the manual also says: =E2=80=98swapon=E2=80=99 accepts values between -1 and 32767, with higher values indicating higher priority. which makes the -2 priority of the swap file look suspect (though it seems to work). From unknown Fri Aug 15 14:47:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54783: ZRAM default priority wrong Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 21 Apr 2022 07:58: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: Stefan Baums , 54783@debbugs.gnu.org Received: via spool by 54783-submit@debbugs.gnu.org id=B54783.165052788013289 (code B ref 54783); Thu, 21 Apr 2022 07:58:01 +0000 Received: (at 54783) by debbugs.gnu.org; 21 Apr 2022 07:58:00 +0000 Received: from localhost ([127.0.0.1]:48283 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nhRhQ-0003SG-Gu for submit@debbugs.gnu.org; Thu, 21 Apr 2022 03:58:00 -0400 Received: from jpoiret.xyz ([206.189.101.64]:47280) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nhRhO-0003S7-W1 for 54783@debbugs.gnu.org; Thu, 21 Apr 2022 03:57:59 -0400 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id 375181851E0; Thu, 21 Apr 2022 07:57:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1650527877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vAMMG81WrU7JImwWY877SIsNgFQYDcGucQHFbk9ekfA=; b=QZb695BvbF/lX4m2BepGSFynNG5O4VmIijsJTgzWK1Fbdp/e/eAZWfHlPGioYVYsSfGlAu +2LHU4swhsbyytYfJEGmIm5IVvqKHCDPNqE0rjllnS7v7db0B4TM4AKROE7QpDU6azJ567 0h2dk0L+UtW6xl6NsQ2KNAQ/yYmKKoWTFf3WL4W4mSBDiWfOfWc0HxYUHa02tCSi5Syx6d mO9Lz1QzKnxpekMJeXCb6omG4GtvpRmdXizv6is1VutTE0ZAw2n5doS3KlI3TDCKEUZQw5 o19MIapN2poxRJUhDiK6PGouHWtkiaASvp5shf5NmOQloO5rku/TsYbsJvE0UQ== From: Josselin Poiret In-Reply-To: <878rsgfgxg.fsf@lmu.de> References: <878rsgfgxg.fsf@lmu.de> Date: Thu, 21 Apr 2022 09:57:56 +0200 Message-ID: <87sfq6g96j.fsf@jpoiret.xyz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Authentication-Results: jpoiret.xyz; auth=pass smtp.auth=jpoiret@jpoiret.xyz smtp.mailfrom=dev@jpoiret.xyz X-Spamd-Bar: / X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hello Stefan and sorry for the late reply, Stefan Baums writes: > The manual wrongly claims that the default priority for zram is > -1. The same paragraph of the manual also says: > > =?UTF-8?Q?=E2=80=98swapon=E2=80=99?= accepts values between -1 and 32767, with higher > values indicatin [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: jpoiret.xyz (xyz)] 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hello Stefan and sorry for the late reply, Stefan Baums writes: > The manual wrongly claims that the default priority for zram is > -1. The same paragraph of the manual also says: > > =?UTF-8?Q?=E2=80=98swapon=E2=80=99?= accepts values between -1 and 32767, with higher > values indicatin [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: jpoiret.xyz (xyz)] 1.0 BULK_RE_SUSP_NTLD Precedence bulk and RE: from a suspicious TLD 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager Hello Stefan and sorry for the late reply, Stefan Baums writes: > The manual wrongly claims that the default priority for zram is > -1. The same paragraph of the manual also says: > > =E2=80=98swapon=E2=80=99 accepts values between -1 and 32767, with hig= her > values indicating higher priority. > > which makes the -2 priority of the swap file look suspect (though > it seems to work). This issue comes from the inconsistency with which swap priorities are specified on Linux: `swapon` the binary from util-linux (man 8 swapon) has roughly the same description as above, but internally uses the syscall wrapper `swapon` from libc (man 2 swapon), which has a better description of priorities. The official interpretation of priorities for the syscall is summarized in the "Swap space" part of the Guix manual: A swap space can have no priority, or a priority specified as an integer between 0 and 32767. The kernel will first use swap spaces of higher priority when paging, and use same priority spaces on a round-robin basis. The kernel will use swap spaces without a set priority after prioritized spaces, and in the order that they appeared in (not round-robin). Note that these are called high (for specified priority) or low (unspecified) priority in `man 2 swapon` but that's a bit of a misnomer. So, `swapon` the binary actually maps -1 to no (low) priority, and there actually is no -1 priority in the Linux kernel ABI! Since your actual swap file is swapon'd first, and also has no priority set, according to the rules above it will be used before the ZRAM which also has no priority. On the Guix side of things, we should really be using the same interface as swap-space, as I think the distinction between #f and 0 to 32767 is clearer. I'll send some patches that adress this soon, along with the zram-service-type documentation. Best, --=20 Josselin Poiret From unknown Fri Aug 15 14:47:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54783: ZRAM default priority wrong Resent-From: Stefan Baums Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 21 Apr 2022 08:07: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 Received: via spool by 54783-submit@debbugs.gnu.org id=B54783.165052841214357 (code B ref 54783); Thu, 21 Apr 2022 08:07:01 +0000 Received: (at 54783) by debbugs.gnu.org; 21 Apr 2022 08:06:52 +0000 Received: from localhost ([127.0.0.1]:48319 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nhRpz-0003jV-PH for submit@debbugs.gnu.org; Thu, 21 Apr 2022 04:06:51 -0400 Received: from stefanbaums.com ([164.138.27.169]:60192) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nhRpw-0003j8-CK for 54783@debbugs.gnu.org; Thu, 21 Apr 2022 04:06:49 -0400 Received: from deepthought (unknown [185.213.154.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: baums) by stefanbaums.com (Postfix) with ESMTPSA id 0BBA519E2F5; Thu, 21 Apr 2022 10:06:41 +0200 (CEST) From: Stefan Baums References: <878rsgfgxg.fsf@lmu.de> <87sfq6g96j.fsf@jpoiret.xyz> Date: Thu, 21 Apr 2022 10:06:40 +0200 In-Reply-To: <87sfq6g96j.fsf@jpoiret.xyz> (Josselin Poiret's message of "Thu, 21 Apr 2022 09:57:56 +0200") Message-ID: <874k2moo6n.fsf@stefanbaums.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Dear Josselin, thank you very much! That should clarify things. I have been happily using ZRAM on Guix since I figured it out. All best, Stefan From unknown Fri Aug 15 14:47:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54783: [PATCH 2/2] doc: Remove double copyright. Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 21 Apr 2022 13:50:02 +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: Stefan Baums , 54783@debbugs.gnu.org Cc: Josselin Poiret Received: via spool by 54783-submit@debbugs.gnu.org id=B54783.165054897030492 (code B ref 54783); Thu, 21 Apr 2022 13:50:02 +0000 Received: (at 54783) by debbugs.gnu.org; 21 Apr 2022 13:49:30 +0000 Received: from localhost ([127.0.0.1]:48765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nhXBa-0007vi-HO for submit@debbugs.gnu.org; Thu, 21 Apr 2022 09:49:30 -0400 Received: from jpoiret.xyz ([206.189.101.64]:35676) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nhXBY-0007vT-RS for 54783@debbugs.gnu.org; Thu, 21 Apr 2022 09:49:29 -0400 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id D35FD1851E4; Thu, 21 Apr 2022 13:49:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1650548968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pj9WD1K7Ij4NsR1dko4Omg+RPO1zQJlln0AcjWgMK8I=; b=a9HJcx0YV3DLJG7vy4VjWGgOFwLxl4WIeCS547LXXu602AeAW0eRqMV/GOHex/rZxQKTNF nhCq7EMjLVI4YNtongFh9gV+fW+4uYcbjXuTk15Xyo0OuCtVet8fZSRUtqy14J/wi+uBjB /76VGMuM1vhqA40nPc203vs1BdIpYsHno1mmW9vY0EGm8WeX01NByvTuHaSZDX4jOIoxXi HbPhfbH8buk/771XsyBXmk8qgRm/YwuI8wPbtxg4SPHxbhV/u9zVfQeRU2KZ1iusT+VEMM P7wLum9PAnkXjJhU0sw6x9JGexS4ifHUOdcPHxLwFmpl2GHJnDVRmY3uHk6Sdg== From: Josselin Poiret Date: Thu, 21 Apr 2022 15:49:21 +0200 Message-Id: <20220421134921.1505-2-dev@jpoiret.xyz> In-Reply-To: <87sfq6g96j.fsf@jpoiret.xyz> References: <87sfq6g96j.fsf@jpoiret.xyz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Authentication-Results: jpoiret.xyz; auth=pass smtp.auth=jpoiret@jpoiret.xyz smtp.mailfrom=dev@jpoiret.xyz X-Spamd-Bar: / X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * doc/guix.texi: Remove doubled Josselin Poiret copyright line. --- doc/guix.texi | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 31f391357d..d9b26e440c 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -99,7 +99,6 @@ Copyright @copyright{} 2021 Alice Brenon@* Copyright @copyright [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: jpoiret.xyz (xyz)] 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * doc/guix.texi: Remove doubled Josselin Poiret copyright line. --- doc/guix.texi | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 31f391357d..d9b26e440c 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -99,7 +99,6 @@ Copyright @copyright{} 2021 Alice Brenon@* Copyright @copyright [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: jpoiret.xyz (xyz)] 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * doc/guix.texi: Remove doubled Josselin Poiret copyright line. --- doc/guix.texi | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 31f391357d..d9b26e440c 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -99,7 +99,6 @@ Copyright @copyright{} 2021 Alice Brenon@* Copyright @copyright{} 2021, 2022 Josselin Poiret@* Copyright @copyright{} 2021 Andrew Tropin@* Copyright @copyright{} 2021 Sarah Morgensen@* -Copyright @copyright{} 2021 Josselin Poiret@* Copyright @copyright{} 2022 Remco van 't Veer@* Copyright @copyright{} 2022 Aleksandr Vityazev@* -- 2.34.0 From unknown Fri Aug 15 14:47:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54783: [PATCH 1/2] system: Align zram priority with swap-space spec to clarify. Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 21 Apr 2022 13:50:03 +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: Stefan Baums , 54783@debbugs.gnu.org Cc: Josselin Poiret Received: via spool by 54783-submit@debbugs.gnu.org id=B54783.165054897130500 (code B ref 54783); Thu, 21 Apr 2022 13:50:03 +0000 Received: (at 54783) by debbugs.gnu.org; 21 Apr 2022 13:49:31 +0000 Received: from localhost ([127.0.0.1]:48767 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nhXBa-0007vl-OS for submit@debbugs.gnu.org; Thu, 21 Apr 2022 09:49:31 -0400 Received: from jpoiret.xyz ([206.189.101.64]:35610) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nhXBY-0007vR-Li for 54783@debbugs.gnu.org; Thu, 21 Apr 2022 09:49:29 -0400 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id 5490F184BF2; Thu, 21 Apr 2022 13:49:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1650548966; h=from:from: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: in-reply-to:in-reply-to:references:references; bh=UIwK70k46IKPm09KBnzmf7zUFPzerlQnvzCfGbyB08k=; b=BOkMdSx0cIG3/QNVCiK/G7qs+40L//LAHL3IJhBa46CXR0EQaXKTySPRUOuvLK8dRbh0Qt Z5XowrD2nVKMhlzQAV2Um1cCSkZ5f6FY24kkTpgVaSVyuWXgpuKU33WwyiI2e4xvAmztSo UWAv3fmOmex4N6skneXLVVJWYwZsLz5H31a/S3vQ+qliQI7pXBe/llsfQM5hwcKji/ACgS CJwjYRywHXm8w0+pcGDq7Wo62m23JCXcAbu4sQ+o+F+j1lu7AsLMXQpFh9aHqcW07aTLuK Co9w+qosb4hni86eTjG2nVzUdMorswN4auB1J8IbbugqSCv6/3wrDy0UkZ1xfg== From: Josselin Poiret Date: Thu, 21 Apr 2022 15:49:20 +0200 Message-Id: <20220421134921.1505-1-dev@jpoiret.xyz> In-Reply-To: <87sfq6g96j.fsf@jpoiret.xyz> References: <87sfq6g96j.fsf@jpoiret.xyz> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Authentication-Results: jpoiret.xyz; auth=pass smtp.auth=jpoiret@jpoiret.xyz smtp.mailfrom=dev@jpoiret.xyz X-Spamd-Bar: --- X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * 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->ud [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: jpoiret.xyz (xyz)] 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * 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->ud [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: jpoiret.xyz (xyz)] 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * 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 that 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 @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 © 2020 Efraim Flashner ;;; Copyright © 2021 raid5atemyhomework ;;; Copyright © 2021 B. Wilson +;;; Copyright © 2022 Josselin Poiret ;;; ;;; This file is part of GNU Guix. ;;; @@ -21,9 +22,11 @@ ;;; along with GNU Guix. If not, see . (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) + (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)) (define (zram-device-configuration->udev-string config) "Translate a into a string which can be @@ -278,8 +293,13 @@ (define (zram-device-configuration->udev-string config) "") "RUN+=\"/run/current-system/profile/sbin/mkswap /dev/zram0\" " "RUN+=\"/run/current-system/profile/sbin/swapon " - (if (not (equal? -1 priority)) - (string-append "--priority " (number->string priority) " ") + ;; XXX: The field is delayed while the deprecation warning remains in + ;; place, so we can't use match to fetch it (it would give a promise) + (if (zram-device-configuration-priority config) + (string-append "--priority " + (number->string + (zram-device-configuration-priority config)) + " ") "") "/dev/zram0\"\n")))) -- 2.34.0 From unknown Fri Aug 15 14:47:21 2025 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-Spam-Score: 1.6 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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-configu [...] Content analysis details: (1.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (maxim.cournoyer[at]gmail.com) 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: jpoiret.xyz (xyz)] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.182 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.160.182 listed in wl.mailspike.net] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.6 (/) 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 From unknown Fri Aug 15 14:47:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54783: [v2 0/2] Clarify zram priority Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 24 May 2022 17:17: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: Maxim Cournoyer Cc: 54783@debbugs.gnu.org, Stefan Baums , Josselin Poiret Received: via spool by 54783-submit@debbugs.gnu.org id=B54783.16534125987649 (code B ref 54783); Tue, 24 May 2022 17:17:01 +0000 Received: (at 54783) by debbugs.gnu.org; 24 May 2022 17:16:38 +0000 Received: from localhost ([127.0.0.1]:53230 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntY97-0001zJ-Oo for submit@debbugs.gnu.org; Tue, 24 May 2022 13:16:37 -0400 Received: from jpoiret.xyz ([206.189.101.64]:34530) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntY94-0001z6-GE for 54783@debbugs.gnu.org; Tue, 24 May 2022 13:16:36 -0400 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id 94B8B184F2B; Tue, 24 May 2022 17:16:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1653412593; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VUxFMw3RNi00W5scHeviVVZLZea000yaANidDzSU4DE=; b=GLcjEE9EaqkI/N+1i0g9vIRe0g9dJPl8a1I5kBICp4QF6zHRCNEP6/5AgktZSbgabFT4g9 89BlHjEKuz6Lz/dxTrSxm0rQ2Ti8xOChuxI6zQigTNkFOuf9TPnkWu8mCqgC7wDdxwrZAr MD/HeHAKU9VdjFR93oMIXjzEMC55tjvMcqnGcCmHW/S38YU9FBiEMZO8R7DIhhW9vKEzsO uG56SXYsoMGZKfrGatXmtudAq1/TEIohrRmbnnbWNKLTncD5aP8F6hh18WF9CMVE4NcNji DZlSra53Edbxp4t1mK9SR8whWy5W5b0L+84FYpUKEYaCjqpG7Ro+FdORpXmZyA== From: Josselin Poiret Date: Tue, 24 May 2022 19:16:29 +0200 Message-Id: <20220524171631.25011-1-dev@jpoiret.xyz> In-Reply-To: <87o7zn3pkf.fsf_-_@gmail.com> References: <87o7zn3pkf.fsf_-_@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Authentication-Results: jpoiret.xyz; auth=pass smtp.auth=jpoiret@jpoiret.xyz smtp.mailfrom=dev@jpoiret.xyz X-Spam-Level: ****** X-Spamd-Bar: ++++++ X-Spam: Yes X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hello Maxim, Thanks for looking at this. Here's a v2. Maxim Cournoyer writes: > 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? Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: jpoiret.xyz (xyz)] 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hello Maxim, Thanks for looking at this. Here's a v2. Maxim Cournoyer writes: > 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? Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: jpoiret.xyz (xyz)] 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager Hello Maxim, Thanks for looking at this. Here's a v2. Maxim Cournoyer writes: > 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? Right, and this would get worse if someone ended up inheriting from another configuration. It would be bad UX IMO. > 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). Right, fixed! > The rest LGTM. > > Maxim Josselin Poiret (2): system: Align zram priority with swap-space spec to clarify. doc: Remove double copyright. doc/guix.texi | 11 +++++------ gnu/services/linux.scm | 29 ++++++++++++++++++++++++++--- 2 files changed, 31 insertions(+), 9 deletions(-) -- 2.36.0 From unknown Fri Aug 15 14:47:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54783: [PATCH v2 2/2] doc: Remove double copyright. Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 24 May 2022 17:17:02 +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: Maxim Cournoyer Cc: 54783@debbugs.gnu.org, Stefan Baums , Josselin Poiret Received: via spool by 54783-submit@debbugs.gnu.org id=B54783.16534126017666 (code B ref 54783); Tue, 24 May 2022 17:17:02 +0000 Received: (at 54783) by debbugs.gnu.org; 24 May 2022 17:16:41 +0000 Received: from localhost ([127.0.0.1]:53236 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntY9A-0001za-Ur for submit@debbugs.gnu.org; Tue, 24 May 2022 13:16:41 -0400 Received: from jpoiret.xyz ([206.189.101.64]:34744) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntY99-0001zS-IL for 54783@debbugs.gnu.org; Tue, 24 May 2022 13:16:39 -0400 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id 761C7184F2B; Tue, 24 May 2022 17:16:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1653412598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/LTHKdDk/82d3yQFCvX6+Pi8hUAl40KmleSHxD210ao=; b=INlpt48JNJ10RwuYDxQ+pN9kxRhEmNH70KOdpYHYNYJzDChQVNQtBNgCQ16L0hA6lOKFcF oLlbam2c6Q7uooX1s/MVA4u7ey8VpopnOLEFZ/sm1OcHfjMQlcO77iXjwt4mzj0T4IsyG4 bMYB75F9vFpdM47tedAZsR5oM0eI+e8UksDOnJaVRXSbM8pBfFA4hMPMDvbJlGm/CqiOpk 2dYSHR1Bcd0DAZ3DKau1k60nXLGQix7N7lOERjgvqsm3xIXx8kAjVJ9eq6wPmgPrCae1jB wa/I5r1ofD5E7dLh4eiQnjeBp1HO0UHY7KDt0YIhaMaYNIxCElJs8ny86o+Aow== From: Josselin Poiret Date: Tue, 24 May 2022 19:16:31 +0200 Message-Id: <20220524171631.25011-3-dev@jpoiret.xyz> In-Reply-To: <20220524171631.25011-1-dev@jpoiret.xyz> References: <87o7zn3pkf.fsf_-_@gmail.com> <20220524171631.25011-1-dev@jpoiret.xyz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Authentication-Results: jpoiret.xyz; auth=pass smtp.auth=jpoiret@jpoiret.xyz smtp.mailfrom=dev@jpoiret.xyz X-Spam-Level: ** X-Spamd-Bar: ++ X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * doc/guix.texi: Remove doubled Josselin Poiret copyright line. --- doc/guix.texi | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 5f0120a3bd..b960c546a8 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -99,7 +99,6 @@ Copyright @copyright{} 2021 Alice Brenon@* Copyright @copyright [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: jpoiret.xyz (xyz)] 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * doc/guix.texi: Remove doubled Josselin Poiret copyright line. --- doc/guix.texi | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 5f0120a3bd..b960c546a8 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -99,7 +99,6 @@ Copyright @copyright{} 2021 Alice Brenon@* Copyright @copyright [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: jpoiret.xyz (xyz)] 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * doc/guix.texi: Remove doubled Josselin Poiret copyright line. --- doc/guix.texi | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 5f0120a3bd..b960c546a8 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -99,7 +99,6 @@ Copyright @copyright{} 2021 Alice Brenon@* Copyright @copyright{} 2021, 2022 Josselin Poiret@* Copyright @copyright{} 2021 Andrew Tropin@* Copyright @copyright{} 2021 Sarah Morgensen@* -Copyright @copyright{} 2021 Josselin Poiret@* Copyright @copyright{} 2022 Remco van 't Veer@* Copyright @copyright{} 2022 Aleksandr Vityazev@* Copyright @copyright{} 2022 Philip M@sup{c}Grath@* -- 2.36.0 From unknown Fri Aug 15 14:47:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54783: [PATCH v2 1/2] system: Align zram priority with swap-space spec to clarify. Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 24 May 2022 17:17:02 +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: Maxim Cournoyer Cc: 54783@debbugs.gnu.org, Stefan Baums , Josselin Poiret Received: via spool by 54783-submit@debbugs.gnu.org id=B54783.16534126077684 (code B ref 54783); Tue, 24 May 2022 17:17:02 +0000 Received: (at 54783) by debbugs.gnu.org; 24 May 2022 17:16:47 +0000 Received: from localhost ([127.0.0.1]:53238 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntY9E-0001zo-7C for submit@debbugs.gnu.org; Tue, 24 May 2022 13:16:47 -0400 Received: from jpoiret.xyz ([206.189.101.64]:34632) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntY98-0001zQ-Cm for 54783@debbugs.gnu.org; Tue, 24 May 2022 13:16:41 -0400 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id 034691851D2; Tue, 24 May 2022 17:16:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1653412595; h=from:from: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: in-reply-to:in-reply-to:references:references; bh=aLveTWhfUN57rqAPomWZbpKXknSPcnz9eVeKV2zTrXg=; b=geRKuJP3/9F7W9iO8/Kc40K90UdHnNtTZiPqG8jQU03RgCSs3xgiWfyZtrrzaSVUP3OYVd P4jg98M12mW7ec20PSAdQJPAQVPHMUTAwmgvwn8CcbOHq68DuQ410iUe4CfFNZTWpnGMMi P4buUqhKoyJQ7fFsa1gGtLo6lFJQuEokXcOeG4Yet/MNP1dbKHzDczi4YtEatwwrhgl9VY vkH6W9FpOK+m7jauZtQaZ5aIY+kD6iw5mm0m+fkAq4tflMxdQbrjy09BQ2k/0bnpqCTdjZ YvUm/vLoo+MsscnkwmYOLl7Wt83SMqi3ihP/MI8lFsTAAVWEl42bZUD9n6xtlg== From: Josselin Poiret Date: Tue, 24 May 2022 19:16:30 +0200 Message-Id: <20220524171631.25011-2-dev@jpoiret.xyz> In-Reply-To: <20220524171631.25011-1-dev@jpoiret.xyz> References: <87o7zn3pkf.fsf_-_@gmail.com> <20220524171631.25011-1-dev@jpoiret.xyz> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Authentication-Results: jpoiret.xyz; auth=pass smtp.auth=jpoiret@jpoiret.xyz smtp.mailfrom=dev@jpoiret.xyz X-Spamd-Bar: - X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * 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->ud [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: jpoiret.xyz (xyz)] 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * 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->ud [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: jpoiret.xyz (xyz)] 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * 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 | 29 ++++++++++++++++++++++++++--- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 184206bec8..5f0120a3bd 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@* @@ -35213,11 +35213,11 @@ that compression will be 2:1, it is possible that 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 @end deftp diff --git a/gnu/services/linux.scm b/gnu/services/linux.scm index 2eb02ac5a3..c6e460597a 100644 --- a/gnu/services/linux.scm +++ b/gnu/services/linux.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2020 Efraim Flashner ;;; Copyright © 2021 raid5atemyhomework ;;; Copyright © 2021 B. Wilson +;;; Copyright © 2022 Josselin Poiret ;;; ;;; This file is part of GNU Guix. ;;; @@ -21,9 +22,12 @@ ;;; along with GNU Guix. If not, see . (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 (guix ui) #:use-module (gnu services) #:use-module (gnu services base) #:use-module (gnu services shepherd) @@ -252,7 +256,21 @@ (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) ; to avoid printing the deprecation + ; warning multiple times + (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~%")) + (display-hint (G_ "Use #f or leave as default instead (@pxref{Linux \ +Services}).")) + #f) + priority)) (define (zram-device-configuration->udev-string config) "Translate a into a string which can be @@ -278,8 +296,13 @@ (define (zram-device-configuration->udev-string config) "") "RUN+=\"/run/current-system/profile/sbin/mkswap /dev/zram0\" " "RUN+=\"/run/current-system/profile/sbin/swapon " - (if (not (equal? -1 priority)) - (string-append "--priority " (number->string priority) " ") + ;; XXX: The field is delayed while the deprecation warning remains in + ;; place, so we can't use match to fetch it (it would give a promise) + (if (zram-device-configuration-priority config) + (string-append "--priority " + (number->string + (zram-device-configuration-priority config)) + " ") "") "/dev/zram0\"\n")))) -- 2.36.0 From unknown Fri Aug 15 14:47:21 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Stefan Baums Subject: bug#54783: closed (Re: bug#54783: ZRAM default priority wrong) Message-ID: References: <878rq3g2uh.fsf@gmail.com> <878rsgfgxg.fsf@lmu.de> X-Gnu-PR-Message: they-closed 54783 X-Gnu-PR-Package: guix Reply-To: 54783@debbugs.gnu.org Date: Sat, 11 Jun 2022 05:57:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1654927022-32540-1" This is a multi-part message in MIME format... ------------=_1654927022-32540-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #54783: ZRAM default priority wrong which was filed against the guix package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 54783@debbugs.gnu.org. --=20 54783: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D54783 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1654927022-32540-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 54783-done) by debbugs.gnu.org; 11 Jun 2022 05:56:50 +0000 Received: from localhost ([127.0.0.1]:51723 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzu78-0008SR-1f for submit@debbugs.gnu.org; Sat, 11 Jun 2022 01:56:50 -0400 Received: from mail-qv1-f46.google.com ([209.85.219.46]:47101) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzu74-0008SC-Rt for 54783-done@debbugs.gnu.org; Sat, 11 Jun 2022 01:56:48 -0400 Received: by mail-qv1-f46.google.com with SMTP id i19so973568qvu.13 for <54783-done@debbugs.gnu.org>; Fri, 10 Jun 2022 22:56:46 -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; bh=C9KnPBeSRu/sPo44yUt0SV25DcHfHFCog6FDkxutMag=; b=mnLZ13L21HFj6JwlHlTOlXxNFFJ/OYTWB1OKjXICWD1uy/XYgG98PZGLrNmMlQiumy A+ayzb/gEaQNOjsDkwu6nYos6dE3RU6CWawUICAcsPKw2RiDY5XDti1WshU9yycukDC6 5DA8SKeXRWkEKSxcYqpvzgIVJF1o4V7TTH+5kldiqZFt4VRVdGNqSL4Nhkb1Dx34zrFo vL3od+ERC9448LBqvO3W71UluWZkLhKKOj+1k8KaGw3khXLDGJ027NkkRDJZnNKM4/ru VAI0ui5Tu3qVwx0jVyoNwizpqh3iTfJjeutlMUF482zNsgnpsESISl9QSaoe5KvJkeaJ SqnA== 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; bh=C9KnPBeSRu/sPo44yUt0SV25DcHfHFCog6FDkxutMag=; b=fyutPmF0TA2kcTRVQUuUhHOIyl9bZR4JOnrMuYTEkuq3Jx7E0b79Eam6I+mnvKT8Vh sM8GD2V00DKZ6heukxwfCFmrfi4AV6SYdas6mnGjMleB5hkwQAcJs2l7pdquwS5RfjGH MV57WVLBeoiI/UlD7ZdsFEPOECUY+sUOFzmB9h9IJKfOmzk9BjoHBSlDnS+hETlVPHWd Yv7nJ5gtUXwANi+XQ1SGNW496x38S7zUeQMGt3vkWbtdRf+sgEMsu8y6dUlZSxGRLtrE 0fmUNL0BMxzCjN3WjLiuM6dTcuGK5mOEQcXOtkpnXIfKdhiG6VadFloy0CKOmsF8uTnh nLWg== X-Gm-Message-State: AOAM533Akh4R6O51c9DkV0kvcglIfIGdnpgUropphwhS/7gER2j8h0O0 AkG/RpNujz0gLTtNumtfJMzPRd3mCxD7pw== X-Google-Smtp-Source: ABdhPJwsRwBiHscfyJUJlsocHo7PIACWM7k6zYhRPdKAqFGT7lCKmia7eGzfRz3w9zIhzx1l/elRGw== X-Received: by 2002:ad4:5447:0:b0:461:d7a7:f0ec with SMTP id h7-20020ad45447000000b00461d7a7f0ecmr91886351qvt.21.1654927000694; Fri, 10 Jun 2022 22:56:40 -0700 (PDT) Received: from hurd (dsl-155-254.b2b2c.ca. [66.158.155.254]) by smtp.gmail.com with ESMTPSA id s22-20020a05620a0bd600b006a73ad95d40sm1253558qki.55.2022.06.10.22.56.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 22:56:39 -0700 (PDT) From: Maxim Cournoyer To: Josselin Poiret Subject: Re: bug#54783: ZRAM default priority wrong References: <878rsgfgxg.fsf@lmu.de> <87sfq6g96j.fsf@jpoiret.xyz> Date: Sat, 11 Jun 2022 01:56:38 -0400 In-Reply-To: <87sfq6g96j.fsf@jpoiret.xyz> (Josselin Poiret's message of "Thu, 21 Apr 2022 09:57:56 +0200") Message-ID: <878rq3g2uh.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 54783-done Cc: 54783-done@debbugs.gnu.org, Stefan Baums X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Josselin, [...] > > On the Guix side of things, we should really be using the same interface > as swap-space, as I think the distinction between #f and 0 to 32767 is > clearer. I'll send some patches that adress this soon, along with the > zram-service-type documentation. I've made this smallish change: --8<---------------cut here---------------start------------->8--- modified gnu/services/linux.scm @@ -296,14 +296,12 @@ (define (zram-device-configuration->udev-string config) "") "RUN+=\"/run/current-system/profile/sbin/mkswap /dev/zram0\" " "RUN+=\"/run/current-system/profile/sbin/swapon " - ;; XXX: The field is delayed while the deprecation warning remains in - ;; place, so we can't use match to fetch it (it would give a promise) - (if (zram-device-configuration-priority config) - (string-append "--priority " - (number->string - (zram-device-configuration-priority config)) - " ") - "") + ;; TODO: Revert to simply use 'priority' after removing the deprecation + ;; warning and the delayed property of the field. + (let ((priority* (force priority))) + (if priority* + (format #f "--priority ~a " priority*) + "")) "/dev/zram0\"\n")))) (define %zram-device-config --8<---------------cut here---------------end--------------->8--- Because the TODO comments seems more actionable for my future self, and pushed as a99015c878. Thanks Stefan for reporting the issue and for Josselin for fixing it! Closing. Maxim ------------=_1654927022-32540-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 8 Apr 2022 04:20:32 +0000 Received: from localhost ([127.0.0.1]:33753 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ncg6q-0004HU-GK for submit@debbugs.gnu.org; Fri, 08 Apr 2022 00:20:32 -0400 Received: from lists.gnu.org ([209.51.188.17]:39678) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nceLa-0001ah-DA for submit@debbugs.gnu.org; Thu, 07 Apr 2022 22:27:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57930) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nceLa-0003wK-70 for bug-guix@gnu.org; Thu, 07 Apr 2022 22:27:38 -0400 Received: from stefanbaums.com ([164.138.27.169]:42806) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nceLY-0005LI-Mp for bug-guix@gnu.org; Thu, 07 Apr 2022 22:27:37 -0400 Received: from deepthought (unknown [185.213.154.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: baums) by stefanbaums.com (Postfix) with ESMTPSA id 3BC9B19E2F5 for ; Fri, 8 Apr 2022 04:27:33 +0200 (CEST) From: Stefan Baums To: bug-guix@gnu.org Subject: ZRAM default priority wrong Date: Thu, 07 Apr 2022 22:27:23 -0400 Message-ID: <878rsgfgxg.fsf@lmu.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Received-SPF: pass client-ip=164.138.27.169; envelope-from=baums@stefanbaums.com; helo=stefanbaums.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 08 Apr 2022 00:20:31 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) I have a swap file and zram configured without specifying priority. The swap file was assigned -2, and zram -3, with the effect that zram was never used. I had to manually change the zram priority to something higher that that of the swap file. The manual wrongly claims that the default priority for zram is -1. The same paragraph of the manual also says: =E2=80=98swapon=E2=80=99 accepts values between -1 and 32767, with higher values indicating higher priority. which makes the -2 priority of the swap file look suspect (though it seems to work). ------------=_1654927022-32540-1--