Count the number of physical CPUs too
This commit is contained in:
parent
2c09e40c44
commit
266b1638d4
@ -297,8 +297,12 @@ init_global_indices(struct system *sys)
|
||||
thread_set_gindex(t, sys->nthreads++);
|
||||
|
||||
sys->ncpus = 0;
|
||||
for (struct cpu *c = sys->cpus; c; c = c->next)
|
||||
sys->nphycpus = 0;
|
||||
for (struct cpu *c = sys->cpus; c; c = c->next) {
|
||||
cpu_set_gindex(c, sys->ncpus++);
|
||||
if (!c->is_virtual)
|
||||
sys->nphycpus++;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -27,6 +27,7 @@ struct system {
|
||||
size_t nthreads;
|
||||
size_t nprocs;
|
||||
size_t ncpus; /* Including virtual cpus */
|
||||
size_t nphycpus;
|
||||
|
||||
struct loom *looms;
|
||||
struct proc *procs;
|
||||
|
Loading…
Reference in New Issue
Block a user