Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1166322
| Path | csiph.com!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Vikas Shivappa <vikas.shivappa@intel.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 01/10] cpumask: Introduce cpumask_any_online_but |
| Date | Tue, 16 Jun 2015 21:10:02 +0200 |
| Message-ID | <pC4pc-32i-17@gated-at.bofh.it> (permalink) |
| References | <pABSh-5cu-3@gated-at.bofh.it> <pABSh-5cu-5@gated-at.bofh.it> <pBBQd-3qS-7@gated-at.bofh.it> <pBFTR-RJ-29@gated-at.bofh.it> <pBUpR-5cG-29@gated-at.bofh.it> |
| X-Original-To | Thomas Gleixner <tglx@linutronix.de> |
| X-Extloop1 | 1 |
| X-Ironport-Av | E=Sophos;i="5.13,627,1427785200"; d="scan'208";a="509341940" |
| X-X-Sender | vikas@vshiva-Udesk |
| User-Agent | Alpine 2.10 (DEB 1266 2009-07-14) |
| MIME-Version | 1.0 |
| Content-Type | TEXT/PLAIN; format=flowed; charset=US-ASCII |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 45 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Vikas Shivappa <vikas.shivappa@intel.com>, Peter Zijlstra <peterz@infradead.org>, Vikas Shivappa <vikas.shivappa@linux.intel.com>, linux-kernel@vger.kernel.org, x86@kernel.org, hpa@zytor.com, mingo@kernel.org, Matt Fleming <matt.fleming@intel.com>, "Juvva, Kanaka D" <kanaka.d.juvva@intel.com>, "Williamson, Glenn P" <glenn.p.williamson@intel.com>, "Auld, Will" <will.auld@intel.com> |
| X-Original-Date | Tue, 16 Jun 2015 12:00:46 -0700 (PDT) |
| X-Original-Message-ID | <alpine.DEB.2.10.1506161129140.32420@vshiva-Udesk> |
| X-Original-References | <1434133037-25189-1-git-send-email-vikas.shivappa@linux.intel.com> <1434133037-25189-2-git-send-email-vikas.shivappa@linux.intel.com> <20150615123614.GA3644@twins.programming.kicks-ass.net> <alpine.DEB.2.10.1506150945540.3447@vshiva-Udesk> <alpine.DEB.2.11.1506161018210.4120@nanos> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | aioe.org linux.kernel:1166322 |
Show key headers only | View raw
On Tue, 16 Jun 2015, Thomas Gleixner wrote: > On Mon, 15 Jun 2015, Vikas Shivappa wrote: >> On Mon, 15 Jun 2015, Peter Zijlstra wrote: >>> On Fri, Jun 12, 2015 at 11:17:08AM -0700, Vikas Shivappa wrote: >>>> + cpumask_and(&tmp, cpu_online_mask, mask); >>>> + cpumask_clear_cpu(cpu, &tmp); >>>> + return cpumask_any(&tmp); >>>> +} >>> >>> You had a good example in cpumask_any_but() copy that. >> >> I saw the cpumask_any_but but wanted to avoid the for loop in the >> cpumask_any_but , but now i see why from your previous comment. Without the >> cpumask_t I will have to use the cpumask_any_but .. the two were related. > > It can be done w/o a loop. Hint, you need a static cpumask in your > code anyway. Ah thats right, I always need the tmp mask. Confused this with avoiding the cpumask_clear_cpu line in the code vs. using cpumask_any_but. something like this just making it static then ? static cpumask_t tmp; cpumask_and(&tmp, cpu_online_mask, mask); cpumask_clear_cpu(cpu, &tmp); return cpumask_any(&tmp); Thanks, Vikas > > Thanks > > tglx > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
Re: [PATCH 01/10] cpumask: Introduce cpumask_any_online_but Vikas Shivappa <vikas.shivappa@intel.com> - 2015-06-16 21:10 +0200
csiph-web