Samuel Thibault, on jeu. 28 déc. 2017 15:08:30 +0100, wrote:
> Samuel Thibault, on mer. 20 déc. 2017 18:32:48 +0100, wrote:
> > I have uploaded it to debian experimental, so when it passes NEW,
> > various arch test results will show up on 
> > 
> >
> > 
> > so you can check the results on odd systems :)
> FI, the failure on m68k is due to a bug in qemu's linux-user emulation,
> which I'm currently fixing.

There is however an issue with the hwloc_get_last_cpu_location test when
run inside qemu's linux-user emulation, because in that case qemu
introduces a thread for its own purposes in addition to the normal
thread, and then the test looks like this:

I'm tid 15573
trying 0x00000003 1
setaffinity 15573 3 gave 0
setaffinity 15606 3 gave 0
getting last location for 15573
got 0
getting last location for 15606
got 2
got 0x00000005
hwloc_get_last_cpu_location: hwloc_get_last_cpu_location.c:38: check: Assertion 
`hwloc_bitmap_isincluded(last, set)' failed.

I.e. when trying check(set, HWLOC_CPUBIND_PROCESS);, the
hwloc_set_cpubind() call does bind the two threads of the process, and
then looks for the CPU locations of the two threads, but probably thread
15606 didn't actually run in between, and thus the last CPU location is
still with the old binding, and that fails the assertion.

Of course, in the Debian package I could patch over this test to ignore
the failure, possibly by blacklisting architectures which are known to
be built inside qemu, but it could pose problem more generally. Perhaps
we should use the attached patch, to try to check inclusion only from
the result of the current-thread-only method?

diff --git a/tests/hwloc/hwloc_get_last_cpu_location.c 
index 03ab103b..15f2fb00 100644
--- a/tests/hwloc/hwloc_get_last_cpu_location.c
+++ b/tests/hwloc/hwloc_get_last_cpu_location.c
@@ -27,6 +27,13 @@ static int check(hwloc_const_cpuset_t set, int flags)
   ret = hwloc_get_last_cpu_location(topology, last, flags);
+  if (support->cpubind->get_thisthread_last_cpu_location)
+    ret = hwloc_get_last_cpu_location(topology, last, HWLOC_CPUBIND_THREAD);
+  else
+    ret = hwloc_get_last_cpu_location(topology, last, 0);
+  assert(!ret);
+  assert(!hwloc_bitmap_iszero(last));
   assert(hwloc_bitmap_isincluded(last, set));
hwloc-devel mailing list

Reply via email to