On Fri, Dec 7, 2018 at 8:51 AM Florian Weimer wrote: > > * H. J. Lu: > > > +* The getcpu wrapper function has been added, which returns currently > > + used CPU and NUMA node. This function is Linux-specific. > > “returns the currently used” (not sure)? Fixed. > > diff --git a/sysdeps/unix/sysv/linux/tst-skeleton-affinity.c b/sysdeps/unix/sysv/linux/tst-skeleton-affinity.c > > index 695c1ccdbd..fd1357beb1 100644 > > --- a/sysdeps/unix/sysv/linux/tst-skeleton-affinity.c > > +++ b/sysdeps/unix/sysv/linux/tst-skeleton-affinity.c > > @@ -165,6 +165,18 @@ test_size (const struct conf *conf, size_t size) > > for (int cpu = 0; cpu <= conf->last_cpu; ++cpu) > > { > > int active_cpu = sched_getcpu (); > > + unsigned int numa_cpu, numa_node; > > + if (getcpu (&numa_cpu, &numa_node)) > > != NULL I changed to if (getcpu (&numa_cpu, &numa_node) != 0) since getcpu returns int. > > + { > > + printf ("error: getcpu: %m\n"); > > + return false; > > Okay, ENOSYS is a hard error here because we have checked for a working > sched_getcpu. > > > + } > > + if ((unsigned int) active_cpu != numa_cpu) > > + { > > + printf ("error: Unexpected CPU %d, expected %d\n", > > + active_cpu, numa_cpu); > > + return false; > > + } > > if (last_active_cpu >= 0 && last_active_cpu != active_cpu) > > I think you need to move the getcpu call and this check down further, > after the setaffinity call with a single-element CPU set. > Done. Here is the updated patch. OK for master? Thanks. -- H.J.