All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [PATCH 0/2] RFC: add -mem-shared option
Date: Fri, 29 Nov 2019 13:45:11 +0400	[thread overview]
Message-ID: <CAMxuvayDmXcFSvjyBC+e=40tO6N15rbBETDsP_kYoHOU1xKrpg@mail.gmail.com> (raw)
In-Reply-To: <20191129094230.GE2260471@redhat.com>

On Fri, Nov 29, 2019 at 1:42 PM Daniel P. Berrangé <berrange@redhat.com> wrote:
>
> On Fri, Nov 29, 2019 at 01:31:11PM +0400, Marc-André Lureau wrote:
> > Hi
> >
> > On Fri, Nov 29, 2019 at 1:27 PM Daniel P. Berrangé <berrange@redhat.com> wrote:
> > >
> > > On Fri, Nov 29, 2019 at 11:30:51AM +0400, Marc-André Lureau wrote:
> > > > Hi
> > > >
> > > > On Fri, Nov 29, 2019 at 11:03 AM Gerd Hoffmann <kraxel@redhat.com> wrote:
> > > > >
> > > > > On Thu, Nov 28, 2019 at 06:15:16PM +0400, Marc-André Lureau wrote:
> > > > > > Hi,
> > > > > >
> > > > > > Setting up shared memory for vhost-user is a bit complicated from
> > > > > > command line, as it requires NUMA setup such as: m 4G -object
> > > > > > memory-backend-file,id=mem,size=4G,mem-path=/dev/shm,share=on -numa
> > > > > > node,memdev=mem.
> > > > > >
> > > > > > Instead, I suggest to add a -mem-shared option for non-numa setups,
> > > > > > that will make the -mem-path or anonymouse memory shareable.
> > > > >
> > > > > Is it an option to just use memfd by default (if available)?
> > > >
> > > > Yes, with a fallback path currently using a temporary file under /tmp
> > > > (we may want to use shm_open() instead, or a different location such
> > > > as XDG_RUNTIME_DIR? - and use O_TMPFILE)
> > >
> > > We can't assume either /tmp or XDG_RUNTIME_DIR is on tmpfs as that is no
> > > where near standard across all OS distros, and even if on tmpfs these
> > > dirs can be size limited to a significant subset of available RAM. IOW
> > > we can't safely use them unless explicitly told to.
> >
> > Is shm_open() acceptable instead?
> >
> > Imho, -mem-shared should do a best effort by default, but can fail.
>
> Possibly, but if we're relying on shm_open choosing the path, then
> its harder for users to know what files to clean up when QEMU crashes
> or otherwise exits wthout a shm_unlink

True, although I think you can call shm_unlink() right after
shm_open() that should limit the risk of those forgotten files.



  reply	other threads:[~2019-11-29  9:54 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-28 14:15 [PATCH 0/2] RFC: add -mem-shared option Marc-André Lureau
2019-11-28 14:15 ` [PATCH 1/2] memfd: add qemu_memfd_open() Marc-André Lureau
2019-11-28 14:15 ` [PATCH 2/2] Add -mem-shared option Marc-André Lureau
2019-11-28 16:14   ` Eduardo Habkost
2019-11-28 16:28   ` Igor Mammedov
2019-11-28 20:31     ` Marc-André Lureau
2019-11-29 10:07       ` Igor Mammedov
2019-11-29 10:11         ` Paolo Bonzini
2019-11-29 12:01           ` Markus Armbruster
2019-11-29 20:31             ` Eduardo Habkost
2019-11-29 12:16           ` Igor Mammedov
2019-11-29 17:46             ` Paolo Bonzini
2019-12-02  7:39               ` Igor Mammedov
2019-12-02 21:00                 ` Eduardo Habkost
2019-12-03  8:56                   ` Thomas Huth
2019-12-03 14:43                     ` Igor Mammedov
2019-12-09 20:58                       ` Eduardo Habkost
2019-12-10 10:34                         ` Markus Armbruster
2019-12-10 13:09                           ` Igor Mammedov
2019-12-03 21:34                     ` Eduardo Habkost
2019-11-28 16:10 ` [PATCH 0/2] RFC: add " Eduardo Habkost
2019-11-29  9:18   ` Igor Mammedov
2019-11-29  9:31   ` Paolo Bonzini
2019-11-29 10:23     ` Igor Mammedov
2019-11-29 11:21       ` Paolo Bonzini
2019-11-29 20:21     ` Eduardo Habkost
2019-12-01 15:40       ` Marc-André Lureau
2019-12-01 18:03         ` Paolo Bonzini
2019-11-28 16:59 ` Dr. David Alan Gilbert
2019-11-29  9:23   ` Igor Mammedov
2019-12-13 11:39     ` Stefan Hajnoczi
2019-12-13 13:12       ` Igor Mammedov
2019-11-29  4:37 ` no-reply
2019-11-29  5:34 ` no-reply
2019-11-29  7:02 ` Gerd Hoffmann
2019-11-29  7:30   ` Marc-André Lureau
2019-11-29  9:27     ` Daniel P. Berrangé
2019-11-29  9:31       ` Marc-André Lureau
2019-11-29  9:42         ` Daniel P. Berrangé
2019-11-29  9:45           ` Marc-André Lureau [this message]
2019-11-29 11:44             ` Gerd Hoffmann
2019-11-29  9:33       ` Paolo Bonzini
2019-11-29  9:39         ` Daniel P. Berrangé
2019-11-29  9:52           ` Paolo Bonzini
2019-11-29 10:13         ` Igor Mammedov
2019-11-29 11:20           ` Paolo Bonzini

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

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

  git send-email \
    --in-reply-to='CAMxuvayDmXcFSvjyBC+e=40tO6N15rbBETDsP_kYoHOU1xKrpg@mail.gmail.com' \
    --to=marcandre.lureau@redhat.com \
    --cc=berrange@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=stefanha@redhat.com \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.