unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: Leo Famulari <leo@famulari.name>
Cc: 47225@debbugs.gnu.org
Subject: bug#47225: QEMU warning about performance
Date: Tue, 06 Apr 2021 20:42:38 -0400	[thread overview]
Message-ID: <87v98zncw1.fsf@gmail.com> (raw)
In-Reply-To: <YGzdd2ey7wbrzN+h@jasmine.lan> (Leo Famulari's message of "Tue, 6 Apr 2021 18:15:19 -0400")


[-- Attachment #1.1: Type: text/plain, Size: 934 bytes --]

Hi Leo!

Leo Famulari <leo@famulari.name> writes:

> On Tue, Apr 06, 2021 at 05:42:15PM -0400, Maxim Cournoyer wrote:
>> From c720e68229322e5c38c0321b021e8d6430636111 Mon Sep 17 00:00:00 2001
>> From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
>> Date: Tue, 6 Apr 2021 17:37:33 -0400
>> Subject: [PATCH] system: vm: Set a larger value for the msize option of the 9p
>>  file system.
>> 
>> Fixes <https://issues.guix.gnu.org/47225>.
>> 
>> * gnu/system/vm.scm (mapping->file-system): Set the msize option to a value of
>> 100 MiB (from the default 8 KiB).
>> 
>> Reported-by: Leo Famulari <leo@famulari.name>
>
> Thanks! I'll test and push along with the next kernel update (that's
> when I noticed this warning). Feel free to push sooner if you like.

I hope I'm timely; I've made a revised version of the patch, that should
cover more cases (and actually uses 100 MiB rather than 1 MiB :-)).

Thank you,


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-system-vm-Set-a-larger-value-for-the-msize-option-of.patch --]
[-- Type: text/x-patch, Size: 2713 bytes --]

From eb600c4ffbc8016709db9471f9dc0be1d60167a7 Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Date: Tue, 6 Apr 2021 17:37:33 -0400
Subject: [PATCH] system: vm: Set a larger value for the msize option of the 9p
 file system.

Fixes <https://issues.guix.gnu.org/47225>.

* gnu/system/vm.scm (%default-msize-value): New variable.
(%linux-vm-file-systems): Use it as the value of the msize option.
(mapping->file-system): Likewise.

Reported-by: Leo Famulari <leo@famulari.name>
---
 gnu/system/vm.scm | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 3d0935b3af..1efae7ff06 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -88,6 +88,13 @@
 ;;;
 ;;; Code:
 
+;; By default, the msize value is 8 KiB, which according to QEMU is
+;; insufficient and would degrade performance.  The msize value should roughly
+;; match the bandwidth of the system's IO (see:
+;; https://wiki.qemu.org/Documentation/9psetup#msize).  Use 100 MiB as a
+;; conservative default.
+(define %default-msize-value (* 100 (expt 2 20))) ;100 MiB
+
 (define %linux-vm-file-systems
   ;; File systems mounted for 'derivation-in-linux-vm'.  These are shared with
   ;; the host over 9p.
@@ -103,21 +110,23 @@
           (type "9p")
           (needed-for-boot? #t)
           (flags '(read-only))
-          (options "trans=virtio,cache=loose")
+          (options (format #f "trans=virtio,cache=loose,msize=~a"
+                           %default-msize-value))
           (check? #f))
         (file-system
           (mount-point "/xchg")
           (device "xchg")
           (type "9p")
           (needed-for-boot? #t)
-          (options "trans=virtio")
+          (options (format #f "trans=virtio,msize=~a" %default-msize-value))
           (check? #f))
         (file-system
           (mount-point "/tmp")
           (device "tmp")
           (type "9p")
           (needed-for-boot? #t)
-          (options "trans=virtio,cache=loose")
+          (options (format #f "trans=virtio,cache=loose,msize=~a"
+                           %default-msize-value))
           (check? #f))))
 
 (define not-config?
@@ -581,7 +590,8 @@ the operating system."
        (type "9p")
        (flags (if writable? '() '(read-only)))
        (options (string-append "trans=virtio"
-                               (if writable? "" ",cache=loose")))
+                               (if writable? "" ",cache=loose")
+                               ",msize=" (number->string %default-msize-value)))
        (check? #f)
        (create-mount-point? #t)))))
 
-- 
2.31.1


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2021-04-07  0:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-18  6:25 bug#47225: QEMU warning about performance Leo Famulari
2021-04-06 21:42 ` Maxim Cournoyer
2021-04-06 22:15   ` Leo Famulari
2021-04-07  0:42     ` Maxim Cournoyer [this message]
2021-04-07 17:46       ` Leo Famulari
2021-04-08 19:17       ` Leo Famulari

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=87v98zncw1.fsf@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=47225@debbugs.gnu.org \
    --cc=leo@famulari.name \
    /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).