xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Julien Grall <julien.grall@linaro.org>,
	Anup Patel <anup.patel@linaro.org>
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	patches <patches@apm.com>, xen-devel <xen-devel@lists.xen.org>,
	"stefano.stabellini" <stefano.stabellini@citrix.com>,
	Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
Subject: Re: [PATCH] xen/arm: minor improvement in smp_send_call_function_mask()
Date: Thu, 21 Aug 2014 18:22:03 +0100	[thread overview]
Message-ID: <53F62ABB.6080203@citrix.com> (raw)
In-Reply-To: <53F62455.2030906@linaro.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

      reply	other threads:[~2014-08-21 17:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-19  4:48 [PATCH] xen/arm: minor improvement in smp_send_call_function_mask() Anup Patel
2014-08-19 21:06 ` Julien Grall
2014-08-20  6:14   ` Anup Patel
2014-08-20 15:07     ` Julien Grall
2014-08-21 11:04       ` Anup Patel
2014-08-21 16:54         ` Julien Grall
2014-08-21 17:22           ` Andrew Cooper [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53F62ABB.6080203@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=anup.patel@linaro.org \
    --cc=julien.grall@linaro.org \
    --cc=patches@apm.com \
    --cc=pranavkumar@linaro.org \
    --cc=stefano.stabellini@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).