Warning: mysqli::__construct(): (HY000/1203): User howardkn already has more than 'max_user_connections' active connections in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\includes\artfuncs.php on line 21
Failed to connect to MySQL: (1203) User howardkn already has more than 'max_user_connections' active connections
Warning: mysqli::query(): Couldn't fetch mysqli in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\index.php on line 66
Article <vbnfq0$2gpqh$1@dont-email.me>
Deutsch   English   Français   Italiano  
<vbnfq0$2gpqh$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!npeer.as286.net!dummy01.as286.net!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jseigh <jseigh_es00@xemaps.com>
Newsgroups: comp.arch
Subject: Re: arm ldxr/stxr vs cas
Date: Mon, 9 Sep 2024 14:46:24 -0400
Organization: A noiseless patient Spider
Lines: 82
Message-ID: <vbnfq0$2gpqh$1@dont-email.me>
References: <vb4sit$2u7e2$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 09 Sep 2024 20:46:24 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="d6af3082230c956f911d769df929906d";
	logging-data="2647889"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX188aZBNcc2n/2m69aLczd4Z"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:nMCY9uC9D7I5b/flY2Rp5FpOxAc=
In-Reply-To: <vb4sit$2u7e2$1@dont-email.me>
Content-Language: en-US
Bytes: 3937

Some testing of the effects of backoff on contention.

$ lscpu -e
CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE    MAXMHZ   MINMHZ       MHZ
   0    0      0    0 0:0:0:0          yes 3400.0000 400.0000  799.9840
   1    0      0    1 1:1:1:0          yes 3400.0000 400.0000 2296.7949
   2    0      0    2 2:2:2:0          yes 3400.0000 400.0000  712.2160
   3    0      0    3 3:3:3:0          yes 3400.0000 400.0000 1574.7550
   4    0      0    0 0:0:0:0          yes 3400.0000 400.0000  799.9760
   5    0      0    1 1:1:1:0          yes 3400.0000 400.0000 2600.7561
   6    0      0    2 2:2:2:0          yes 3400.0000 400.0000 2599.2959
   7    0      0    3 3:3:3:0          yes 3400.0000 400.0000  400.0000

so 4 cores, 2 threads / core

The options
  -n #enqueues per producer
  -p #producers
  -c #consumers
  -b backoff if > 0
  -f 0 linear backoff 1 exponential backoff
  -t queue type mpmc,spsc, spmc, mpsc   default mpmc

taskset used to specify which cpus to run on.
There is a lot more stats being outputed but I'm
just showing the overall rate.

$ taskset -c 0-7 test/lfrbtest -n 4000000 -p6 -c2 -f 0 -b 0
   overall rate = 5,988,679.5093 /sec

$ taskset -c 0-3 test/lfrbtest -n 4000000 -p6 -c2 -f 0 -b 0
   overall rate = 7,206,319.9145 /sec

$ taskset -c 0-7 test/lfrbtest -n 4000000 -p6 -c2 -f 1 -b 12
   overall rate = 7,243,427.7786 /sec

$ taskset -c 0-3 test/lfrbtest -n 4000000 -p6 -c2 -f 1 -b 12
   overall rate = 8,722,397.3449 /sec

$ taskset -c 3 test/lfrbtest -n 4000000 -p6 -c2 -f 1 -b 12
   overall rate = 19,950,919.8062 /sec

Some more threads than cpus timings ...

$ taskset -c 0-7 test/lfrbtest -n 1000000 -p24 -c8 -f 1 -b 0
   overall rate = 6,454,866.9162 /sec

$ taskset -c 0-7 test/lfrbtest -n 1000000 -p24 -c8 -f 1 -b 12
   overall rate = 7,350,906.2839 /sec

Some 1 producer 1 consumer timings ... (no contention so backoff setting
has no effect)

$ taskset -c 3,4 test/lfrbtest -n 10000000 -p1 -c1 -f 1 -b 0
   overall rate = 15,329,272.1370 /sec

$ taskset -c 3,4 test/lfrbtest -n 10000000 -p1 -c1 -f 1 -b 12
   overall rate = 15,063,074.6140 /sec

$ taskset -c 3 test/lfrbtest -n 10000000 -p1 -c1 -f 1 -b 0
   overall rate = 19,983,735.6372 /sec

$ taskset -c 3 test/lfrbtest -n 10000000 -p1 -c1 -f 1 -b 12
   overall rate = 19,935,213.3078 /sec

$ taskset -c 3 test/lfrbtest -n 10000000 -p1 -c1 -f 1 -b 12 -x n
   overall rate = 32,921,077.1692 /sec

$ taskset -c 2,3 test/lfrbtest -n 10000000 -p1 -c1 -f 1 -b 12 -t spsc
   overall rate = 38,620,404.6845 /sec

  $ taskset -c 3 test/lfrbtest -n 10000000 -p1 -c1 -f 1 -b 12 -t spsc
    overall rate = 109,891,021.6233 /sec

This is producer and consumer running on same thread so no thread
switching overhead

$ taskset -c 3 test/lfrbtest -n 10000000 -p1 -c1 -f 1 -b 12 -x n -t spsc
   overall rate = 146,941,972.2478 /sec

Joe Seigh