qemu-devel
[Top][All Lists]
Advanced

[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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]