Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1365947
| From | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v5 2/6] hwmon: (fam15h_power) Add compute unit accumulated power |
| Date | 2016-03-29 09:40 +0200 |
| Message-ID | <rhWpP-2Nj-11@gated-at.bofh.it> (permalink) |
| References | <rhBbH-4sP-5@gated-at.bofh.it> <rhBOq-50t-15@gated-at.bofh.it> <rhBOq-50t-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, Mar 28, 2016 at 11:29:52AM +0200, Borislav Petkov wrote:
> I think you want something like this: iterate over each core and put one
> of them into the mask.
>
> core = -1;
>
> for_each_online_cpu(cpu) {
> this_core = topology_core_id(cpu);
>
> if (this_core == core)
> continue;
>
> core = this_core;
>
> /* get any CPU on this compute unit */
> cpumask_set_cpu(cpumask_any(topology_sibling_cpumask(cpu)), mask);
> }
This will not in fact work for Intel, nor if I manage to one day
randomize our CPU numbers on AMD.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH v5 2/6] hwmon: (fam15h_power) Add compute unit accumulated power Borislav Petkov <bp@alien8.de> - 2016-03-28 11:40 +0200
Re: [PATCH v5 2/6] hwmon: (fam15h_power) Add compute unit accumulated power Peter Zijlstra <peterz@infradead.org> - 2016-03-29 09:40 +0200
Re: [PATCH v5 2/6] hwmon: (fam15h_power) Add compute unit accumulated power Borislav Petkov <bp@alien8.de> - 2016-03-29 10:00 +0200
csiph-web