From: Stefan Hajnoczi <stefanha@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: jan.kiszka@siemens.com, qemu-devel@nongnu.org, qemulist@gmail.com
Subject: Re: [Qemu-devel] [RFC PATCH 0/8] MemoryRegion and FlatView refcounting, replace hostmem with memory_region_find
Date: Wed, 8 May 2013 11:18:40 +0200 [thread overview]
Message-ID: <20130508091840.GF16581@stefanha-thinkpad.muc.redhat.com> (raw)
In-Reply-To: <1367850321-1732-1-git-send-email-pbonzini@redhat.com>
On Mon, May 06, 2013 at 04:25:13PM +0200, Paolo Bonzini wrote:
> this is an alternative approach to refactoring of dataplane's HostMem
> code. Here, I take Ping Fan's idea of RCU-style updating of the
> region list and apply it to the AddressSpace's FlatView. With this
> change, dataplane can simply use memory_region_find instead of
> hostmem.
>
> This is a somewhat larger change, but I prefer it for two reasons.
>
> 1) it splits the task of adding BQL-less memory dispatch in two parts,
> tacking memory_region_find first (which is simpler because locking
> is left to the caller).
>
> 2) HostMem duplicates a lot of the FlatView logic, and adding the
> RCU-style update in FlatView benefits everyone.
>
> The missing ingredients here are:
>
> 1) remember and unreference the MemoryRegions that are used in
> a vring entry. In order to implement this, it is probably simpler
> to change vring.c to use virtio.c's VirtQueueElement data structure.
> We want something like that anyway in order to support migration.
Agreed. I want to drop vring.c and have virtio.c use thread-safe APIs
so it can be used from dataplane. VirtQueueElement can hide the
MemoryRegion reference so the virtio device caller (net, block, etc)
doesn't need to juggle references manually.
> 2) add an owner field to MemoryRegion, and set it for all MemoryRegions
> for hot-unpluggable devices. In this series, ref/unref are stubs.
>
> For simplicity I based the patches on my IOMMU rebase. I placed the
> tree at git://github.com/bonzini/qemu.git, branch iommu.
Are you hoping that Ping Fan will pick up this RFC or will you push it
yourself?
Either way, I'm very interested in a thread-safe memory API.
Stefan
next prev parent reply other threads:[~2013-05-08 9:18 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-06 14:25 [Qemu-devel] [RFC PATCH 0/8] MemoryRegion and FlatView refcounting, replace hostmem with memory_region_find Paolo Bonzini
2013-05-06 14:25 ` [Qemu-devel] [RFC PATCH 1/8] memory: add ref/unref calls Paolo Bonzini
2013-05-06 14:25 ` [Qemu-devel] [RFC PATCH 2/8] exec: check MRU in qemu_ram_addr_from_host Paolo Bonzini
2013-05-06 14:25 ` [Qemu-devel] [RFC PATCH 3/8] memory: return MemoryRegion from qemu_ram_addr_from_host Paolo Bonzini
2013-05-06 14:25 ` [Qemu-devel] [RFC PATCH 4/8] memory: ref/unref memory across address_space_map/unmap Paolo Bonzini
2013-05-06 14:25 ` [Qemu-devel] [RFC PATCH 5/8] memory: access FlatView from a local variable Paolo Bonzini
2013-05-06 14:25 ` [Qemu-devel] [RFC PATCH 6/8] memory: use a new FlatView pointer on every topology update Paolo Bonzini
2013-05-06 14:25 ` [Qemu-devel] [RFC PATCH 7/8] memory: add reference counting to FlatView Paolo Bonzini
2013-05-06 14:25 ` [Qemu-devel] [RFC PATCH 8/8] dataplane: replace hostmem with memory_region_find Paolo Bonzini
2013-05-08 6:20 ` [Qemu-devel] [RFC PATCH 0/8] MemoryRegion and FlatView refcounting, " liu ping fan
2013-05-08 15:44 ` Paolo Bonzini
2013-05-09 0:53 ` liu ping fan
2013-05-09 14:50 ` Paolo Bonzini
2013-05-10 0:23 ` liu ping fan
2013-05-08 9:18 ` Stefan Hajnoczi [this message]
2013-05-08 9:25 ` Stefan Hajnoczi
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=20130508091840.GF16581@stefanha-thinkpad.muc.redhat.com \
--to=stefanha@redhat.com \
--cc=jan.kiszka@siemens.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemulist@gmail.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 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 NNTP newsgroup(s).