From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCH 03/12] xen/events: remove unnecessary init_evtchn_cpu_bindings() Date: Wed, 20 Mar 2013 13:20:21 +0000 Message-ID: <5149B795.6020209@citrix.com> References: <1363727099-25519-1-git-send-email-david.vrabel@citrix.com> <1363727099-25519-4-git-send-email-david.vrabel@citrix.com> <5149A6E702000078000C71EF@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5149A6E702000078000C71EF@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 Cc: "Keir (Xen.org)" , Konrad Rzeszutek Wilk , Wei Liu , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On 20/03/13 11:09, Jan Beulich wrote: >>>> On 19.03.13 at 22:04, David Vrabel wrote: >> From: David Vrabel >> >> Event channels are always explicitly bound to a specific VCPU before >> they are first enabled. There is no need to initialize all possible >> events as bound to VCPU 0 at start of day or after a resume. > > That part may indeed be safe to do, but ... > >> --- a/drivers/xen/events.c >> +++ b/drivers/xen/events.c >> @@ -333,24 +333,6 @@ static void bind_evtchn_to_cpu(unsigned int chn, >> unsigned int cpu) >> info_for_irq(irq)->cpu = cpu; >> } >> >> -static void init_evtchn_cpu_bindings(void) >> -{ >> - int i; >> -#ifdef CONFIG_SMP >> - struct irq_info *info; >> - >> - /* By default all event channels notify CPU#0. */ >> - list_for_each_entry(info, &xen_irq_list_head, list) { >> - struct irq_desc *desc = irq_to_desc(info->irq); >> - cpumask_copy(desc->irq_data.affinity, cpumask_of(0)); >> - } >> -#endif >> - >> - for_each_possible_cpu(i) >> - memset(per_cpu(cpu_evtchn_mask, i), >> - (i == 0) ? ~0 : 0, sizeof(*per_cpu(cpu_evtchn_mask, i))); > > ... you also remove the initialization of the mask bits here. If > that was intended, a sentence about the safety of this would > certainly be good to add to the description. These are similarly initialized when an event is bound to a VCPU. Note that cpu_evtchn_mask is poorly named as it's really the inverse of a mask. I'll extend the commit message to mention this. David