unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: Josselin Poiret <dev@jpoiret.xyz>
Cc: 54783-done@debbugs.gnu.org, Stefan Baums <baums@stefanbaums.com>
Subject: bug#54783: ZRAM default priority wrong
Date: Sat, 11 Jun 2022 01:56:38 -0400	[thread overview]
Message-ID: <878rq3g2uh.fsf@gmail.com> (raw)
In-Reply-To: <87sfq6g96j.fsf@jpoiret.xyz> (Josselin Poiret's message of "Thu,  21 Apr 2022 09:57:56 +0200")

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




      parent reply	other threads:[~2022-06-11  6:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-08  2:27 bug#54783: ZRAM default priority wrong Stefan Baums
2022-04-21  7:57 ` Josselin Poiret via Bug reports for GNU Guix
2022-04-21  8:06   ` Stefan Baums
2022-04-21 13:49   ` bug#54783: [PATCH 1/2] system: Align zram priority with swap-space spec to clarify Josselin Poiret via Bug reports for GNU Guix
2022-05-24 15:42     ` bug#54783: ZRAM default priority wrong Maxim Cournoyer
2022-05-24 17:16       ` bug#54783: [v2 0/2] Clarify zram priority Josselin Poiret via Bug reports for GNU Guix
2022-05-24 17:16         ` bug#54783: [PATCH v2 1/2] system: Align zram priority with swap-space spec to clarify Josselin Poiret via Bug reports for GNU Guix
2022-05-24 17:16         ` bug#54783: [PATCH v2 2/2] doc: Remove double copyright Josselin Poiret via Bug reports for GNU Guix
2022-04-21 13:49   ` bug#54783: [PATCH " Josselin Poiret via Bug reports for GNU Guix
2022-06-11  5:56   ` Maxim Cournoyer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878rq3g2uh.fsf@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=54783-done@debbugs.gnu.org \
    --cc=baums@stefanbaums.com \
    --cc=dev@jpoiret.xyz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).