From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCH 08/13] xen: dynamically allocate cpu_evtchn_mask Date: Fri, 1 Feb 2013 11:29:32 +0000 Message-ID: <510BA71C.7030303@citrix.com> References: <1359643627-29486-1-git-send-email-wei.liu2@citrix.com> <1359643627-29486-9-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1359643627-29486-9-git-send-email-wei.liu2@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: Wei Liu Cc: "konrad.wilk@oracle.com" , Ian Campbell , "jbeulich@suse.com" , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On 31/01/13 14:47, Wei Liu wrote: > Signed-off-by: Wei Liu > --- > drivers/xen/events.c | 21 ++++++++++++++++++--- > 1 file changed, 18 insertions(+), 3 deletions(-) > > diff --git a/drivers/xen/events.c b/drivers/xen/events.c > index 4820a52..30ca620 100644 > --- a/drivers/xen/events.c > +++ b/drivers/xen/events.c [...] > + for_each_possible_cpu(cpu) { > + void *p; > + unsigned int nr = nr_event_channels / BITS_PER_LONG; > + > + p = kzalloc_node(sizeof(unsigned long) * nr, > + GFP_KERNEL, > + cpu_to_node(cpu)); > + if (!p) > + p = kzalloc(sizeof(unsigned long) * nr, > + GFP_KERNEL); kzalloc_node() will fallback to allocating from other nodes, no need to try as well. David