------- Comment From [email protected] 2015-02-24 16:47 EDT-------
Relevant bits of ppc64_cpu:
static void *soak(void *arg)
{
unsigned int cpu = (long)arg;
cpu_set_t cpumask;
CPU_ZERO(&cpumask);
CPU_SET(cpu, &cpumask);
if (sched_setaffinity(0, sizeof(cpumask), &cpumask)) {
perror("sched_setaffinity");
exit(1);
}
while (1)
; /* Do Nothing */
}
/* Start a soak thread on each CPU */
for (i = 0; i < threads_in_system; i++) {
pthread_t tid;
if (!cpu_online(i)) {
cpu_freq[i] = CPU_OFFLINE;
continue;
}
if (pthread_create(&tid, NULL, soak, (void *)(long)i)) {
perror("pthread_create");
return -1;
}
}
So if cpus are offline, they should be ignored.
Are you doing CPU hotplug *while* running this script? Seems like that
could easily break things (no locking that I can see).
Nathan, since this is running in a pthread, and there is error checking
later:
if (cpu_freq[i] == CPU_OFFLINE)
continue;
/* No result - Couldn't schedule on that cpu */
if (cpu_freq[i] == 0) {
printf("WARNING: couldn't run on cpu %d\n", i);
continue;
}
can soak() just return if sched_setaffinity fails rather than
exit()'ing?
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1420845
Title:
ppc64_cpu --frequency fails with sched_setaffinity: Invalid argument
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/powerpc-utils/+bug/1420845/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs