From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: Re: RFC: mem_event: use wait queue when ring is full Date: Wed, 23 Nov 2011 19:23:57 +0100 Message-ID: <20111123182357.GB26648@aepfle.de> References: <20111123164918.GB6000@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel@lists.xensource.com, Andres Lagar-Cavilla , adin@gridncetric.ca List-Id: xen-devel@lists.xenproject.org On Wed, Nov 23, Keir Fraser wrote: > On 23/11/2011 16:49, "Olaf Hering" wrote: > > I'm not proposing to include my patch as is, because it has one issue: > > wake_up will start all waiting vcpus even if there is just a single slot > > free in the ringbuffer. You patch is better in this respect because only > > a few will be started again. > > Do you need a wake_up_one() function? I'm not sure. In case of paging, if gfn 1234 is missing, several vcpus may wait for it to come back. Other vcpus may wait for other gfns. So if we had a struct waitqueue_head for gfn 1234, and other individual gfns, that would help for this case. Since there cant be more gfns to wait for than the available guest vcpus, a list of waitqueue_head's with a gfn attached to it would work. If that sounds to crazy, or if I'm on the wrong track, how would you do that? (Perhaps I should prepare a patch to demonstrate what I mean.) Olaf