[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/5] Add map client retry notification
From: |
Ian Jackson |
Subject: |
Re: [Qemu-devel] [PATCH 2/5] Add map client retry notification |
Date: |
Thu, 22 Jan 2009 12:30:10 +0000 |
Avi Kivity writes ("[Qemu-devel] [PATCH 2/5] Add map client retry
notification"):
> The target memory mapping API may fail if the bounce buffer resources
> are exhausted. Add a notification mechanism to allow clients to retry
> the mapping operation when resources become available again.
Does this API not suffer from the potential deadlock described by
Anthony ?
Imagine that for some reason bounce buffers are in use. If we have a
client which wants to do a single writev on a tap device it will even
deadlock by itself:
map(<block 0>) succeeds
map(<block 1>) fails, NULL
register_map_client
but the callback will never happen because the client is effectively
waiting for itself to release its own mapping.
Since callers cannot assume that they can map more than one range at
once (since there's only one bounce buffer), any caller which needs to
do scatter-gather (like a tap device, as Anthony points out) needs to
invent its own bounce buffers. That seems like a waste of effort.
There should be a single bounce buffer fallback mechanism, and it
should be sufficiently powerful that it can be used for tap devices,
which means that the calling device emulation must present a single
scatter-gather list to the API all in one go.
Ian.
- [Qemu-devel] [PATCH 0/5] Direct memory access for devices (v2), Avi Kivity, 2009/01/22
- [Qemu-devel] [PATCH 2/5] Add map client retry notification, Avi Kivity, 2009/01/22
- Re: [Qemu-devel] [PATCH 2/5] Add map client retry notification,
Ian Jackson <=
- [Qemu-devel] [PATCH 1/5] Add target memory mapping API, Avi Kivity, 2009/01/22
- [Qemu-devel] [PATCH 3/5] I/O vector helpers, Avi Kivity, 2009/01/22
- [Qemu-devel] [PATCH 4/5] Vectored block device API, Avi Kivity, 2009/01/22
- [Qemu-devel] [PATCH 5/5] Convert IDE to directly access guest memory, Avi Kivity, 2009/01/22
- [Qemu-devel] Re: [PATCH 0/5] Direct memory access for devices (v2), Anthony Liguori, 2009/01/22