2022-04-04
01:08chadmed has joined #asahi-re
01:30doggkruse has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
02:45doggkruse has joined #asahi-re
02:59phiologe has joined #asahi-re
03:03PhilippvK has quit [Ping timeout: 480 seconds]
04:42janithpet[m] has joined #asahi-re
05:05the_lanetly_052 has joined #asahi-re
06:05nicolas17 has quit [Ping timeout: 480 seconds]
06:11sven has quit [Remote host closed the connection]
06:11sven has joined #asahi-re
06:14doggkruse has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
07:46the_lanetly_052 has quit [Ping timeout: 480 seconds]
07:59the_lanetly_052 has joined #asahi-re
08:08the_lanetly_052 has quit [Ping timeout: 480 seconds]
08:23MajorBiscuit has joined #asahi-re
08:59alcazar has joined #asahi-re
10:35alcazar has quit [Ping timeout: 480 seconds]
10:45alcazar has joined #asahi-re
10:53alcazar has quit [Ping timeout: 480 seconds]
10:54alcazar has joined #asahi-re
11:02alcazar has quit [Ping timeout: 480 seconds]
11:04kameks has joined #asahi-re
11:11alcazar has joined #asahi-re
11:19alcazar has quit [Ping timeout: 480 seconds]
11:26pzcz has quit [Ping timeout: 480 seconds]
11:30alcazar has joined #asahi-re
11:38alcazar has quit [Ping timeout: 480 seconds]
11:46alcazar has joined #asahi-re
11:54alcazar has quit [Ping timeout: 480 seconds]
12:02jakebot has quit [Read error: Connection reset by peer]
12:02jakebot has joined #asahi-re
12:04alcazar has joined #asahi-re
12:12alcazar has quit [Ping timeout: 480 seconds]
12:19alcazar has joined #asahi-re
12:28alcazar has quit [Ping timeout: 480 seconds]
12:35YichaoYu[m]I noticed that a failed cas instruction seems to be about 2-10x slower than successful ones, depending on the memory order on the m1. And I don't see this on intel.
12:36YichaoYu[m]it also generates many more counts on the counters that I suspect related to uops issued.
12:37alcazar has joined #asahi-re
12:37YichaoYu[m]I don't really know how people implement atomics these days but is it possible that these atomic operations are actually ucoded and internally it's still using something similar to llsc?
12:38YichaoYu[m]and this difference is especially pronouced with more relaxed ordering, and especially on the P cores
12:40TellowKrinkle[m]I remember seeing on the Swift forums that Apple CPUs have no performance penalty for uncontested atomic refcounting (which Swift used CAS for), so they definitely optimized the success case
12:40TellowKrinkle[m]Whether that was to the detriment of the failure case I don't know
12:41YichaoYu[m]note that I'm talking about single thread here
12:41YichaoYu[m]I was basically doing a cas with the wrong compare value with no contention.
12:42YichaoYu[m]and yes, successful weak ordering cas is really cheap
12:43YichaoYu[m]yes when I cross-checked it in julia, and for my original test it's hand written assembly
12:43YichaoYu[m]asm here https://github.com/yuyichao/m1_pmu_test/blob/cf4fbcc3e740e258339637c64062385a140c666b/src/libtests_atomic.s#L241-L246
12:43_jannau_the first will give you load/store exclusive atomics the later has explicit atomic instructions
12:44YichaoYu[m]and the fail case ~20 lines below
12:44YichaoYu[m](hand writen -> script generated...)
12:45alcazar has quit [Ping timeout: 480 seconds]
12:47YichaoYu[m]for a successful relaxed ordered cas with no contention, the loop takes 3 cycles on the P core (compared to ~1 cycle if it was a simple store).
12:47YichaoYu[m]if the comparison failed, still with no contention, it takes 58 cycles per loop on the p core
12:48alcazar has joined #asahi-re
12:51YichaoYu[m]on a related note, a failed cas does generate a count on the counter where a failed stxr does (180/0xb4)
12:56alcazar has quit [Ping timeout: 480 seconds]
13:06alcazar has joined #asahi-re
13:15alcazar has quit [Ping timeout: 480 seconds]
13:25alcazar has joined #asahi-re
13:33alcazar has quit [Ping timeout: 480 seconds]
13:35alcazar has joined #asahi-re
13:41yuyichao has quit [Ping timeout: 480 seconds]
13:43alcazar has quit [Ping timeout: 480 seconds]
13:54alcazar has joined #asahi-re
13:58kameks has quit [Ping timeout: 480 seconds]
14:00yuyichao has joined #asahi-re
14:02alcazar has quit [Ping timeout: 480 seconds]
14:13alcazar has joined #asahi-re
14:13nyx_o has quit [Quit: WeeChat 3.4]
14:18nyx_o has joined #asahi-re
14:21alcazar has quit [Ping timeout: 480 seconds]
14:24bisko has joined #asahi-re
14:30alcazar has joined #asahi-re
14:51nicolas17 has joined #asahi-re
14:53alcazar has quit [Ping timeout: 480 seconds]
14:53alcazar has joined #asahi-re
14:59doggkruse has joined #asahi-re
15:02alcazar has quit [Ping timeout: 480 seconds]
15:11alcazar has joined #asahi-re
15:19alcazar has quit [Ping timeout: 480 seconds]
15:29alcazar has joined #asahi-re
15:37alcazar has quit [Ping timeout: 480 seconds]
15:40alcazar has joined #asahi-re
15:51alcazar has quit [Ping timeout: 480 seconds]
16:01alcazar has joined #asahi-re
16:09alcazar has quit [Ping timeout: 480 seconds]
16:17alcazar has joined #asahi-re
16:26alcazar has quit [Ping timeout: 480 seconds]
16:34alcazar has joined #asahi-re
16:42alcazar has quit [Ping timeout: 480 seconds]
16:52alcazar has joined #asahi-re
16:52MajorBiscuit has quit [Ping timeout: 480 seconds]
17:00alcazar has quit [Ping timeout: 480 seconds]
17:10alcazar has joined #asahi-re
17:19alcazar has quit [Ping timeout: 480 seconds]
17:28alcazar has joined #asahi-re
17:36alcazar has quit [Ping timeout: 480 seconds]
17:46alcazar has joined #asahi-re
17:54alcazar has quit [Ping timeout: 480 seconds]
18:02alcazar has joined #asahi-re
18:10alcazar has quit [Ping timeout: 480 seconds]
18:19alcazar has joined #asahi-re
18:27alcazar has quit [Ping timeout: 480 seconds]
18:27MajorBiscuit has joined #asahi-re
18:37alcazar has joined #asahi-re
18:39MajorBiscuit has quit [Ping timeout: 480 seconds]
18:39HardWall has joined #asahi-re
18:41HardWall has quit []
18:42herbas_ has joined #asahi-re
18:42HardWall has joined #asahi-re
18:43HardWall has quit []
18:43HardWall has joined #asahi-re
18:44HardWall has quit []
18:45alcazar has quit [Ping timeout: 480 seconds]
18:45bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
18:46bisko has joined #asahi-re
18:54alcazar has joined #asahi-re
18:55bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
19:03alcazar has quit [Ping timeout: 480 seconds]
19:08herbas_ has quit [Remote host closed the connection]
19:11alcazar has joined #asahi-re
19:19alcazar has quit [Ping timeout: 480 seconds]
19:28alcazar has joined #asahi-re
19:33IonutLazurca[m] has joined #asahi-re
19:36alcazar has quit [Ping timeout: 480 seconds]
19:39r0ni has joined #asahi-re
19:45atsalyuk has joined #asahi-re
19:45alcazar has joined #asahi-re
19:46MajorBiscuit has joined #asahi-re
19:49yuyichao has quit [Quit: Konversation terminated!]
19:50yuyichao has joined #asahi-re
19:54alcazar has quit [Ping timeout: 480 seconds]
19:54MajorBiscuit has quit [Ping timeout: 480 seconds]
19:57MajorBiscuit has joined #asahi-re
20:00boardwalk has joined #asahi-re
20:01MajorBiscuit has quit []
20:05alcazar has joined #asahi-re
20:13alcazar has quit [Ping timeout: 480 seconds]
20:23alcazar has joined #asahi-re
20:31alcazar has quit [Ping timeout: 480 seconds]
20:41alcazar has joined #asahi-re
20:50alcazar has quit [Ping timeout: 480 seconds]
20:59alcazar has joined #asahi-re
21:07alcazar has quit [Ping timeout: 480 seconds]
21:11atsalyuk has quit [Ping timeout: 480 seconds]
21:17alcazar has joined #asahi-re
21:26alcazar has quit [Ping timeout: 480 seconds]
21:31alcazar has joined #asahi-re
21:36atsalyuk has joined #asahi-re
21:39alcazar has quit [Ping timeout: 480 seconds]
21:49alcazar has joined #asahi-re
21:57alcazar has quit [Ping timeout: 480 seconds]
22:05alcazar has joined #asahi-re
22:14alcazar has quit [Ping timeout: 480 seconds]
22:20alcazar has joined #asahi-re
22:31alcazar has quit [Ping timeout: 480 seconds]
22:34alcazar has joined #asahi-re
22:47alcazar has quit [Ping timeout: 480 seconds]
22:57alcazar has joined #asahi-re
23:00alexsv has joined #asahi-re
23:05alcazar has quit [Ping timeout: 480 seconds]
23:16alcazar has joined #asahi-re
23:24alcazar has quit [Ping timeout: 480 seconds]
23:34alcazar has joined #asahi-re
23:42alcazar has quit [Ping timeout: 480 seconds]
23:52alcazar has joined #asahi-re
23:59doggkruse has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]