* Re: [Cocci] [PATCH v2] scripts: coccicheck: Change default value for parallelism
[not found] <7733e0b3-91f2-0033-75d6-77947253bfeb@web.de>
@ 2020-08-14 13:29 ` Greg Kroah-Hartman
0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2020-08-14 13:29 UTC (permalink / raw)
To: Markus Elfring
Cc: Michal Marek, Gilles Muller, Nicolas Palix, kernel-janitors,
linux-kernel, Julia Lawall, Coccinelle
On Fri, Aug 14, 2020 at 03:06:06PM +0200, Markus Elfring wrote:
> > a decrease in performance is noted. The elapsed time is minimum
>
> Can the following wording variant be more appropriate?
>
> a decrease was noticed in the software performance. The elapsed time is minimal
>
>
> > respectively for two separate runs. …
>
> Can such information trigger further considerations for benchmarking approaches?
>
> Regards,
> Markus
Hi,
This is the semi-friendly patch-bot of Greg Kroah-Hartman.
Markus, you seem to have sent a nonsensical or otherwise pointless
review comment to a patch submission on a Linux kernel developer mailing
list. I strongly suggest that you not do this anymore. Please do not
bother developers who are actively working to produce patches and
features with comments that, in the end, are a waste of time.
Patch submitter, please ignore Markus's suggestion; you do not need to
follow it at all. The person/bot/AI that sent it is being ignored by
almost all Linux kernel maintainers for having a persistent pattern of
behavior of producing distracting and pointless commentary, and
inability to adapt to feedback. Please feel free to also ignore emails
from them.
thanks,
greg k-h's patch email bot
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Cocci] [PATCH V2] scripts: coccicheck: Change default value for parallelism
@ 2020-08-14 12:45 Sumera Priyadarsini
0 siblings, 0 replies; 2+ messages in thread
From: Sumera Priyadarsini @ 2020-08-14 12:45 UTC (permalink / raw)
To: Julia.Lawall
Cc: michal.lkml, Gilles.Muller, gregkh, nicolas.palix, linux-kernel, cocci
By default, coccicheck utilizes all available threads to implement
parallelisation. However, when all available threads are used,
a decrease in performance is noted. The elapsed time is minimum
when at most one thread per core is used.
For example, on benchmarking the semantic patch kfree.cocci for
usb/serial using hyperfine, the outputs obtained for J=5 and J=2
are 1.32 and 1.90 times faster than those for J=10 and J=9
respectively for two separate runs. For the larger drivers/staging
directory, minimium elapsed time is obtained for J=3 which is 1.86
times faster than that for J=12. The optimal J value does not
exceed 6 in any of the test runs. The benchmarks are run on a machine
with 6 cores, with 2 threads per core, i.e, 12 hyperthreads in all.
To improve performance, modify coccicheck to use at most only
one thread per core by default.
Signed-off-by: Sumera Priyadarsini <sylphrenadin@gmail.com>
---
scripts/coccicheck | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/scripts/coccicheck b/scripts/coccicheck
index e04d328210ac..dd228dcc915e 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -75,8 +75,17 @@ else
OPTIONS="--dir $KBUILD_EXTMOD $COCCIINCLUDE"
fi
+ # Use only one thread per core by default if hyperthreading is enabled
+ THREADS_PER_CORE=$(lscpu | grep "Thread(s) per core: " | tr -cd [:digit:])
if [ -z "$J" ]; then
NPROC=$(getconf _NPROCESSORS_ONLN)
+ if [ $THREADS_PER_CORE -gt 1 -a $NPROC -gt 2 ] ; then
+ if [ $NPROC -gt 8 ] ; then
+ NPROC=$((NPROC/4))
+ else
+ NPROC=$((NPROC/2))
+ fi
+ fi
else
NPROC="$J"
fi
--
2.17.1
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-08-14 13:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <7733e0b3-91f2-0033-75d6-77947253bfeb@web.de>
2020-08-14 13:29 ` [Cocci] [PATCH v2] scripts: coccicheck: Change default value for parallelism Greg Kroah-Hartman
2020-08-14 12:45 [Cocci] [PATCH V2] " Sumera Priyadarsini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).