From: Keir Fraser Subject: Re: Re: how to handle paged hypercall args? Date: Thu, 11 Nov 2010 21:00:03 +0000 Message-ID: References: <20101111203438.GA18469@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20101111203438.GA18469@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Olaf Hering Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 11/11/2010 20:34, "Olaf Hering" wrote: > On Thu, Nov 11, Keir Fraser wrote: > >> On 11/11/2010 14:33, "Olaf Hering" wrote: >> >>> So is that an acceptable way to deal with the HVMCOPY_gfn_paged_out >>> return codes from __hvm_copy? >>> Or should I explore some different way, like spinning there and possible >>> let other threads-of-execution make progress while waiting for the gfns >>> to come back? >> >> You can't just spin because Xen is not preemptible. If it were a single CPU >> system for example, no other thread would ever run again. You have to 'spin' >> via a preemptible loop that returns to guest context and then back into the >> hypercall. Which appears to be what you're doing. > > Thanks for the answer. > > It occoured to me that this is an issue for hypercalls made by the > guest. There are probably not that many in use. So it shouldnt be that > hard to audit the few drivers what they use and add some error handling. > Up to now, only do_memory_op had an issue. Only other thing I'd say is that depending on how often this happens, because paging in may well require a slow I/O operation, it may even be nice to sleep the waiting vcpu rather than spin. Would require some mechanism to record what vcpus are waiting for what mfns, and to check that list when paging stuff in. I guess it's rather a 'phase 2' thing after things actually work reliably! -- Keir > > Olaf >