From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCHv1] xen/evtchn: dynamically grow pending event channel ring Date: Thu, 26 Nov 2015 19:07:22 +0000 Message-ID: <5657586A.5090705@citrix.com> References: <1448554475-25754-1-git-send-email-david.vrabel@citrix.com> <56575429.5000601@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1a21tB-0001Mx-Cx for xen-devel@lists.xenproject.org; Thu, 26 Nov 2015 19:07:29 +0000 In-Reply-To: <56575429.5000601@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper , David Vrabel , xen-devel@lists.xenproject.org Cc: Boris Ostrovsky List-Id: xen-devel@lists.xenproject.org On 26/11/15 18:49, Andrew Cooper wrote: > On 26/11/15 16:14, David Vrabel wrote: >> If more than 1024 event channels are bound to a evtchn device then it >> possible (even with well behaved applications) for the ring to >> overflow and events to be lost (reported as an -EFBIG error). >> >> Dynamically increase the size of the ring so there is always enough >> space for all bound events. Well behaved applicables that only unmask >> events after draining them from the ring can thus no longer lose >> events. >> >> However, an application could unmask an event before draining it, >> allowing multiple entries per port to accumulate in the ring, and a >> overflow could still occur. So the overflow detection and reporting >> is retained. >> >> The ring size is initially only 64 entries so the common use case of >> an application only binding a few events will use less memory than >> before. The ring size may grow to 512 KiB (enough for all 2^17 >> possible channels). This order 7 kmalloc() may fail due to memory >> fragmentation, so we fall back to trying vmalloc(). >> >> Signed-off-by: David Vrabel > > Reviewed-by: Andrew Cooper Applied to for-linus-4.4, thanks. David