qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Re: [PATCH 1/5] Add target memory mapping API


From: Anthony Liguori
Subject: Re: [Qemu-devel] Re: [PATCH 1/5] Add target memory mapping API
Date: Thu, 22 Jan 2009 12:46:51 -0600
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

Ian Jackson wrote:
Anthony Liguori writes ("Re: [Qemu-devel] Re: [PATCH 1/5] Add target memory mapping 
API"):
The second criticism is a matter of taste, perhaps, and the third can
be addressed later:

 * The mixed call/callback API: [...]

   Callbacks are increasingly dominating the innards of qemu for good
   reasons.  I think I have explained how a callback style can provide
   the necessary functionality.
I understand the point you make here and I think we'll end up having a callback API. But for reasons I've already mentioned, I don't think it makes sense for it to be the core API since it introduces very difficult to eliminate deadlocks.

I think my most recently sketched-out proposal (where the caller
passes a DMA sg list to the mapping request function) doesn't have
these deadlocks ?

But what do you do with a DMA request that cannot possibly be bounced but that can be split? In other words, a DMA request to 1G of MMIO memory that is disk access. We can absolutely split that into multiple requests.

It seems to me that the way to avoid the deadlock is to allow the
caller to make their whole request at once rather than having two
callers both racing to grab resources.

In practice, you can't rely on being able to allocate enough memory in the host to complete a full request. This is only true for very special devices. You definitely need to support two distinct modes.

Regards,

Anthony Liguori

Regards,
Ian.







reply via email to

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