Thread View: comp.lang.c++
45 messages
45 total messages
Started by Joseph Seigh
Fri, 27 Nov 2026 17:31
Consequential RCU Performance
Author: Joseph Seigh
Date: Fri, 27 Nov 2026 17:31
Date: Fri, 27 Nov 2026 17:31
58 lines
3172 bytes
3172 bytes
I ran some performance measurements on the reader side, no write updates, for a plain linked list traversal, 2 slightly different consequential rcu traversals, and traversals using hazard pointers w/o and w/ a store/load memory barrier. Timings are per node access. Depth is the size of the list. count=100000 depth=10 base: elapsed = 723888 ( 1528564) avg = 0.72389 nsecs ( 1.52856 cycles) cseq1: elapsed = 739503 ( 1561812) avg = 0.73950 nsecs ( 1.56181 cycles) cseq2: elapsed = 730236 ( 1542272) avg = 0.73024 nsecs ( 1.54227 cycles) hzptr: elapsed = 1718280 ( 3628992) avg = 1.71828 nsecs ( 3.62899 cycles) hzptr_mb: elapsed = 10886003 ( 22990944) avg = 10.88600 nsecs (22.99094 cycles) base: elapsed = 397189 ( 838878) avg = 0.39719 nsecs ( 0.83888 cycles) cseq1: elapsed = 634696 ( 1340486) avg = 0.63470 nsecs ( 1.34049 cycles) cseq2: elapsed = 617216 ( 1303568) avg = 0.61722 nsecs ( 1.30357 cycles) hzptr: elapsed = 1271179 ( 2684724) avg = 1.27118 nsecs ( 2.68472 cycles) hzptr_mb: elapsed = 8771772 ( 18525744) avg = 8.77177 nsecs (18.52574 cycles) count=10000 depth=200 base: elapsed = 2887587 ( 6098462) avg = 1.44379 nsecs ( 3.04923 cycles) cseq1: elapsed = 2919783 ( 6166530) avg = 1.45989 nsecs ( 3.08326 cycles) cseq2: elapsed = 2742185 ( 5791448) avg = 1.37109 nsecs ( 2.89572 cycles) hzptr: elapsed = 2875948 ( 6073948) avg = 1.43797 nsecs ( 3.03697 cycles) hzptr_mb: elapsed = 15943183 ( 33671514) avg = 7.97159 nsecs (16.83576 cycles) base: elapsed = 2093758 ( 4421978) avg = 1.04688 nsecs ( 2.21099 cycles) cseq1: elapsed = 2191755 ( 4628948) avg = 1.09588 nsecs ( 2.31447 cycles) cseq2: elapsed = 2130060 ( 4498648) avg = 1.06503 nsecs ( 2.24932 cycles) hzptr: elapsed = 2334867 ( 4931194) avg = 1.16743 nsecs ( 2.46560 cycles) hzptr_mb: elapsed = 14738172 ( 31126590) avg = 7.36909 nsecs (15.56330 cycles) Given the restrictions, consequential rcu seems to be on par with hazard pointers.
Re: Consequential RCU Performance
Author: Bonita Montero
Date: Fri, 27 Nov 2026 18:03
Date: Fri, 27 Nov 2026 18:03
73 lines
4364 bytes
4364 bytes
RCU isn't needed. I've shown sth. similar like a shared_ptr<> along with sth. similar to an atomic<shared_ptr<>>. With that you poll the "atomic" and if both are the same noting happens. That's almost zero execution time since the participating cachelines remain in shared_mode; i.e you don't have any interconnect-traffic with that. shared_ptr<> should have an assignment operator taking an atomic<shared _ptr<>>; just as I did with my shared_obj<> and tshared_obj<>. It should to the same comparison as a fast path. With that you can forget the whole complexity of RCU. The advantage is that reclaims of the memory happen in the moment when a shared_ptr<> is updated from the atomic and not delayed. Am 27.11.2026 um 18:31 schrieb Joseph Seigh: > I ran some performance measurements on the reader side, no write > updates, for a plain linked list traversal, 2 slightly different > consequential rcu traversals, and traversals using hazard > pointers w/o and w/ a store/load memory barrier. > > Timings are per node access. Depth is the size of the list. > > count=100000 depth=10 > base: elapsed = 723888 ( 1528564) > avg = 0.72389 nsecs ( 1.52856 cycles) > cseq1: elapsed = 739503 ( 1561812) > avg = 0.73950 nsecs ( 1.56181 cycles) > cseq2: elapsed = 730236 ( 1542272) > avg = 0.73024 nsecs ( 1.54227 cycles) > hzptr: elapsed = 1718280 ( 3628992) > avg = 1.71828 nsecs ( 3.62899 cycles) > hzptr_mb: elapsed = 10886003 ( 22990944) > avg = 10.88600 nsecs (22.99094 cycles) > > base: elapsed = 397189 ( 838878) > avg = 0.39719 nsecs ( 0.83888 cycles) > cseq1: elapsed = 634696 ( 1340486) > avg = 0.63470 nsecs ( 1.34049 cycles) > cseq2: elapsed = 617216 ( 1303568) > avg = 0.61722 nsecs ( 1.30357 cycles) > hzptr: elapsed = 1271179 ( 2684724) > avg = 1.27118 nsecs ( 2.68472 cycles) > hzptr_mb: elapsed = 8771772 ( 18525744) > avg = 8.77177 nsecs (18.52574 cycles) > > > count=10000 depth=200 > base: elapsed = 2887587 ( 6098462) > avg = 1.44379 nsecs ( 3.04923 cycles) > cseq1: elapsed = 2919783 ( 6166530) > avg = 1.45989 nsecs ( 3.08326 cycles) > cseq2: elapsed = 2742185 ( 5791448) > avg = 1.37109 nsecs ( 2.89572 cycles) > hzptr: elapsed = 2875948 ( 6073948) > avg = 1.43797 nsecs ( 3.03697 cycles) > hzptr_mb: elapsed = 15943183 ( 33671514) > avg = 7.97159 nsecs (16.83576 cycles) > > base: elapsed = 2093758 ( 4421978) > avg = 1.04688 nsecs ( 2.21099 cycles) > cseq1: elapsed = 2191755 ( 4628948) > avg = 1.09588 nsecs ( 2.31447 cycles) > cseq2: elapsed = 2130060 ( 4498648) > avg = 1.06503 nsecs ( 2.24932 cycles) > hzptr: elapsed = 2334867 ( 4931194) > avg = 1.16743 nsecs ( 2.46560 cycles) > hzptr_mb: elapsed = 14738172 ( 31126590) > avg = 7.36909 nsecs (15.56330 cycles) > > Given the restrictions, consequential rcu > seems to be on par with hazard pointers. > >
Re: Consequential RCU Performance
Author: Chris M. Thomasson
Date: Fri, 27 Nov 2026 21:00
Date: Fri, 27 Nov 2026 21:00
5 lines
1356 bytes
1356 bytes
On 11/27/2026 10:03 AM, Bonita Montero wrote: > RCU isn't needed. Sigh. [...]
Re: Consequential RCU Performance
Author: Bonita Montero
Date: Sat, 28 Nov 2026 04:55
Date: Sat, 28 Nov 2026 04:55
10 lines
1558 bytes
1558 bytes
Am 27.11.2026 um 22:00 schrieb Chris M. Thomasson: > On 11/27/2026 10:03 AM, Bonita Montero wrote: >> RCU isn't needed. > Sigh. You said that you understand my idea. Now I'm sure you don't.
Re: Consequential RCU Performance
Author: Chris M. Thomasson
Date: Sat, 28 Nov 2026 20:35
Date: Sat, 28 Nov 2026 20:35
32 lines
2350 bytes
2350 bytes
On 11/27/2026 8:55 PM, Bonita Montero wrote: > Am 27.11.2026 um 22:00 schrieb Chris M. Thomasson: > >> On 11/27/2026 10:03 AM, Bonita Montero wrote: > >>> RCU isn't needed. > >> Sigh. > You said that you understand my idea. > Now I'm sure you don't. > I am not sure if you understand your idea and/or RCU... Oh god. You need to make a test where there are a lot of reader threads iterating a lock-free stack while writers are actively mutating the stack. Your readers should never need to use StoreLoad membars or any atomic RMW's, etc. Not even LoadStore, well, side note consume got depreciated and falls back to a #LoadStore | #LoadLoad iirc. Also, the stack does not need any ABA version counts simply because ABA will never occur. Can your current work do it? RCU can do it. Can yours? I have poor mans proxy that works well wrt amortization. Its a poor mans RCU. https://pastebin.com/raw/CYZ78gVj How would your idea fit in here?
Re: Consequential RCU Performance
Author: Chris M. Thomasson
Date: Sat, 28 Nov 2026 22:14
Date: Sat, 28 Nov 2026 22:14
61 lines
3609 bytes
3609 bytes
On 11/27/2026 9:31 AM, Joseph Seigh wrote: > I ran some performance measurements on the reader side, no write > updates, for a plain linked list traversal, 2 slightly different > consequential rcu traversals, and traversals using hazard > pointers w/o and w/ a store/load memory barrier. > > Timings are per node access. Depth is the size of the list. > > count=100000 depth=10 > base: elapsed = 723888 ( 1528564) > avg = 0.72389 nsecs ( 1.52856 cycles) > cseq1: elapsed = 739503 ( 1561812) > avg = 0.73950 nsecs ( 1.56181 cycles) > cseq2: elapsed = 730236 ( 1542272) > avg = 0.73024 nsecs ( 1.54227 cycles) > hzptr: elapsed = 1718280 ( 3628992) > avg = 1.71828 nsecs ( 3.62899 cycles) > hzptr_mb: elapsed = 10886003 ( 22990944) > avg = 10.88600 nsecs (22.99094 cycles) > > base: elapsed = 397189 ( 838878) > avg = 0.39719 nsecs ( 0.83888 cycles) > cseq1: elapsed = 634696 ( 1340486) > avg = 0.63470 nsecs ( 1.34049 cycles) > cseq2: elapsed = 617216 ( 1303568) > avg = 0.61722 nsecs ( 1.30357 cycles) > hzptr: elapsed = 1271179 ( 2684724) > avg = 1.27118 nsecs ( 2.68472 cycles) > hzptr_mb: elapsed = 8771772 ( 18525744) > avg = 8.77177 nsecs (18.52574 cycles) > > > count=10000 depth=200 > base: elapsed = 2887587 ( 6098462) > avg = 1.44379 nsecs ( 3.04923 cycles) > cseq1: elapsed = 2919783 ( 6166530) > avg = 1.45989 nsecs ( 3.08326 cycles) > cseq2: elapsed = 2742185 ( 5791448) > avg = 1.37109 nsecs ( 2.89572 cycles) > hzptr: elapsed = 2875948 ( 6073948) > avg = 1.43797 nsecs ( 3.03697 cycles) > hzptr_mb: elapsed = 15943183 ( 33671514) > avg = 7.97159 nsecs (16.83576 cycles) > > base: elapsed = 2093758 ( 4421978) > avg = 1.04688 nsecs ( 2.21099 cycles) > cseq1: elapsed = 2191755 ( 4628948) > avg = 1.09588 nsecs ( 2.31447 cycles) > cseq2: elapsed = 2130060 ( 4498648) > avg = 1.06503 nsecs ( 2.24932 cycles) > hzptr: elapsed = 2334867 ( 4931194) > avg = 1.16743 nsecs ( 2.46560 cycles) > hzptr_mb: elapsed = 14738172 ( 31126590) > avg = 7.36909 nsecs (15.56330 cycles) > > Given the restrictions, consequential rcu > seems to be on par with hazard pointers. Seems so! Even faster on some runs?
Re: Consequential RCU Performance
Author: Chris M. Thomasson
Date: Sat, 28 Nov 2026 22:26
Date: Sat, 28 Nov 2026 22:26
48 lines
3247 bytes
3247 bytes
On 11/28/2026 2:14 PM, Chris M. Thomasson wrote: > On 11/27/2026 9:31 AM, Joseph Seigh wrote: >> I ran some performance measurements on the reader side, no write >> updates, for a plain linked list traversal, 2 slightly different >> consequential rcu traversals, and traversals using hazard >> pointers w/o and w/ a store/load memory barrier. >> >> Timings are per node access. Depth is the size of the list. [...] >> count=10000 depth=200 >> base: elapsed = 2887587 ( 6098462) >> avg = 1.44379 nsecs ( 3.04923 cycles) >> cseq1: elapsed = 2919783 ( 6166530) >> avg = 1.45989 nsecs ( 3.08326 cycles) >> cseq2: elapsed = 2742185 ( 5791448) >> avg = 1.37109 nsecs ( 2.89572 cycles) >> hzptr: elapsed = 2875948 ( 6073948) >> avg = 1.43797 nsecs ( 3.03697 cycles) >> hzptr_mb: elapsed = 15943183 ( 33671514) >> avg = 7.97159 nsecs (16.83576 cycles) >> >> base: elapsed = 2093758 ( 4421978) >> avg = 1.04688 nsecs ( 2.21099 cycles) >> cseq1: elapsed = 2191755 ( 4628948) >> avg = 1.09588 nsecs ( 2.31447 cycles) >> cseq2: elapsed = 2130060 ( 4498648) >> avg = 1.06503 nsecs ( 2.24932 cycles) >> hzptr: elapsed = 2334867 ( 4931194) >> avg = 1.16743 nsecs ( 2.46560 cycles) >> hzptr_mb: elapsed = 14738172 ( 31126590) >> avg = 7.36909 nsecs (15.56330 cycles) >> >> Given the restrictions, consequential rcu >> seems to be on par with hazard pointers. > > Seems so! Even faster on some runs? cseq2 seems to be the best for those runs. Humm... How many threads are involved? One per core? Try a list depth of say 1000000? say count 10000000, depth 1000000. Also, you really should try another test where there are writers humming along. Technically you should be able to have the writers pushing and popping. But, the lock-free stack should never need an ABA counter because the RCU aspect should never allow a node to be pushed back in before its quiescent.
Re: Consequential RCU Performance
Author: Chris M. Thomasson
Date: Sat, 28 Nov 2026 22:33
Date: Sat, 28 Nov 2026 22:33
52 lines
3495 bytes
3495 bytes
On 11/28/2026 2:26 PM, Chris M. Thomasson wrote: > On 11/28/2026 2:14 PM, Chris M. Thomasson wrote: >> On 11/27/2026 9:31 AM, Joseph Seigh wrote: >>> I ran some performance measurements on the reader side, no write >>> updates, for a plain linked list traversal, 2 slightly different >>> consequential rcu traversals, and traversals using hazard >>> pointers w/o and w/ a store/load memory barrier. >>> >>> Timings are per node access. Depth is the size of the list. > [...] >>> count=10000 depth=200 >>> base: elapsed = 2887587 ( 6098462) >>> avg = 1.44379 nsecs ( 3.04923 cycles) >>> cseq1: elapsed = 2919783 ( 6166530) >>> avg = 1.45989 nsecs ( 3.08326 cycles) >>> cseq2: elapsed = 2742185 ( 5791448) >>> avg = 1.37109 nsecs ( 2.89572 cycles) >>> hzptr: elapsed = 2875948 ( 6073948) >>> avg = 1.43797 nsecs ( 3.03697 cycles) >>> hzptr_mb: elapsed = 15943183 ( 33671514) >>> avg = 7.97159 nsecs (16.83576 cycles) >>> >>> base: elapsed = 2093758 ( 4421978) >>> avg = 1.04688 nsecs ( 2.21099 cycles) >>> cseq1: elapsed = 2191755 ( 4628948) >>> avg = 1.09588 nsecs ( 2.31447 cycles) >>> cseq2: elapsed = 2130060 ( 4498648) >>> avg = 1.06503 nsecs ( 2.24932 cycles) >>> hzptr: elapsed = 2334867 ( 4931194) >>> avg = 1.16743 nsecs ( 2.46560 cycles) >>> hzptr_mb: elapsed = 14738172 ( 31126590) >>> avg = 7.36909 nsecs (15.56330 cycles) >>> >>> Given the restrictions, consequential rcu >>> seems to be on par with hazard pointers. >> >> Seems so! Even faster on some runs? > > cseq2 seems to be the best for those runs. Humm... How many threads are > involved? One per core? Try a list depth of say 1000000? > > say count 10000000, depth 1000000. > > Also, you really should try another test where there are writers humming > along. Technically you should be able to have the writers pushing and > popping. But, the lock-free stack should never need an ABA counter > because the RCU aspect should never allow a node to be pushed back in > before its quiescent. > Also, for your hazard pointer test, are you doing its logic on a per node basis during iteration?
Re: Consequential RCU Performance
Author: Bonita Montero
Date: Sun, 29 Nov 2026 05:47
Date: Sun, 29 Nov 2026 05:47
5 lines
1615 bytes
1615 bytes
Am 28.11.2026 um 21:35 schrieb Chris M. Thomasson: > I am not sure if you understand your idea and/or RCU... I understand both and you just don't understand my idea.
Re: Consequential RCU Performance
Author: Chris M. Thomasson
Date: Sun, 29 Nov 2026 08:29
Date: Sun, 29 Nov 2026 08:29
16 lines
2089 bytes
2089 bytes
On 11/28/2026 9:47 PM, Bonita Montero wrote: > Am 28.11.2026 um 21:35 schrieb Chris M. Thomasson: > >> I am not sure if you understand your idea and/or RCU... > > I understand both and you just don't understand my idea. I do. I still want to see it be used for a test where there are a lot of reader threads iterating a lock-free stack while writers are actively mutating the stack. Your readers should never need to use StoreLoad membars or any atomic RMW's, right? Also, the stack does not need any ABA version counts simply because ABA will never occur. Can your current work do it? RCU can do it. Can yours?
Re: Consequential RCU Performance
Author: Bonita Montero
Date: Sun, 29 Nov 2026 08:37
Date: Sun, 29 Nov 2026 08:37
10 lines
2057 bytes
2057 bytes
Am 29.11.2026 um 09:29 schrieb Chris M. Thomasson: > I do. I still want to see it be used for a test where there are a lot of > reader threads iterating a lock-free stack while writers are actively > mutating the stack. Your readers should never need to use StoreLoad > membars or any atomic RMW's, right? RCU, or my alternative, has nothing to do with lock-free stacks. And based on your "criticism," I am quite certain that you haven't understood my idea. Why don't you try describing it in your own words.
Re: Consequential RCU Performance
Author: Chris M. Thomasson
Date: Sun, 29 Nov 2026 08:43
Date: Sun, 29 Nov 2026 08:43
16 lines
2363 bytes
2363 bytes
On 11/29/2026 12:37 AM, Bonita Montero wrote: > Am 29.11.2026 um 09:29 schrieb Chris M. Thomasson: > >> I do. I still want to see it be used for a test where there are a lot >> of reader threads iterating a lock-free stack while writers are >> actively mutating the stack. Your readers should never need to use >> StoreLoad membars or any atomic RMW's, right? > > RCU, or my alternative, has nothing to do with lock-free stacks. > And based on your "criticism," I am quite certain that you haven't > understood my idea. Why don't you try describing it in your own words. Ever heard of using RCU to iterate a linked data structure without any locks, atomic RMW's or StoreLoad membars? The readers go full steam ahead while writers can be actively mutating the list. RCU can do it fine. Can yours?
Re: Consequential RCU Performance
Author: Chris M. Thomasson
Date: Sun, 29 Nov 2026 08:46
Date: Sun, 29 Nov 2026 08:46
20 lines
2597 bytes
2597 bytes
On 11/29/2026 12:43 AM, Chris M. Thomasson wrote: > On 11/29/2026 12:37 AM, Bonita Montero wrote: >> Am 29.11.2026 um 09:29 schrieb Chris M. Thomasson: >> >>> I do. I still want to see it be used for a test where there are a lot >>> of reader threads iterating a lock-free stack while writers are >>> actively mutating the stack. Your readers should never need to use >>> StoreLoad membars or any atomic RMW's, right? >> >> RCU, or my alternative, has nothing to do with lock-free stacks. >> And based on your "criticism," I am quite certain that you haven't >> understood my idea. Why don't you try describing it in your own words. > > Ever heard of using RCU to iterate a linked data structure without any > locks, atomic RMW's or StoreLoad membars? The readers go full steam > ahead while writers can be actively mutating the list. RCU can do it > fine. Can yours? We already talked about it in that older thread. But you seem to refuse to use it for one of the most common use cases that makes RCU shine. Why?
Re: Consequential RCU Performance
Author: Bonita Montero
Date: Sun, 29 Nov 2026 08:50
Date: Sun, 29 Nov 2026 08:50
12 lines
2146 bytes
2146 bytes
Am 29.11.2026 um 09:43 schrieb Chris M. Thomasson: > Ever heard of using RCU to iterate a linked data structure > without any locks, atomic RMW's or StoreLoad membars? .. I don't know which pattern you're talking about. But with my idea everything which is possible with RCU works also the way I did. The memory consumtion of having multiple versions of the data around is the same, but with my idea you've an immediate reclaim when the last participant abandons ist. Now describe the fast path of my idea !
Re: Consequential RCU Performance
Author: Chris M. Thomasson
Date: Sun, 29 Nov 2026 21:17
Date: Sun, 29 Nov 2026 21:17
26 lines
2769 bytes
2769 bytes
On 11/29/2026 12:50 AM, Bonita Montero wrote: > Am 29.11.2026 um 09:43 schrieb Chris M. Thomasson: > >> Ever heard of using RCU to iterate a linked data structure >> without any locks, atomic RMW's or StoreLoad membars? .. > I don't know which pattern you're talking about. But with my idea > everything which is possible with RCU works also the way I did. GOOD! Then show one of its most common usage cases? Iterating a shared linked list where the readers fly, and the writers can be actively mutating the list without causing the readers any harm. > The memory consumtion of having multiple versions of the data > around is the same, but with my idea you've an immediate reclaim > when the last participant abandons ist. > > Now describe the fast path of my idea ! > Iirc, you are making a basic thread saftey refcount aka shared_ptr that can handle strong thread safety without an outright slow path lock every time. So, shared_ptr vs atomic<shared_ptr>. But iirc, your impl uses a futex. So, it still can wait in the kernel. Did you ever take a look at Joe's atomic_ptr work? 100% lock-free.
Re: Consequential RCU Performance
Author: Joseph Seigh
Date: Mon, 30 Nov 2026 00:30
Date: Mon, 30 Nov 2026 00:30
33 lines
2704 bytes
2704 bytes
On 11/28/26 5:33 PM, Chris M. Thomasson wrote: > On 11/28/2026 2:26 PM, Chris M. Thomasson wrote: >> On 11/28/2026 2:14 PM, Chris M. Thomasson wrote: >>> On 11/27/2026 9:31 AM, Joseph Seigh wrote: ... >> >> cseq2 seems to be the best for those runs. Humm... How many threads >> are involved? One per core? Try a list depth of say 1000000? >> >> say count 10000000, depth 1000000. >> >> Also, you really should try another test where there are writers >> humming along. Technically you should be able to have the writers >> pushing and popping. But, the lock-free stack should never need an ABA >> counter because the RCU aspect should never allow a node to be pushed >> back in before its quiescent. >> > > Also, for your hazard pointer test, are you doing its logic on a per > node basis during iteration? It's per node access. Using it on a linked list of that size wouldn't be optimal. I need to rework the test however since you need 2 hazard pointers to traverse nodes, so I need to add logic to swap the hazard poiter holders. If I use a wait-free hazard pointer, then only 1 is needed. And it would run a bit faster since there wouldn't be conditional branches to slow the cpu pipeline. At any rate, they're equivalent in performance. The timings were to show if there was a situation where there were advantages in using consequential rcu, performance wouldn't be a reason to rule it out.
Re: Consequential RCU Performance
Author: Bonita Montero
Date: Mon, 30 Nov 2026 03:27
Date: Mon, 30 Nov 2026 03:27
9 lines
2135 bytes
2135 bytes
Am 29.11.2026 um 22:17 schrieb Chris M. Thomasson: > Iirc, you are making a basic thread saftey refcount aka shared_ptr that > can handle strong thread safety without an outright slow path lock every > time. So, shared_ptr vs atomic<shared_ptr>. But iirc, your impl uses a > futex. So, it still can wait in the kernel. Did you ever take a look at > Joe's atomic_ptr work? 100% lock-free. You didn't get it ...
Re: Consequential RCU Performance
Author: Bonita Montero
Date: Mon, 30 Nov 2026 08:22
Date: Mon, 30 Nov 2026 08:22
10 lines
2216 bytes
2216 bytes
Do you understand this: https://ibb.co/HLtbkTBk (the graph is logarithmically on the y-axis) This is the time for polling an shared_obj<> from a tshared_obj<> vs. the time to poll a shared_ptr<> from a atomic<shared_ptr<>> when the second remains unchanged with an increasing number of threads (1-32). This is true for RCU-like patterns where the update occurs rarely, but the poll for a newer version of the data happens very often. You don't need to uderstand my idea, just take this graph.
Re: Consequential RCU Performance
Author: jseigh
Date: Mon, 30 Nov 2026 16:55
Date: Mon, 30 Nov 2026 16:55
67 lines
3703 bytes
3703 bytes
On 11/27/26 12:31, Joseph Seigh wrote: > I ran some performance measurements on the reader side, no write > updates, for a plain linked list traversal, 2 slightly different > consequential rcu traversals, and traversals using hazard > pointers w/o and w/ a store/load memory barrier. > > Timings are per node access. Depth is the size of the list. > Updated hazard pointer traversal to use 2 hazard pointers. Add a wait-free hazard pointer (w/o mb) which only uses 1 hazard pointer. count=100000 depth=10 base: elapsed = 719511 ( 1519364) avg = 0.71951 nsecs ( 1.51936 cycles) cseq1: elapsed = 741456 ( 1565966) avg = 0.74146 nsecs ( 1.56597 cycles) cseq2: elapsed = 736607 ( 1555732) avg = 0.73661 nsecs ( 1.55573 cycles) hzptr: elapsed = 1759763 ( 3716606) avg = 1.75976 nsecs ( 3.71661 cycles) hzptr_mb: elapsed = 10870760 ( 22958744) avg = 10.87076 nsecs (22.95874 cycles) hzptr wf: elapsed = 730749 ( 1543330) avg = 0.73075 nsecs ( 1.54333 cycles) base: elapsed = 380342 ( 803282) avg = 0.38034 nsecs ( 0.80328 cycles) cseq1: elapsed = 619074 ( 1307498) avg = 0.61907 nsecs ( 1.30750 cycles) cseq2: elapsed = 614340 ( 1297500) avg = 0.61434 nsecs ( 1.29750 cycles) hzptr: elapsed = 1239225 ( 2617234) avg = 1.23923 nsecs ( 2.61723 cycles) hzptr_mb: elapsed = 8895283 ( 18786598) avg = 8.89528 nsecs (18.78660 cycles) hzptr wf: elapsed = 638091 ( 1347654) avg = 0.63809 nsecs ( 1.34765 cycles) count=10000 depth=200 base: elapsed = 2837115 ( 5991876) avg = 1.41856 nsecs ( 2.99594 cycles) cseq1: elapsed = 2872265 ( 6066178) avg = 1.43613 nsecs ( 3.03309 cycles) cseq2: elapsed = 2755639 ( 5819856) avg = 1.37782 nsecs ( 2.90993 cycles) hzptr: elapsed = 2930905 ( 6190014) avg = 1.46545 nsecs ( 3.09501 cycles) hzptr_mb: elapsed = 15906790 ( 33594716) avg = 7.95340 nsecs (16.79736 cycles) hzptr wf: elapsed = 2201123 ( 4648738) avg = 1.10056 nsecs ( 2.32437 cycles) base: elapsed = 2102889 ( 4441250) avg = 1.05144 nsecs ( 2.22063 cycles) cseq1: elapsed = 2128434 ( 4495216) avg = 1.06422 nsecs ( 2.24761 cycles) cseq2: elapsed = 2144710 ( 4529588) avg = 1.07235 nsecs ( 2.26479 cycles) hzptr: elapsed = 2430719 ( 5133628) avg = 1.21536 nsecs ( 2.56681 cycles) hzptr_mb: elapsed = 14681514 ( 31006950) avg = 7.34076 nsecs (15.50347 cycles) hzptr wf: elapsed = 1991515 ( 4206044) avg = 0.99576 nsecs ( 2.10302 cycles)
Re: Consequential RCU Performance
Author: Chris M. Thomasson
Date: Mon, 30 Nov 2026 22:21
Date: Mon, 30 Nov 2026 22:21
18 lines
2634 bytes
2634 bytes
On 11/30/2026 12:22 AM, Bonita Montero wrote: > Do you understand this: https://ibb.co/HLtbkTBk > (the graph is logarithmically on the y-axis) > > This is the time for polling an shared_obj<> from a tshared_obj<> vs. > the time to poll a shared_ptr<> from a atomic<shared_ptr<>> when the > second remains unchanged with an increasing number of threads (1-32). > This is true for RCU-like patterns where the update occurs rarely, > but the poll for a newer version of the data happens very often. > You don't need to uderstand my idea, just take this graph. > Why do you refuse to use your idea for a common RCU pattern? Just code it up! Like I said readers are iterating an active linked list say two hundred thousand nodes. While writers are doing their thing. Then compare it against some other solutions, like RCU, or a nice proxy. Or teach me how to use your work for it? Pretty please?
Re: Consequential RCU Performance
Author: Chris M. Thomasson
Date: Mon, 30 Nov 2026 22:22
Date: Mon, 30 Nov 2026 22:22
13 lines
2296 bytes
2296 bytes
On 11/29/2026 7:27 PM, Bonita Montero wrote: > Am 29.11.2026 um 22:17 schrieb Chris M. Thomasson: > >> Iirc, you are making a basic thread saftey refcount aka shared_ptr >> that can handle strong thread safety without an outright slow path >> lock every time. So, shared_ptr vs atomic<shared_ptr>. But iirc, your >> impl uses a futex. So, it still can wait in the kernel. Did you ever >> take a look at Joe's atomic_ptr work? 100% lock-free. > > You didn't get it ... Lets get down to it, why are you using the futex? Its because the object changed, right?
Re: Consequential RCU Performance
Author: Chris M. Thomasson
Date: Mon, 30 Nov 2026 22:25
Date: Mon, 30 Nov 2026 22:25
30 lines
2465 bytes
2465 bytes
On 11/30/2026 8:55 AM, jseigh wrote: > On 11/27/26 12:31, Joseph Seigh wrote: >> I ran some performance measurements on the reader side, no write >> updates, for a plain linked list traversal, 2 slightly different >> consequential rcu traversals, and traversals using hazard >> pointers w/o and w/ a store/load memory barrier. >> >> Timings are per node access. Depth is the size of the list. >> > Updated hazard pointer traversal to use 2 hazard pointers. > Add a wait-free hazard pointer (w/o mb) which only > uses 1 hazard pointer. > [...] > base: elapsed = 2102889 ( 4441250) > avg = 1.05144 nsecs ( 2.22063 cycles) > cseq1: elapsed = 2128434 ( 4495216) > avg = 1.06422 nsecs ( 2.24761 cycles) > cseq2: elapsed = 2144710 ( 4529588) > avg = 1.07235 nsecs ( 2.26479 cycles) > hzptr: elapsed = 2430719 ( 5133628) > avg = 1.21536 nsecs ( 2.56681 cycles) > hzptr_mb: elapsed = 14681514 ( 31006950) > avg = 7.34076 nsecs (15.50347 cycles) > hzptr wf: elapsed = 1991515 ( 4206044) > avg = 0.99576 nsecs ( 2.10302 cycles) > Looking pretty damn good! What is the difference between hzptr_mb (I assume traditional hazard pointers) vs hzptr wf ?
Re: Consequential RCU Performance
Author: Chris M. Thomasson
Date: Mon, 30 Nov 2026 22:30
Date: Mon, 30 Nov 2026 22:30
47 lines
3206 bytes
3206 bytes
On 11/29/2026 4:30 PM, Joseph Seigh wrote: > On 11/28/26 5:33 PM, Chris M. Thomasson wrote: >> On 11/28/2026 2:26 PM, Chris M. Thomasson wrote: >>> On 11/28/2026 2:14 PM, Chris M. Thomasson wrote: >>>> On 11/27/2026 9:31 AM, Joseph Seigh wrote: > ... >>> >>> cseq2 seems to be the best for those runs. Humm... How many threads >>> are involved? One per core? Try a list depth of say 1000000? >>> >>> say count 10000000, depth 1000000. >>> >>> Also, you really should try another test where there are writers >>> humming along. Technically you should be able to have the writers >>> pushing and popping. But, the lock-free stack should never need an >>> ABA counter because the RCU aspect should never allow a node to be >>> pushed back in before its quiescent. >>> >> >> Also, for your hazard pointer test, are you doing its logic on a per >> node basis during iteration? > > It's per node access. Using it on a linked list of that size wouldn't > be optimal. I need to rework the test however since you need 2 > hazard pointers to traverse nodes, so I need to add logic to swap the > hazard poiter holders. This is a little too fine grain, ouch. But its a good way to test against your cseq2. Humm... Fwiw, I never really liked using hazard pointers like that. Instead, well, use the hazard pointers to protect the lifetime of a proxy collector? > If I use a wait-free hazard pointer, then only 1 is needed. And it > would run a bit faster since there wouldn't be conditional branches > to slow the cpu pipeline. To clarify, wait free as in loopless? > At any rate, they're equivalent in performance. The timings were to > show if there was a situation where there were advantages in using > consequential rcu, performance wouldn't be a reason to rule it out. Well, you are getting some good numbers for cseq2!
Re: Consequential RCU Performance
Author: Chris M. Thomasson
Date: Mon, 30 Nov 2026 22:31
Date: Mon, 30 Nov 2026 22:31
22 lines
2812 bytes
2812 bytes
On 11/30/2026 2:21 PM, Chris M. Thomasson wrote: > On 11/30/2026 12:22 AM, Bonita Montero wrote: >> Do you understand this: https://ibb.co/HLtbkTBk >> (the graph is logarithmically on the y-axis) >> >> This is the time for polling an shared_obj<> from a tshared_obj<> vs. >> the time to poll a shared_ptr<> from a atomic<shared_ptr<>> when the >> second remains unchanged with an increasing number of threads (1-32). >> This is true for RCU-like patterns where the update occurs rarely, >> but the poll for a newer version of the data happens very often. >> You don't need to uderstand my idea, just take this graph. >> > > Why do you refuse to use your idea for a common RCU pattern? Just code > it up! Like I said readers are iterating an active linked list say two > hundred thousand nodes. While writers are doing their thing. Then > compare it against some other solutions, like RCU, or a nice proxy. > > Or teach me how to use your work for it? Pretty please? Also, you need to tell the linux kernel guys that you say RCU is not needed. Have you?
Re: Consequential RCU Performance
Author: Chris M. Thomasson
Date: Mon, 30 Nov 2026 22:36
Date: Mon, 30 Nov 2026 22:36
16 lines
2442 bytes
2442 bytes
On 11/30/2026 2:22 PM, Chris M. Thomasson wrote: > On 11/29/2026 7:27 PM, Bonita Montero wrote: >> Am 29.11.2026 um 22:17 schrieb Chris M. Thomasson: >> >>> Iirc, you are making a basic thread saftey refcount aka shared_ptr >>> that can handle strong thread safety without an outright slow path >>> lock every time. So, shared_ptr vs atomic<shared_ptr>. But iirc, your >>> impl uses a futex. So, it still can wait in the kernel. Did you ever >>> take a look at Joe's atomic_ptr work? 100% lock-free. >> >> You didn't get it ... > > Lets get down to it, why are you using the futex? Its because the object > changed, right? I already said I think yours seems better than atomic<shared_ptr>
Re: Consequential RCU Performance
Author: Joseph Seigh
Date: Tue, 01 Dec 2026 00:38
Date: Tue, 01 Dec 2026 00:38
36 lines
2671 bytes
2671 bytes
On 11/30/26 5:25 PM, Chris M. Thomasson wrote: > On 11/30/2026 8:55 AM, jseigh wrote: >> On 11/27/26 12:31, Joseph Seigh wrote: >>> I ran some performance measurements on the reader side, no write >>> updates, for a plain linked list traversal, 2 slightly different >>> consequential rcu traversals, and traversals using hazard >>> pointers w/o and w/ a store/load memory barrier. >>> >>> Timings are per node access. Depth is the size of the list. >>> >> Updated hazard pointer traversal to use 2 hazard pointers. >> Add a wait-free hazard pointer (w/o mb) which only >> uses 1 hazard pointer. >> > [...] >> base: elapsed = 2102889 ( 4441250) >> avg = 1.05144 nsecs ( 2.22063 cycles) >> cseq1: elapsed = 2128434 ( 4495216) >> avg = 1.06422 nsecs ( 2.24761 cycles) >> cseq2: elapsed = 2144710 ( 4529588) >> avg = 1.07235 nsecs ( 2.26479 cycles) >> hzptr: elapsed = 2430719 ( 5133628) >> avg = 1.21536 nsecs ( 2.56681 cycles) >> hzptr_mb: elapsed = 14681514 ( 31006950) >> avg = 7.34076 nsecs (15.50347 cycles) >> hzptr wf: elapsed = 1991515 ( 4206044) >> avg = 0.99576 nsecs ( 2.10302 cycles) >> > > Looking pretty damn good! What is the difference between hzptr_mb (I > assume traditional hazard pointers) vs hzptr wf ? hzptr is w/o the store/load membar hzptr_mb is w/ the store/load membar hzptr_wf is loop free and w/o membar.
Re: Consequential RCU Performance
Author: Chris M. Thomasson
Date: Tue, 01 Dec 2026 01:05
Date: Tue, 01 Dec 2026 01:05
40 lines
2934 bytes
2934 bytes
On 11/30/2026 4:38 PM, Joseph Seigh wrote: > On 11/30/26 5:25 PM, Chris M. Thomasson wrote: >> On 11/30/2026 8:55 AM, jseigh wrote: >>> On 11/27/26 12:31, Joseph Seigh wrote: >>>> I ran some performance measurements on the reader side, no write >>>> updates, for a plain linked list traversal, 2 slightly different >>>> consequential rcu traversals, and traversals using hazard >>>> pointers w/o and w/ a store/load memory barrier. >>>> >>>> Timings are per node access. Depth is the size of the list. >>>> >>> Updated hazard pointer traversal to use 2 hazard pointers. >>> Add a wait-free hazard pointer (w/o mb) which only >>> uses 1 hazard pointer. >>> >> [...] >>> base: elapsed = 2102889 ( 4441250) >>> avg = 1.05144 nsecs ( 2.22063 cycles) >>> cseq1: elapsed = 2128434 ( 4495216) >>> avg = 1.06422 nsecs ( 2.24761 cycles) >>> cseq2: elapsed = 2144710 ( 4529588) >>> avg = 1.07235 nsecs ( 2.26479 cycles) >>> hzptr: elapsed = 2430719 ( 5133628) >>> avg = 1.21536 nsecs ( 2.56681 cycles) >>> hzptr_mb: elapsed = 14681514 ( 31006950) >>> avg = 7.34076 nsecs (15.50347 cycles) >>> hzptr wf: elapsed = 1991515 ( 4206044) >>> avg = 0.99576 nsecs ( 2.10302 cycles) >>> >> >> Looking pretty damn good! What is the difference between hzptr_mb (I >> assume traditional hazard pointers) vs hzptr wf ? > > > hzptr is w/o the store/load membar > hzptr_mb is w/ the store/load membar > hzptr_wf is loop free and w/o membar. hzptr_wf is interesting to me. You still have a run a scan process to determine when a node is quiescent, right?
Re: Consequential RCU Performance
Author: Bonita Montero
Date: Tue, 01 Dec 2026 05:02
Date: Tue, 01 Dec 2026 05:02
7 lines
2084 bytes
2084 bytes
Am 30.11.2026 um 23:21 schrieb Chris M. Thomasson: > Why do you refuse to use your idea for a common RCU pattern? > Just code it up! ... You are truly the embodiment of insecurity—feeling the need to apply your rigid patterns of thought to situations you don’t understand.
Re: Consequential RCU Performance
Author: Chris M. Thomasson
Date: Tue, 01 Dec 2026 05:15
Date: Tue, 01 Dec 2026 05:15
12 lines
2347 bytes
2347 bytes
On 11/30/2026 9:02 PM, Bonita Montero wrote: > Am 30.11.2026 um 23:21 schrieb Chris M. Thomasson: > >> Why do you refuse to use your idea for a common RCU pattern? >> Just code it up! ... > > You are truly the embodiment of insecurity—feeling the need to apply > your rigid patterns of thought to situations you don’t understand. God! You are the one that says RCU is not needed. But you outright refuse to show how your work can be used in its place for one of RCU's major and most common usage pattern. Go figure?
Re: Consequential RCU Performance
Author: Bonita Montero
Date: Tue, 01 Dec 2026 05:25
Date: Tue, 01 Dec 2026 05:25
6 lines
2121 bytes
2121 bytes
Am 01.12.2026 um 06:15 schrieb Chris M. Thomasson: > God! You are the one that says RCU is not needed. ... Yes, it's too complicated for what it is used for. Any my solution is as efficient and allows immediate reclamation.
Re: Consequential RCU Performance
Author: Ross Finlayson
Date: Tue, 01 Dec 2026 08:49
Date: Tue, 01 Dec 2026 08:49
32 lines
3363 bytes
3363 bytes
On 11/30/2026 09:15 PM, Chris M. Thomasson wrote: > On 11/30/2026 9:02 PM, Bonita Montero wrote: >> Am 30.11.2026 um 23:21 schrieb Chris M. Thomasson: >> >>> Why do you refuse to use your idea for a common RCU pattern? >>> Just code it up! ... >> >> You are truly the embodiment of insecurity—feeling the need to apply >> your rigid patterns of thought to situations you don’t understand. > > God! You are the one that says RCU is not needed. But you outright > refuse to show how your work can be used in its place for one of RCU's > major and most common usage pattern. Go figure? Modern chips these days the many-core are simply as a distributed-system, in the horizontally scale-able best one can hope in the "generally independent" is compare-and-swap a.k.a. load-linked/store-conditional, one smallest/atomic piece of memory, opportunistically "locked". Of course there are many accounts of hardware synchronization, or, there are a few, various among architectures, of which there aren't that many. Of course synchronization more generally in the co-operative is for protocols, those introducing dependency / not-independency, then that eventually there's for leader-election or straw-pulling, and wider synchronization-points: for the otherwise independent and the least inter-dependency: there's only one reliable common idiom, and it's highly contended.
Re: Consequential RCU Performance
Author: Bonita Montero
Date: Tue, 01 Dec 2026 09:03
Date: Tue, 01 Dec 2026 09:03
24 lines
3129 bytes
3129 bytes
Am 01.12.2026 um 09:49 schrieb Ross Finlayson: > Modern chips these days the many-core are simply as a > distributed-system, in the horizontally scale-able best one can hope in > the "generally independent" is compare-and-swap a.k.a. > load-linked/store-conditional, one smallest/atomic piece of memory, > opportunistically "locked". > > Of course there are many accounts of hardware synchronization, > or, there are a few, various among architectures, of which > there aren't that many. > > Of course synchronization more generally in the co-operative > is for protocols, those introducing dependency / not-independency, > then that eventually there's for leader-election or straw-pulling, > and wider synchronization-points: for the otherwise independent > and the least inter-dependency: there's only one reliable common > idiom, and it's highly contended. Why do you always respond with topics that are only tangentially related to the subject at hand, rather than actually addressing it ? What you’re trying to say would be better suited for an encyclopedia — though I’m certain you wouldn’t be able to stay on topic there, either.
Re: Consequential RCU Performance
Author: Ross Finlayson
Date: Tue, 01 Dec 2026 09:37
Date: Tue, 01 Dec 2026 09:37
46 lines
4159 bytes
4159 bytes
On 12/01/2026 01:03 AM, Bonita Montero wrote: > Am 01.12.2026 um 09:49 schrieb Ross Finlayson: > >> Modern chips these days the many-core are simply as a >> distributed-system, in the horizontally scale-able best one can hope in >> the "generally independent" is compare-and-swap a.k.a. >> load-linked/store-conditional, one smallest/atomic piece of memory, >> opportunistically "locked". >> >> Of course there are many accounts of hardware synchronization, >> or, there are a few, various among architectures, of which >> there aren't that many. >> >> Of course synchronization more generally in the co-operative >> is for protocols, those introducing dependency / not-independency, >> then that eventually there's for leader-election or straw-pulling, >> and wider synchronization-points: for the otherwise independent >> and the least inter-dependency: there's only one reliable common >> idiom, and it's highly contended. > Why do you always respond with topics that are only tangentially > related to the subject at hand, rather than actually addressing > it ? What you’re trying to say would be better suited for an > encyclopedia — though I’m certain you wouldn’t be able to stay > on topic there, either. > What's relevant is that data-structures & algorithms have a purpose, their use-case, what it is, then, the target environment has some fixed conditions, what they are, what must be, it's not off-topic. A reasoner can relate that this violates or simply changes previous preconceived notions or implicit assumptions or simply what has changed in the architecture or is the only available portable abstraction, that's not off-topic: it's stating the "obvious". The usual languages and operating systems were conceptualized in a single-core world with exactly one state of the machine, the modern many-core makes it a distributed system, there yet remains one abstraction of "the guarantee" of what results the "eventually consistent" behavior, "portably". So, here it's just "stating the obvious".
Re: Consequential RCU Performance
Author: Bonita Montero
Date: Tue, 01 Dec 2026 09:41
Date: Tue, 01 Dec 2026 09:41
8 lines
2397 bytes
2397 bytes
Am 01.12.2026 um 10:37 schrieb Ross Finlayson: > What's relevant is that data-structures & algorithms have a purpose, > their use-case, what it is, then, the target environment has some > fixed conditions, what they are, what must be, it's not off-topic. What you say almost never fits in the context. Reading for nothing ...
Re: Consequential RCU Performance
Author: Ross Finlayson
Date: Tue, 01 Dec 2026 10:17
Date: Tue, 01 Dec 2026 10:17
39 lines
3590 bytes
3590 bytes
On 12/01/2026 01:41 AM, Bonita Montero wrote: > Am 01.12.2026 um 10:37 schrieb Ross Finlayson: > >> What's relevant is that data-structures & algorithms have a purpose, >> their use-case, what it is, then, the target environment has some >> fixed conditions, what they are, what must be, it's not off-topic. > > What you say almost never fits in the context. > Reading for nothing ... "This is of course very expensive and entirely un-scale-able." - Shilon, "Processor Design Secrets: what happens when you use std::atomic?", circa 1:02:00. What he's talking about is anything that uses "locks", the sections, fences or boundaries/barriers, then with regards to the only available facilities to make atomic operations (of which there's only "potential" or the "opportunistic" the "atomic transaction). Agreably I'm talking about atomics more than locks. "Necessary to actually be usable in locks" That's all I have to say about it, pointing out the obvious, then the usual notions from the distributed-systems of the "horizontal-independence" and "eventually-consistent" when there's only available "opportunistic-locking" arrive themselves. So: memory_order courtesy MFENCE & DMB on AMD & ARM is the usual thing: "very expensive and entirely un-scale-able". Then it was considered that what's of interest is the correctness and the performance.
Re: Consequential RCU Performance
Author: boltar
Date: Tue, 01 Dec 2026 10:20
Date: Tue, 01 Dec 2026 10:20
13 lines
2339 bytes
2339 bytes
On Tue, 1 Dec 2026 10:41:16 +0100 Bonita Montero <Bonita.Montero@gmail.com> gabbled: >Am 01.12.2026 um 10:37 schrieb Ross Finlayson: > >> What's relevant is that data-structures & algorithms have a purpose, >> their use-case, what it is, then, the target environment has some >> fixed conditions, what they are, what must be, it's not off-topic. > >What you say almost never fits in the context. >Reading for nothing ... I'm been convinced for a while that Ross Finlayson is an AI.
Re: Consequential RCU Performance
Author: Ross Finlayson
Date: Tue, 01 Dec 2026 10:27
Date: Tue, 01 Dec 2026 10:27
53 lines
4320 bytes
4320 bytes
On 12/01/2026 02:17 AM, Ross Finlayson wrote: > On 12/01/2026 01:41 AM, Bonita Montero wrote: >> Am 01.12.2026 um 10:37 schrieb Ross Finlayson: >> >>> What's relevant is that data-structures & algorithms have a purpose, >>> their use-case, what it is, then, the target environment has some >>> fixed conditions, what they are, what must be, it's not off-topic. >> >> What you say almost never fits in the context. >> Reading for nothing ... > > "This is of course very expensive and entirely un-scale-able." > - Shilon, "Processor Design Secrets: what happens when you use > std::atomic?", circa 1:02:00. > > What he's talking about is anything that uses "locks", the sections, > fences or boundaries/barriers, then with regards to the only available > facilities to make atomic operations (of which there's only "potential" > or the "opportunistic" the "atomic transaction). > > Agreably I'm talking about atomics more than locks. > > > "Necessary to actually be usable in locks" > > > That's all I have to say about it, pointing out the obvious, > then the usual notions from the distributed-systems of the > "horizontal-independence" and "eventually-consistent" when > there's only available "opportunistic-locking" arrive themselves. > > So: memory_order courtesy MFENCE & DMB on AMD & ARM is the usual > thing: "very expensive and entirely un-scale-able". > Then it was considered that what's of interest is > the correctness and the performance. > > > > > Agreeably, I _learned_ something, challenging what were implicit assumptions, and making a model of _learning_, to understand from that the _language_ side and the _hardware_ side, in this case, variously the _ideal_ and the _analytical_ either and both ways, that their changes in various ways, make for that the _highest_ performance for _absolute_ correctness is further refined the account, in this sort of manner. So, for the scaling while giving the guarantee, then it doesn't take more than a generous reading to see the point.
Re: Consequential RCU Performance
Author: Ross Finlayson
Date: Tue, 01 Dec 2026 10:39
Date: Tue, 01 Dec 2026 10:39
77 lines
5087 bytes
5087 bytes
On 12/01/2026 02:27 AM, Ross Finlayson wrote: > On 12/01/2026 02:17 AM, Ross Finlayson wrote: >> On 12/01/2026 01:41 AM, Bonita Montero wrote: >>> Am 01.12.2026 um 10:37 schrieb Ross Finlayson: >>> >>>> What's relevant is that data-structures & algorithms have a purpose, >>>> their use-case, what it is, then, the target environment has some >>>> fixed conditions, what they are, what must be, it's not off-topic. >>> >>> What you say almost never fits in the context. >>> Reading for nothing ... >> >> "This is of course very expensive and entirely un-scale-able." >> - Shilon, "Processor Design Secrets: what happens when you use >> std::atomic?", circa 1:02:00. >> >> What he's talking about is anything that uses "locks", the sections, >> fences or boundaries/barriers, then with regards to the only available >> facilities to make atomic operations (of which there's only "potential" >> or the "opportunistic" the "atomic transaction). >> >> Agreably I'm talking about atomics more than locks. >> >> >> "Necessary to actually be usable in locks" >> >> >> That's all I have to say about it, pointing out the obvious, >> then the usual notions from the distributed-systems of the >> "horizontal-independence" and "eventually-consistent" when >> there's only available "opportunistic-locking" arrive themselves. >> >> So: memory_order courtesy MFENCE & DMB on AMD & ARM is the usual >> thing: "very expensive and entirely un-scale-able". >> Then it was considered that what's of interest is >> the correctness and the performance. >> >> >> >> >> > > Agreeably, I _learned_ something, challenging what were implicit > assumptions, and making a model of _learning_, to understand from > that the _language_ side and the _hardware_ side, in this case, > variously the _ideal_ and the _analytical_ either and both ways, > that their changes in various ways, make for that > the _highest_ performance for _absolute_ correctness > is further refined the account, in this sort of manner. > > So, for the scaling while giving the guarantee, then > it doesn't take more than a generous reading to see the point. > > That Ofek Shilon has some other interesting talks on video, like "C++ Deep Dive: Memory Barriers and Cache Coherence". Hm, I was "Viewer #863". Here though it was already pointed out that there's compare-and-swap called compare-exchange/LL-SC and its only guarantee of being atomic is luck and retries and UUID-vending its own challenge to make for load-linked/store-conditional as "fetch-then-test-and-swap-else-error", that otherwise is "halting the cores and bus", "very expensive and entirely un-scale-able". "I will try to make the distinction where it has meaning." - Shilon on "the memory model"
Re: Consequential RCU Performance
Author: Bonita Montero
Date: Tue, 01 Dec 2026 12:06
Date: Tue, 01 Dec 2026 12:06
4 lines
2285 bytes
2285 bytes
Am 01.12.2026 um 11:20 schrieb boltar@caprica.universe: > I'm been convinced for a while that Ross Finlayson is an AI. Perhaps a traumatized AI.
Re: Consequential RCU Performance
Author: Chris M. Thomasson
Date: Tue, 01 Dec 2026 20:21
Date: Tue, 01 Dec 2026 20:21
41 lines
3709 bytes
3709 bytes
On 12/1/2026 12:49 AM, Ross Finlayson wrote: > On 11/30/2026 09:15 PM, Chris M. Thomasson wrote: >> On 11/30/2026 9:02 PM, Bonita Montero wrote: >>> Am 30.11.2026 um 23:21 schrieb Chris M. Thomasson: >>> >>>> Why do you refuse to use your idea for a common RCU pattern? >>>> Just code it up! ... >>> >>> You are truly the embodiment of insecurity—feeling the need to apply >>> your rigid patterns of thought to situations you don’t understand. >> >> God! You are the one that says RCU is not needed. But you outright >> refuse to show how your work can be used in its place for one of RCU's >> major and most common usage pattern. Go figure? > > Modern chips these days the many-core are simply as a > distributed-system, in the horizontally scale-able best one can hope in > the "generally independent" is compare-and-swap a.k.a. > load-linked/store-conditional, one smallest/atomic piece of memory, > opportunistically "locked". A simple example, one of many... Take a single producer/single consumer (SPSC) queue. Show me where it needs any atomic RMW's? Guess what, it does not. However, it does need proper memory visibility! In C/C++ terms, memory_order... > Of course there are many accounts of hardware synchronization, > or, there are a few, various among architectures, of which > there aren't that many. > > Of course synchronization more generally in the co-operative > is for protocols, those introducing dependency / not-independency, > then that eventually there's for leader-election or straw-pulling, > and wider synchronization-points: for the otherwise independent > and the least inter-dependency: there's only one reliable common > idiom, and it's highly contended. It sounds as if you don't have a heck of a lot of experience with such things?
Re: Consequential RCU Performance
Author: Chris M. Thomasson
Date: Tue, 01 Dec 2026 20:27
Date: Tue, 01 Dec 2026 20:27
20 lines
2672 bytes
2672 bytes
On 11/30/2026 9:25 PM, Bonita Montero wrote: > Am 01.12.2026 um 06:15 schrieb Chris M. Thomasson: > >> God! You are the one that says RCU is not needed. ... > Yes, it's too complicated for what it is used for. Oh really? Humm... By the way, you still need to show how your work can be used to implement one of its most common use cases, right? I need to repeat. Readers iterating a shared data structure, say linked list full speed ahead while writers are active. Readers are golden here. No heavy membars (storeload), no atomic RMW, etc... > Any my solution is as efficient and allows immediate reclamation. Really? You should talk to the linux kernel guys. Tell them that you have something that can replace all of their use cases of RCU.
Re: Consequential RCU Performance
Author: Chris M. Thomasson
Date: Tue, 01 Dec 2026 22:05
Date: Tue, 01 Dec 2026 22:05
43 lines
3094 bytes
3094 bytes
On 11/30/2026 5:05 PM, Chris M. Thomasson wrote: > On 11/30/2026 4:38 PM, Joseph Seigh wrote: >> On 11/30/26 5:25 PM, Chris M. Thomasson wrote: >>> On 11/30/2026 8:55 AM, jseigh wrote: >>>> On 11/27/26 12:31, Joseph Seigh wrote: >>>>> I ran some performance measurements on the reader side, no write >>>>> updates, for a plain linked list traversal, 2 slightly different >>>>> consequential rcu traversals, and traversals using hazard >>>>> pointers w/o and w/ a store/load memory barrier. >>>>> >>>>> Timings are per node access. Depth is the size of the list. >>>>> >>>> Updated hazard pointer traversal to use 2 hazard pointers. >>>> Add a wait-free hazard pointer (w/o mb) which only >>>> uses 1 hazard pointer. >>>> >>> [...] >>>> base: elapsed = 2102889 ( 4441250) >>>> avg = 1.05144 nsecs ( 2.22063 cycles) >>>> cseq1: elapsed = 2128434 ( 4495216) >>>> avg = 1.06422 nsecs ( 2.24761 cycles) >>>> cseq2: elapsed = 2144710 ( 4529588) >>>> avg = 1.07235 nsecs ( 2.26479 cycles) >>>> hzptr: elapsed = 2430719 ( 5133628) >>>> avg = 1.21536 nsecs ( 2.56681 cycles) >>>> hzptr_mb: elapsed = 14681514 ( 31006950) >>>> avg = 7.34076 nsecs (15.50347 cycles) >>>> hzptr wf: elapsed = 1991515 ( 4206044) >>>> avg = 0.99576 nsecs ( 2.10302 cycles) >>>> >>> >>> Looking pretty damn good! What is the difference between hzptr_mb (I >>> assume traditional hazard pointers) vs hzptr wf ? >> >> >> hzptr is w/o the store/load membar >> hzptr_mb is w/ the store/load membar >> hzptr_wf is loop free and w/o membar. > > hzptr_wf is interesting to me. You still have a run a scan process to > determine when a node is quiescent, right? Sorry for altering the subject.
Re: Consequential RCU Performance
Author: Ross Finlayson
Date: Tue, 01 Dec 2026 23:43
Date: Tue, 01 Dec 2026 23:43
124 lines
7367 bytes
7367 bytes
On 12/01/2026 12:21 PM, Chris M. Thomasson wrote: > On 12/1/2026 12:49 AM, Ross Finlayson wrote: >> On 11/30/2026 09:15 PM, Chris M. Thomasson wrote: >>> On 11/30/2026 9:02 PM, Bonita Montero wrote: >>>> Am 30.11.2026 um 23:21 schrieb Chris M. Thomasson: >>>> >>>>> Why do you refuse to use your idea for a common RCU pattern? >>>>> Just code it up! ... >>>> >>>> You are truly the embodiment of insecurity—feeling the need to apply >>>> your rigid patterns of thought to situations you don’t understand. >>> >>> God! You are the one that says RCU is not needed. But you outright >>> refuse to show how your work can be used in its place for one of RCU's >>> major and most common usage pattern. Go figure? >> >> Modern chips these days the many-core are simply as a >> distributed-system, in the horizontally scale-able best one can hope in >> the "generally independent" is compare-and-swap a.k.a. >> load-linked/store-conditional, one smallest/atomic piece of memory, >> opportunistically "locked". > > A simple example, one of many... Take a single producer/single consumer > (SPSC) queue. Show me where it needs any atomic RMW's? Guess what, it > does not. However, it does need proper memory visibility! In C/C++ > terms, memory_order... > > >> Of course there are many accounts of hardware synchronization, >> or, there are a few, various among architectures, of which >> there aren't that many. >> >> Of course synchronization more generally in the co-operative >> is for protocols, those introducing dependency / not-independency, >> then that eventually there's for leader-election or straw-pulling, >> and wider synchronization-points: for the otherwise independent >> and the least inter-dependency: there's only one reliable common >> idiom, and it's highly contended. > > It sounds as if you don't have a heck of a lot of experience with such > things? > Distributed systems as horizontally-independent (and many/multiple) thus horizontally-scale-able with eventual consistency and the critically transactional bottleneck and about opportunistic locking? Yeah, a lot. About SPSC, I don't see that needing synchronization at all, with the producer producing one at a time and consumer consuming one at a time. As a doubly-linked list inside, for example, vis-a-vis modern accounts like just using ring-buffers, equivalently, and chasing the pointers either up-and-down or around-and-round, then about whether the consumer is to block when the queue's empty, I suppose that's for semaphores usually or monitors, i.e., that the producer produces whenever it wants then if the queue is "full" it must block (or fail), the consumer consumes whenever it can then if the queue is "empty" it must block (and usually not fail), like I mentioned the other day when the operating system supports that each of the producer and consumer would be different threads and for example processes when light-weight-processes are pthreads, then about whether C++'s account of semaphore makes for blocking _according to the operating system scheduler_, that otherwise it just has that producer pushes links/datums onto the head (or tail, respectively, either way) and consumer pops links from the other end, if non-null, that according to visibilityL the consumer if it's blocking when the queue is empty should poll once at a minimal sort of interval, since it could only be waiting for memory coherency, then take to sleep if it's empty twice (that the producer producing to an empty queue has the responsibility to wake the semaphore). So, that's not so much "synchronization" as "sending a message". About the mentioned talk, for example, I went and found some modern reference or that O. Shilon bit, and had them make the point about that memory_order is orders of magnitude slower than compare-exchange, and that it's what's reliable and performant on modern architectures, he seemed to have enough experience to make sense to me. "Semaphore", "countdown latch", "latch", ..., so, I guess that's "synchronization". Then, there might as well be latches on the "empty" and "full" besides "head" and "tail". About multiple consumers, again "one item at a time", about the difference between "one item at a time" and "batch" or "sequence" which would suggest the consumer forming the input batch in their own memory in the otherwise internal representation, or getting vended a holder to copy it into, otherwise that consumers can peek the tail and then about that the queue issues it a serial number, then do the RMW(F) in which case to enter the busy loop until empty. It seems "SPSC" and so on, or as with regards to the common definitions of the "queue" usually of items, that when it's a "train", say, with multiple items that aren't to be interleaved, multiple items instead of single items, that's there's "SPSC SI", "SPSC MI", "MCMP SI", "MCSP MI", .... "Just use Kafka", sure, why not, though, you know, there are error cases on the MI, about drops/dupes, and for example these are given as "acceptable" errors yet that's not really a word. Anyways the above comment about the "unique:same" and "unique:different" always together is considered profound. Warm regards
Re: Consequential RCU Performance
Author: Joseph Seigh
Date: Wed, 02 Dec 2026 02:02
Date: Wed, 02 Dec 2026 02:02
28 lines
2356 bytes
2356 bytes
On 11/30/26 8:05 PM, Chris M. Thomasson wrote: > On 11/30/2026 4:38 PM, Joseph Seigh wrote: >> On 11/30/26 5:25 PM, Chris M. Thomasson wrote: >>> On 11/30/2026 8:55 AM, jseigh wrote: ... >>> >>> Looking pretty damn good! What is the difference between hzptr_mb (I >>> assume traditional hazard pointers) vs hzptr wf ? >> >> >> hzptr is w/o the store/load membar >> hzptr_mb is w/ the store/load membar >> hzptr_wf is loop free and w/o membar. > > hzptr_wf is interesting to me. You still have a run a scan process to > determine when a node is quiescent, right? Yeah, that part looks mostly the same for all the hazard pointer implementations. Despite hazard pointers being in C++26, the api isn't really here yet. I had to do a bit of augury on the folly library to figure out the api. Folly is the library equivalent of a junk drawer. Anyway, performance is a hard sell in a largely complacent marketplace. So not a lot of incentive to actually implement these apart from doing a POC maybe.
Re: Consequential RCU Performance
Author: Bonita Montero
Date: Wed, 02 Dec 2026 04:16
Date: Wed, 02 Dec 2026 04:16
14 lines
2517 bytes
2517 bytes
Am 01.12.2026 um 21:27 schrieb Chris M. Thomasson: > By the way, you still need to show how your work can be used to > implement one of its most common use cases, right? I need to repeat. > Readers iterating a shared data structure, say linked list full speed > ahead while writers are active. Readers are golden here. No heavy > membars (storeload), no atomic RMW, etc... There's not mpost comm usage pattern. > Really? You should talk to the linux kernel guys. ... Yes, they could.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads