[Bug 1162291] New: Inexplicable multithreading behaviour
http://bugzilla.opensuse.org/show_bug.cgi?id=1162291 Bug ID: 1162291 Summary: Inexplicable multithreading behaviour Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: x86-64 OS: SUSE Other Status: NEW Severity: Normal Priority: P5 - None Component: Kernel Assignee: kernel-maintainers@forge.provo.novell.com Reporter: juergen-fuhrmann@web.de QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- Created attachment 828734 --> http://bugzilla.opensuse.org/attachment.cgi?id=828734&action=edit MWE for testing multithreading performance. I am trying out threading performance in C++/OpenMP and Julia. On a 6 core 32GB RAM Dell Precision 7540 laptop with Tumbleweed (kernel 5.4.10), multithreading speed up unexpectedly significantly decreases with problem size. I attach the test program to be compiled with g++ -Ofast -fopenmp threads.cxx -o threads Usage is threads N nrepeat Problem size aka array length aka loop range size can be given as the command line parameter N. nrepeat is the number of repeats of the measurment (to allow watching CPU usage) The typical output is as follows: $threads 100000 1 nthreads=4 scalar=0.004519, para=0.001273, speedup=3.550611 I get 400% CPU usage in top (when setting nrepeat to 100000) $threads 100000 1 nthreads=4 scalar=0.056637, para=0.046533, speedup=1.217147 In this case CPU usage in top is limited to 266% I observe this behavior with g++-10 g++-7 julia 1.3.1 (with a similar test program) I don't observe this behavior on a compute server with Leap 5.10, kernel 4.12.14 and g++-7: $threads 100000 1 nthreads=4 scalar=0.008033, para=0.002451, speedup=3.278010 $threads 1000000 1 nthreads=4 scalar=0.069559, para=0.021247, speedup=3.273745 When I copy the executable from the server to the laptop I get the same results as for the executable compiled on the laptop. I suspect this to be a problem with thread scheduling, memory management or something related. And yes, mitigations are already off, and hyperthreading is on (though I don't use it here). Jürgen -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1162291 Jürgen Fuhrmann <juergen-fuhrmann@web.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |juergen-fuhrmann@web.de -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1162291 http://bugzilla.opensuse.org/show_bug.cgi?id=1162291#c1 --- Comment #1 from Jürgen Fuhrmann <juergen-fuhrmann@web.de> --- Created attachment 828801 --> http://bugzilla.opensuse.org/attachment.cgi?id=828801&action=edit Output of lscpu and lsmem for Dell Precision 7540 -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1162291 http://bugzilla.opensuse.org/show_bug.cgi?id=1162291#c2 --- Comment #2 from Jürgen Fuhrmann <juergen-fuhrmann@web.de> --- Hi, in order to discriminate from a possible hardware problem I booted into KDE 15.1 live with Kernel 4.12 and run the example under g++-7. It shows the same problem with poor omp performance for larger vectors. Therefore I now think it is a problem with my laptop hardware and no Linux component is to blame. Unless there is similar experience with (this) hardware and someone can give me a hint which parameters could be tuned to fix the problem, this report can be closed. I attach the output of lscpu and lsmem. Jürgen -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1162291 http://bugzilla.opensuse.org/show_bug.cgi?id=1162291#c3 --- Comment #3 from Jürgen Fuhrmann <juergen-fuhrmann@web.de> --- Well, it's the memory bandwith, stupid... What we observe appears to be essentially the performance drop on the way from 10^5 to 10^6 unknwons which one can also see in Georg Hagers blog: https://blogs.fau.de/hager/archives/6883 So this can be closed. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1162291 http://bugzilla.opensuse.org/show_bug.cgi?id=1162291#c4 Jürgen Fuhrmann <juergen-fuhrmann@web.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FEATURE --- Comment #4 from Jürgen Fuhrmann <juergen-fuhrmann@web.de> --- Resolved: see previous comment: its a memory bandwith problem. -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com