From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCHv3 5/6] evtchn: remove the locking when unmasking an event channel Date: Thu, 18 Jun 2015 12:36:58 +0100 Message-ID: <5582AD5A.3000007@citrix.com> References: <1434542583-28073-1-git-send-email-david.vrabel@citrix.com> <1434542583-28073-6-git-send-email-david.vrabel@citrix.com> <5582C80B0200007800086948@mail.emea.novell.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 1Z5Y80-00035w-Nn for xen-devel@lists.xenproject.org; Thu, 18 Jun 2015 11:37:11 +0000 In-Reply-To: <5582C80B0200007800086948@mail.emea.novell.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: Jan Beulich Cc: xen-devel@lists.xenproject.org, Keir Fraser , Ian Campbell , Tim Deegan List-Id: xen-devel@lists.xenproject.org On 18/06/15 12:30, Jan Beulich wrote: >>>> On 17.06.15 at 14:03, wrote: >> --- a/xen/common/event_channel.c >> +++ b/xen/common/event_channel.c >> @@ -978,8 +978,6 @@ int evtchn_unmask(unsigned int port) >> struct domain *d = current->domain; >> struct evtchn *evtchn; >> >> - ASSERT(spin_is_locked(&d->event_lock)); >> - >> if ( unlikely(!port_is_valid(d, port)) ) >> return -EINVAL; >> >> @@ -1146,9 +1144,7 @@ long do_event_channel_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg) >> struct evtchn_unmask unmask; >> if ( copy_from_guest(&unmask, arg, 1) != 0 ) >> return -EFAULT; >> - spin_lock(¤t->domain->event_lock); >> rc = evtchn_unmask(unmask.port); >> - spin_unlock(¤t->domain->event_lock); > > And, looking particularly at evtchn_fifo_unmask() (and its descendant > evtchn_fifo_set_pending()), you get away without acquiring the port > lock in or around evtchn_port_unmask()? If indeed so, this one would > again be independent on 1, 2, and 4, i.e. could go in together with 3. Yes. This is only dependent on #3 (simplify port_is_valid()). David