[Bug 1420845] Comment bridged from LTC Bugzilla
bugproxy
bugproxy at us.ibm.com
Tue Feb 24 16:49:41 UTC 2015
------- Comment From aravam at us.ibm.com 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
Foundations Bugs, which is subscribed to powerpc-utils in Ubuntu.
https://bugs.launchpad.net/bugs/1420845
Title:
ppc64_cpu --frequency fails with sched_setaffinity: Invalid argument
Status in powerpc-utils package in Ubuntu:
New
Bug description:
---Problem Description---
ppc64_cpu --frequency does not work in Ubuntu 15.04
---uname output---
Linux lep8d 3.18.0-11-generic #12-Ubuntu SMP Fri Jan 23 22:45:52 UTC 2015 ppc64le ppc64le ppc64le GNU/Linux
Machine Type = P8
---Steps to Reproduce---
Install Ubuntu 15.04 DVD on a local hard disk. Then execute the below command to determine the cpu frequency.
root at lep8d:~# ppc64_cpu --frequency
sched_setaffinity: Invalid argument
root at lep8d:~# echo $?
1
root at lep8d:~# lsmcode
Version of System Firmware is FW830.00 (TV830_015) (t) FW830.00 (TV830_014) (p) FW830.00 (TV830_015) (b)
root at lep8d:~# update_flash -d
Current firwmare version :
P side : FW830.00 (TV830_014)
T side : FW830.00 (TV830_015)
Boot side : FW830.00 (TV830_015)
root at lep8d:~#
> The behavior is not consistent. Some times the command fails while in other
> cases returns success and displays proper information
>
> Even with 3.18.0-12-generic I can recreate this failure.
>
> root at lop824:/home/sachin/dlpar# ppc64_cpu --frequency
> sched_setaffinity: Invalid argument
> sched_setaffinity: Invalid argument
> root at lop824:/home/sachin/dlpar# uname -a
> Linux lop824 3.18.0-12-generic #13-Ubuntu SMP Thu Jan 29 13:44:26 UTC 2015
> ppc64le ppc64le ppc64le GNU/Linux
> root at lop824:/home/sachin/dlpar#
>
> The other behavior I have observed is first time the command display error
> message twice. On subsequent invocation the same message is displayed only
> once.
>
> root at lop824:/home/sachin/dlpar# ppc64_cpu --frequency
> sched_setaffinity: Invalid argument
> root at lop824:/home/sachin/dlpar# ppc64_cpu --frequency
> sched_setaffinity: Invalid argument
> root at lop824:/home/sachin/dlpar# ppc64_cpu --frequency
> sched_setaffinity: Invalid argument
> root at lop824:/home/sachin/dlpar# ppc64_cpu --frequency
> sched_setaffinity: Invalid argument
> root at lop824:/home/sachin/dlpar
I ran in a tight loop and didn't see this once. What else is going on
when you are doing this?
Can you, next time, run under strace and save a log of the output
(strace -f -o log ppc64_cpu --frequency)?
-Nish
I ran few CPU hotplug tests before executing this command.
> Can you, next time, run under strace and save a log of the output (strace -f
> -o log ppc64_cpu --frequency)?
I have already attached strace log in comment #3.
I have captured the log again and have attached here.
root at lep8d:~# strace -f -o strace-ppc64_cpu.log ppc64_cpu --frequency
sched_setaffinity: Invalid argument
sched_setaffinity: Invalid argument
sched_setaffinity: Invalid argument
sched_setaffinity: Invalid argument
sched_setaffinity: Invalid argument
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/powerpc-utils/+bug/1420845/+subscriptions
More information about the foundations-bugs
mailing list