From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH V2] xen: Fix BUFIOREQ evtchn init for a stubdom. Date: Fri, 29 Jun 2012 12:04:50 +0100 Message-ID: References: <4FED9EB7020000780008CCF5@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4FED9EB7020000780008CCF5@nat28.tlf.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 , Anthony PERARD Cc: Xen Devel , Ian Campbell , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On 29/06/2012 11:25, "Jan Beulich" wrote: >>>> + { >>>> + spin_lock(&iorp->lock); >>>> + rc = hvm_replace_event_channel(v, a.value, >>>> + >>>> (int*)&v->domain->arch.hvm_domain.params[HVM_PARAM_BUFIOREQ_EVTCHN]); >>>> + spin_unlock(&iorp->lock); >>>> + if ( rc ) >>>> + break; >>>> } >>> >>> My first preference would be for this to be moved out of the >>> loop. If it has to remain in the loop for some reason, then the >>> next best option would be to move this into the iorp->lock >>> protected region immediately below. >> >> Agree on moving it out of the loop. But why would you want it protected by >> iorp->lock? > > That's a question to Anthony - I just saw that the same lock is > being used here and a few lines down. Ah, I see. It is not necessary to take the lock in the above code fragment. -- Keir > Jan >