From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] xen/arm: minor improvement in smp_send_call_function_mask() Date: Thu, 21 Aug 2014 18:22:03 +0100 Message-ID: <53F62ABB.6080203@citrix.com> References: <1408423704-15059-1-git-send-email-anup.patel@linaro.org> <53F3BC41.5040409@linaro.org> <53F4B9B4.5090303@linaro.org> <53F62455.2030906@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53F62455.2030906@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall , Anup Patel Cc: Ian Campbell , Stefano Stabellini , patches , xen-devel , "stefano.stabellini" , Pranavkumar Sawargaonkar List-Id: xen-devel@lists.xenproject.org On 21/08/14 17:54, Julien Grall wrote: > Hi Anup, > > On 21/08/14 06:04, Anup Patel wrote: >>> The best alternative would be cpumask_empty. >> >> All three cpumask_empty(), cpumask_first(), and cpumask_weight() >> are O(N) where N is number of bits in cpumask. >> It really does not make much difference which of these operation >> is chosen. They are all O(N), but O() notation hides lesser factors. cpumask_empty() is slightly cheaper than cpumask_first(), which are both substantially cheaper than cpumask_weight(). There is no fastpath for calculating the hamming weight of 0, resulting in a lot of dependent shift/mask operations. ~Andrew