Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1166322 > unrolled thread

Re: [PATCH 01/10] cpumask: Introduce cpumask_any_online_but

Started byVikas Shivappa <vikas.shivappa@intel.com>
First post2015-06-16 21:10 +0200
Last post2015-06-16 21:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 01/10] cpumask: Introduce cpumask_any_online_but Vikas Shivappa <vikas.shivappa@intel.com> - 2015-06-16 21:10 +0200

#1166322 — Re: [PATCH 01/10] cpumask: Introduce cpumask_any_online_but

FromVikas Shivappa <vikas.shivappa@intel.com>
Date2015-06-16 21:10 +0200
SubjectRe: [PATCH 01/10] cpumask: Introduce cpumask_any_online_but
Message-ID<pC4pc-32i-17@gated-at.bofh.it>

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/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web