All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>,
	den@virtuozzo.com,
	virtualization <virtualization@lists.linux-foundation.org>
Subject: Re: memory locking in vhost-vdpa
Date: Thu, 4 Aug 2022 02:30:14 -0400	[thread overview]
Message-ID: <20220804022815-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CACGkMEtLutWVnG_SHbP9+K851k4ZN3hdtZGxaYpbAz3wzEvSGA@mail.gmail.com>

On Thu, Aug 04, 2022 at 09:52:47AM +0800, Jason Wang wrote:
> On Thu, Aug 4, 2022 at 1:46 AM Andrey Zhadchenko
> <andrey.zhadchenko@virtuozzo.com> wrote:
> >
> > Hi!
> >
> > Recently I sent vhost-blk patchset and Stefano suggested to instead join
> > efforts on developing vdpa-blk.
> > I played with it a bit and looks like vdpa itself pins the whole guest
> > memory. Is there a way to control it or reduce pinned amount to the
> > device pages?
> > Looks like even vdpa-sim requires all memory to be pinned [1]. Pinning
> > this much will surely impact guest density.
> 
> It depends on the parent.
> 
> When allocating the vDPA device, the parent can clams it supports
> virtual address then pinning is avoided:
> 
> /**
>  * __vdpa_alloc_device - allocate and initilaize a vDPA device
>  * This allows driver to some prepartion after device is
>  * initialized but before registered.
> ...
>  * @use_va: indicate whether virtual address must be used by this device
>  */
> 
> The only user so far is VDUSE which is a software parent in the
> userspace with a customized swiotlb for kernel drivers.
> 
> Simulator came before this feature so we stick to the pinning method,
> technically we can switch to use the va mode, but it might have some
> performance impact (mostly the copy_from|to_user()).
> 
> This option might be useful for hardware parent if PRI or device page
> fault is supported in the future.
> 
> Thanks

Well VDUSE has this funky bounce buffer design. It works but
is costly performance wise.



> >
> > Kind regards,
> > Andrey
> >
> > [1] https://bugzilla.redhat.com/show_bug.cgi?id=1868535
> >

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  reply	other threads:[~2022-08-04  6:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <780fba4c-458f-0abc-ae48-4cf806401228@virtuozzo.com>
2022-08-04  1:52 ` memory locking in vhost-vdpa Jason Wang
2022-08-04  6:30   ` Michael S. Tsirkin [this message]
2022-08-04  6:39   ` Stefano Garzarella
2022-08-04  6:43     ` Michael S. Tsirkin
2022-08-04  7:27     ` Jason Wang

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=20220804022815-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=andrey.zhadchenko@virtuozzo.com \
    --cc=den@virtuozzo.com \
    --cc=jasowang@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    /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.