SlideShare a Scribd company logo
Yet Another Introduction to
Linux RCU
Viller Hsiao <villerhsiao@gmail.com>
May. 14, 2015
9/3/16 2/60
Who am I ?
Viller Hsiao
Embedded Linux / RTOS engineer
  
http://image.dfdaily.com/2012/5/4/634716931128751250504b050c1_nEO_IMG.jpg
9/3/16 3/60
http://www.anec.com/assets/images/call_before_you_dig.jpg
Presented For HCSM
9/3/16 4/60
What is RCU ?
●
Read-Copy Update
●
A kind of read/write synchronization
mechanism
9/3/16 5/60
Agenda
●
Synchronization inside Linux
●
RCU basic operations
●
Linux RCU internal
9/3/16 6/60
Synchronization Synchronization 
insideinside
Linux KernelLinux Kernel
9/3/16 7/60
R/W Synchronization in SMP System
●
Protect Shared data from concurrent access
●
Synchronization mechanism
●
atomic operation
●
spinlock
●
reader-writer spinlock (rwlock)
●
seqlock
●
RCU
9/3/16 8/60
Atomic Operation
●
Operations that read and change data within a
single, uninterruptible step
●
Architecture support
●
test-and-set (TSR)
●
compare-and-swap (CAS)
●
load-link/store-conditional (ll/sc)
9/3/16 9/60
spinlock
Owner 3 update
Owner 2 read
Owner 1 read
spin
spinsp
in
spin
update
●
Implement by mutual exclusive
u
u
u
u
9/3/16 10/60
rwlock
●
Allow multi reader
●
Mutual exclusive between reader and writer
Reader3
Writer update
read
Reader2 read
Reader1 read
spin
read
read
read
spin
spin
spinsp
in
spinsp
in
sp
in
u
u
u u
u
u
u
9/3/16 11/60
seqlock
●
Consistent mechanism without starving writers.
Reader
Writer Update data
seq = 1 seq = 2
seq = 0 seq = 2 seq = 2
RetryFirst trial
Start with even seq Same seq with start point
9/3/16 12/60
Architecture Support – Atomic Ops
●
Load-link store-conditional
– e.g. ARMv7 ldrex/strex
http://infocenter.arm.com/help/topic/com.arm.doc.ddi0360f/graphics/exclusive_monitor_state_machine2.svg
9/3/16 13/60
Architecture Support – Barrier
●
Optimization in modern computer architecture
●
Optimizing compilers
●
Multi-issuing
●
Out-of-Order Execution
●
Load/Store optimization
●
… etc
CPU 1 CPU 2
====== =======
{ A = 1; B = 2 }
A = 3; x = B;
B = 4; y = A;
CPU 1 CPU 2
====== =======
{ A = 1; B = 2 }
A = 3; x = B;
B = 4; y = A;
9/3/16 14/60
Architecture Support – Barrier (Cont.)
●
Compiler barrier
●
CPU barrier instructions
●
Ensure the order of some operations
●
e.g. dmb/dsb/isb, ldar/stlr
void foo()
{
    A = B + 1;
    asm volatile("" ::: "memory");
    B = 0;
}
void foo()
{
    A = B + 1;
    asm volatile("" ::: "memory");
    B = 0;
}
9/3/16 15/60
The problem
●
Bad in scalability and performance
●
Multiple CPUs to break even with single CPU
http://www.rdrop.com/~paulmck/RCU/RCU.2014.05.18a.TU-Dresden.pdf
9/3/16 16/60
RCU Basic OperationRCU Basic Operation
9/3/16 17/60
RCU Operations – Read
rcu_read_lock();
p = rcu_dereference(gp); /* p = gp */
if (p != NULL) {
c do_something(p->a, p->b);
}
rcu_read_unlock();
rcu_read_lock();
p = rcu_dereference(gp); /* p = gp */
if (p != NULL) {
c do_something(p->a, p->b);
}
rcu_read_unlock();
Read side
Critical section
●
Blocking/preemption within an RCU read-side critical
section is illegal
9/3/16 18/60
RCU Operations – Update & Reclaim
q = kmalloc(sizeof(*q), GFP_KERNEL);
q->a = 1;
q->b = 2;
rcu_assign_pointer(gp, q); /* gp = q */
synchronize_rcu(); /* call_rcu (&callbacks()) */
kfree(p);
q = kmalloc(sizeof(*q), GFP_KERNEL);
q->a = 1;
q->b = 2;
rcu_assign_pointer(gp, q); /* gp = q */
synchronize_rcu(); /* call_rcu (&callbacks()) */
kfree(p);
Removal
(Updater)
Reclaimer
●
Maintain multiple version of recently updated object
●
Spinlock is acquired if multiple udpater
9/3/16 19/60
RCU Primitives
READER
UPDATER RECLAIMER
rcu_dereference()
rcu_assign_pointer()
rcu_read_lock()
rcu_read_unlock()
call_rcu()
synchronize_rcu()
wmb
rmb only on
DEC alpha
preempt­disable
only if
preemptible kernel
Re-painted from [13]
9/3/16 20/60
Quiz: Why does it improve scalability in
read side?
9/3/16 21/60
Why RCU is better?
●
Almost nothing in read side lock (non preempt
kernel)
static inline void rcu_read_lock(void)
{
__asm__ __volatile__("": : :"memory");
(void) 0;
do { } while (0);
do { } while (0);
}
static inline void rcu_read_lock(void)
{
__asm__ __volatile__("": : :"memory");
(void) 0;
do { } while (0);
do { } while (0);
}
Real content of rcu_read_lock() after preprocessor. (! PREEMPT)
9/3/16 22/60
Read side Lock Overhead Comparison
http://lwn.net/images/ns/kernel/rcu/rwlockRCUperf.jpg
9/3/16 23/60
What's the benifit?
●
Zero-overhead and wait-free in read side
●
No memory barrier is required
●
No lock is required
●
Allow recursive lock
●
No deadlock between readers and writer
9/3/16 24/60
RCU List APIs [10]
Operations list
Circular doubly linked list
hlist
Linear doubly linked list
Initialization INIT_LIST_HEAD_RCU()
Full traversal list_for_each_entry_rcu() hlist_for_each_entry_rcu()
hlist_for_each_entry_rcu_bh()
hlist_for_each_entry_rcu_notrace()
Resume traversal list_for_each_entry_continue_rcu() hlist_for_each_entry_continue_rcu()
hlist_for_each_entry_continue_rcu_bh()
Stepwise traversal list_entry_rcu()
list_first_or_null_rcu()
list_next_rcu()
list_first_rcu()
hlist_next_rcu()
hlist_pprev_rcu()
Add list_add_rcu()
list_add_tail_rcu()
hlist_add_after_rcu()
hlist_add_before_rcu()
hlist_add_head_rcu()
Delete list_del_rcu() hlist_del_rcu()
hlist_del_init_rcu()
Replacement list_replace_rcu() hlist_replace_rcu()
Splice list_splice_init_rcu()
9/3/16 25/60
RCU Model
Removal ReclamationGrace Period
Reader
Reader
Reader
Reader
Reader
Reader Reader
Reader Reader
Repainted from https://lwn.net/images/ns/kernel/rcu/GracePeriodGood.png
9/3/16 26/60
RCU vs rwlock
●
RCU has lower overhead and better scalability
●
RCU readers see updated data faster
●
rwlock readers get the consistent data after writer updated
c
https://lwn.net/Articles/263130/
9/3/16 27/60
Replace rwlock by RCU[13]
http://en.wikipedia.org/wiki/Read-copy-update
9/3/16 28/60
Replace rwlock by RCU[13]
http://en.wikipedia.org/wiki/Read-copy-update
9/3/16 29/60
What is RCU, again
●
Read-Copy Update
●
A kind of read-write synchronization mechanism
●
A publish-subscribe mechanism[5]
●
A poor man's garbage collector[5]
9/3/16 30/60
But
Quiz: How does reclaimer know the time
to release old object?
9/3/16 31/60
Linux RCU InternalLinux RCU Internal
9/3/16 32/60
History and Contributors[9][13]
●
1980 H. T. Kung and Q. Lehman 
●
use of garbage collectors to defer destruction of nodes in a parellel binary search tree.
●
1986, Hennessy, Osisek, and Seigh
●
Passive serialization, which is an RCU­like mechanism that relies on the presence of "quiescent states" in 
the VM/XA hypervisor 
●
1995 J. Slingwine and P. E. McKenney
●
US Patent 5,442,758, implement RCU in DYNIX/ptx kernel.
●
2002, D. Sarma
●
added RCU to version 2.5.43 of the Linux kernel
●
2005, P. E. McKenney
●
Permitting preemption of RCU realtime critical sections
●
2009, P. E. McKenny 
●
Introduce user­level RCU implementation
●
Work of P. E. McKenney, Mathieu Desnoyers, Alan Stern, Michel Dagenais, Manish Gupta, Maged 
Michael, Phil Howard, Joshua Triplett, Jonathan Walpole, and the Linux kernel community
9/3/16 33/60
The Problem
●
How can we know when it's safe to reclaim
memory without paying too high a cost?
●
especially in the read path
●
Possible implementation
– Reference count
– Hazard pointer
~ The page is extracted and tweaked from [14]
9/3/16 34/60
Lock-based Synchronization Model
Reader nReader 1
Update nUpdater 1
Reader 1
Reader 1
Reader n
Reader n
<lock icon url>
Obj 1 Obj n
9/3/16 35/60
RCU Synchronization Model
RCU Core
Reader 2 Reader nReader 1
Reclaimer 2 Reclaimer nReclaimer 1
Update 2 Update nUpdater 1
Reader 1
Reader 1
Reader 2
Reader 2
Reader n
Reader n
9/3/16 36/60
Terms
●
Recall that constraint of read side critical
section operations
●
Non-blocked inside read lock (!PREEMPT)
●
Non-preempted (PREEMPT)
●
Irq disable, bh disable imply read side critical
section
9/3/16 37/60
Terms – Grace Period
Removal ReclamationGrace Period
Reader
Reader
Reader
Reader
Reader
Reader Reader
Reader Reader
Repainted from https://lwn.net/images/ns/kernel/rcu/GracePeriodGood.png
9/3/16 38/60
Terms – Quiescent State
Reader Reader Reader
Quiescent State
●
Period outside the read critical section
●
It implies complete of one grace period in its CPU
9/3/16 39/60
Toy RCU Implementation
#define rcu_assign_pointer(p, v) 
({ 
        smp_wmb(); 
        (p) = (v); 
})
void synchronize_rcu(void)
{
        int cpu;
        for_each_online_cpu(cpu)
                run_on(cpu);
}
#define rcu_assign_pointer(p, v) 
({ 
        smp_wmb(); 
        (p) = (v); 
})
void synchronize_rcu(void)
{
        int cpu;
        for_each_online_cpu(cpu)
                run_on(cpu);
}
#define rcu_read_lock()
#define rcu_read_unlock()
#define rcu_dereference(p) 
({ 
        typeof(p) _p1 = (*(volatile typeof(p)*)&(p)); 
        smp_read_barrier_depends(); 
        _p1; 
})
#define rcu_read_lock()
#define rcu_read_unlock()
#define rcu_dereference(p) 
({ 
        typeof(p) _p1 = (*(volatile typeof(p)*)&(p)); 
        smp_read_barrier_depends(); 
        _p1; 
})
Read
Update
9/3/16 40/60
RCU Core State
CPU 0: call_rcu(cb)
RCU State
list 0 cb cb cb
list 1 cb cb cb
list n cb cb cb
Quiescent State Recorder
CPU 0 CPU 1 CPU n
9/3/16 41/60
Quiescent State
●
Condition of quiescent state
●
Context switch
●
Dynticks or idle
●
User mode execution
●
Check RCU state and execute RCU operations
in system background
9/3/16 42/60
RCU Implementation – Classical RCU
●
a.k.a tiny RCU
●
Single data structure to record Quiescent State
●
Scalability is not good for large numbers of CPUs,
e.g. 4096 CPUs
http://lwn.net/Articles/305782/
9/3/16 43/60
RCU Implementation – Hirarchical RCU
●
a.k.a tree RCU
●
Towards a more scalable RCU implementation
●
Default solution in Linux kernel
http://lwn.net/Articles/305782/
9/3/16 44/60
Tree RCU Core – List Operations
CPU x
call_rcu(cb)
cb1 cb2 cbxnxtlist cb0
DONE
TAIL
WAIT
TAIL
NEXT READY
TAIL
NEXT
TAIL
cb
Next
Complete
(DONE)
Next
Complete
(WAIT)
Next
Complete
(NXTRDY)
Next
complete
CPUx
RCU Data
RCU State /
RCU Node gpnum complete
gpnum complete
gpnum
complete
9/3/16 45/60
Tree RCU Core – System Components
invoke_rcu_core()
rcu_gp_kthread_invoke()
Put callback
into list
Updater
call_rcu()
tick_handle_periodic
rcu_check_callback()
RCU SOFTIRQ
rcu_process_callbacks()
rcu_gp_kthread
Process GP
Call callback
rcu_do_batch()
Pass QSs
rcu_bh_qs()
rcu_sched_qs()
invoke_rcu_core()
9/3/16 46/60
Tree RCU Core
http://lwn.net/images/ns/kernel/brcu/RCUbweBlock.png
9/3/16 47/60
RCU state: rcu-sched vs rcu-bh
●
What the #$I#@(&!!! is RCU-bh For???
●
Ran a DDoS workload that hung the system
– Load was so heavy that system never left irq!!!
●
No context switches, no quiescent states, no grace periods
– Eventually, OOM!!!
●
Dipankar created RCU-bh
●
Additional quiescent state in softirq execution
●
Routing cache converted to RCU-bh, then withstood DDoS”
~ The page is extracted from [8]
9/3/16 48/60
Condition of Quiescent State
●
rcu_sched
●
Context switch
●
Dynticks or idle
●
User mode execution
●
rcu_bh
●
Any code outside of softirq with interrupt enabled
9/3/16 49/60
Condition of Quiescent State
●
When to check it?
●
Scheduler
●
__do_softirq()
●
Scheduler clock interrupt handler
– rcu_check_callbacks()
9/3/16 50/60
RCU Stall[16]
●
Possiblility of memory leak if it takes a long grace period
●
Force Quiescent state
●
Part of conditions of which RCU stall happened
●
Documentation/RCU/stallwarn.txt
●
A CPU looping in an RCU read-side critical section.
●
A CPU looping with interrupts disabled. This condition can result in RCU-
sched and RCU-bh stalls.
●
A CPU looping with preemption disabled. This condition can result in RCU-
sched stalls and, if ksoftirqd is in use, RCU-bh stalls.
●
A CPU looping with bottom halves disabled. This condition can result in
RCU-sched and RCU-bh stalls.
9/3/16 51/60
Topic – Sleepable RCU[2]
●
Blocking or sleeping of any sort is strictly prohibited
in classical RCU. This has frequently been an obstacle
to the use of RCU
●
Implement the sleepable RCU (SRCU) that permits
arbitrary sleeping (or blocking) within RCU read-side
critical sections.
9/3/16 52/60
Topic – Userspace RCU[7]
●
Use cases
●
LTTng
●
Atomic operation API utilities
●
Barrier
●
URCU protected hash
●
URCU stack/queue API
9/3/16 53/60
Other Topics
●
Dynticks
●
When some CPU is sleeping in dynticks mode
– Waking up CPU for quiescent state consumes power
– Extened its quiescent state
●
Use RCU in kernel module
●
CPU hotplugs
●
nocb
●
realtime
●
RCU priority boost
9/3/16 54/60
RCU Uses in Linux Kernel
http://www2.rdrop.com/~paulmck/RCU/linuxusage.html
9/3/16 55/60
What is RCU's Area of Applicability?
●
Choose the suitable mechanism for your
application
https://www.kernel.org/pub/linux/kernel/people/paulmck/Answers/RCU/RCUAreaApp.html
9/3/16 56/60
Q & A
9/3/16 57/60
Reference
[1] McKenney, Paul E., “Introduction to RCU”
[2] McKenney Paul E. (Oct. 2006), “Sleepable RCU”, LWN
[3] McKenney Paul E. (Feb. 2007), “Priority-Boosting RCU Read-Side Critical Sections ”, LWN
[4] McKenney, Paul E.; Walpole, Jonathan (Dec. 2007), “What is RCU, Fundamentally?”, LWN.
[5] McKenney Paul E. (Dec. 2007), “What is RCU? Part 2: Usage”, LWN.
[6] McKenney Paul E. (Dec. 2008), “Hierarchical RCU”, LWN.
[7] McKenney Paul E. (Nov. 2013), “User-space RCU”, LWN
[8] McKenney, Paul E. (Sep. 2009), “RCU and Breakage ”, presented to Netconf 2009
[9] McKenney, Paul E. (May 2014), “What Is RCU? ”, presented to TU Dresden Distributed OS class
[10] Jake (Sep. 2014), "The RCU API tables", LWN.
[11] Wiki: “Load-link/store-conditional”
[12] Wiki: “Memory Barrier”
[13] Wiki: “Read-Copy Update”
9/3/16 58/60
Reference (Cont.)
[12] 杨燚 , (Jul. 2005), “ Linux 2.6内核中新的锁机制--RCU“ , IBM Developer Work
[13] Leiflindholm, (Mar. 2011), “Memory access ordering - an introduction”, ARM Connected
Community
[14] Walpole, Jonathan (2014), “CS510 Concurrent Systems: What is RCU, Fundamentally?”
[15] “What is RCU's Area of Applicability?”
[16] All Linux kernel documentations under Documentation/RCU/
9/3/16 59/60
●
ARM are trademarks or registered trademarks of ARM Holdings.
●
DYNIX (short for DYNamic unIX) is an operating system developed by Sequent Computer
Systems.
●
Linux is a registered trademark of Linus Torvalds.
●
The RCU, spinlock, seqlock are the joint work of its maintainers and the Linux kernel
community.
●
HCSM is the community of Hsinchu Coders in Taiwan.
●
Other company, product, and service names may be trademarks or service marks
of others.
●
The license of each graph belongs to each website listed individually.
●
The others of my work in the slide is licensed under a CC-BY-SA License.
●
License text: http://creativecommons.org/licenses/by-sa/4.0/legalcode
Rights to Copy
copyright © 2015 Viller Hsiao
9/3/16 Viller Hsiao
THE END

More Related Content

What's hot

DPDK In Depth
DPDK In DepthDPDK In Depth
DPDK In Depth
Kernel TLV
 
Fast Userspace OVS with AF_XDP, OVS CONF 2018
Fast Userspace OVS with AF_XDP, OVS CONF 2018Fast Userspace OVS with AF_XDP, OVS CONF 2018
Fast Userspace OVS with AF_XDP, OVS CONF 2018
Cheng-Chun William Tu
 
Time Sensitive Networking in the Linux Kernel
Time Sensitive Networking in the Linux KernelTime Sensitive Networking in the Linux Kernel
Time Sensitive Networking in the Linux Kernel
henrikau
 
マルチコアとネットワークスタックの高速化技法
マルチコアとネットワークスタックの高速化技法マルチコアとネットワークスタックの高速化技法
マルチコアとネットワークスタックの高速化技法
Takuya ASADA
 
I/O仮想化最前線〜ネットワークI/Oを中心に〜
I/O仮想化最前線〜ネットワークI/Oを中心に〜I/O仮想化最前線〜ネットワークI/Oを中心に〜
I/O仮想化最前線〜ネットワークI/Oを中心に〜
Ryousei Takano
 
Fun with Network Interfaces
Fun with Network InterfacesFun with Network Interfaces
Fun with Network Interfaces
Kernel TLV
 
eBPF - Rethinking the Linux Kernel
eBPF - Rethinking the Linux KerneleBPF - Rethinking the Linux Kernel
eBPF - Rethinking the Linux Kernel
Thomas Graf
 
Meet cute-between-ebpf-and-tracing
Meet cute-between-ebpf-and-tracingMeet cute-between-ebpf-and-tracing
Meet cute-between-ebpf-and-tracing
Viller Hsiao
 
Understanding DPDK
Understanding DPDKUnderstanding DPDK
Understanding DPDK
Denys Haryachyy
 
10GbE時代のネットワークI/O高速化
10GbE時代のネットワークI/O高速化10GbE時代のネットワークI/O高速化
10GbE時代のネットワークI/O高速化
Takuya ASADA
 
Analysis of Open-Source Drivers for IEEE 802.11 WLANs
Analysis of Open-Source Drivers for IEEE 802.11 WLANsAnalysis of Open-Source Drivers for IEEE 802.11 WLANs
Analysis of Open-Source Drivers for IEEE 802.11 WLANs
Danh Nguyen
 
Dpdk applications
Dpdk applicationsDpdk applications
Dpdk applications
Vipin Varghese
 
DPDK KNI interface
DPDK KNI interfaceDPDK KNI interface
DPDK KNI interface
Denys Haryachyy
 
Introduction to DPDK
Introduction to DPDKIntroduction to DPDK
Introduction to DPDK
Kernel TLV
 
Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking Explained
Thomas Graf
 
Xdp and ebpf_maps
Xdp and ebpf_mapsXdp and ebpf_maps
Xdp and ebpf_maps
lcplcp1
 
Linux Internals - Part II
Linux Internals - Part IILinux Internals - Part II
Linux Internals - Part II
Emertxe Information Technologies Pvt Ltd
 
Linux Locking Mechanisms
Linux Locking MechanismsLinux Locking Mechanisms
Linux Locking Mechanisms
Kernel TLV
 
DPDK in Containers Hands-on Lab
DPDK in Containers Hands-on LabDPDK in Containers Hands-on Lab
DPDK in Containers Hands-on Lab
Michelle Holley
 
Network Drivers
Network DriversNetwork Drivers
Network Drivers
Anil Kumar Pugalia
 

What's hot (20)

DPDK In Depth
DPDK In DepthDPDK In Depth
DPDK In Depth
 
Fast Userspace OVS with AF_XDP, OVS CONF 2018
Fast Userspace OVS with AF_XDP, OVS CONF 2018Fast Userspace OVS with AF_XDP, OVS CONF 2018
Fast Userspace OVS with AF_XDP, OVS CONF 2018
 
Time Sensitive Networking in the Linux Kernel
Time Sensitive Networking in the Linux KernelTime Sensitive Networking in the Linux Kernel
Time Sensitive Networking in the Linux Kernel
 
マルチコアとネットワークスタックの高速化技法
マルチコアとネットワークスタックの高速化技法マルチコアとネットワークスタックの高速化技法
マルチコアとネットワークスタックの高速化技法
 
I/O仮想化最前線〜ネットワークI/Oを中心に〜
I/O仮想化最前線〜ネットワークI/Oを中心に〜I/O仮想化最前線〜ネットワークI/Oを中心に〜
I/O仮想化最前線〜ネットワークI/Oを中心に〜
 
Fun with Network Interfaces
Fun with Network InterfacesFun with Network Interfaces
Fun with Network Interfaces
 
eBPF - Rethinking the Linux Kernel
eBPF - Rethinking the Linux KerneleBPF - Rethinking the Linux Kernel
eBPF - Rethinking the Linux Kernel
 
Meet cute-between-ebpf-and-tracing
Meet cute-between-ebpf-and-tracingMeet cute-between-ebpf-and-tracing
Meet cute-between-ebpf-and-tracing
 
Understanding DPDK
Understanding DPDKUnderstanding DPDK
Understanding DPDK
 
10GbE時代のネットワークI/O高速化
10GbE時代のネットワークI/O高速化10GbE時代のネットワークI/O高速化
10GbE時代のネットワークI/O高速化
 
Analysis of Open-Source Drivers for IEEE 802.11 WLANs
Analysis of Open-Source Drivers for IEEE 802.11 WLANsAnalysis of Open-Source Drivers for IEEE 802.11 WLANs
Analysis of Open-Source Drivers for IEEE 802.11 WLANs
 
Dpdk applications
Dpdk applicationsDpdk applications
Dpdk applications
 
DPDK KNI interface
DPDK KNI interfaceDPDK KNI interface
DPDK KNI interface
 
Introduction to DPDK
Introduction to DPDKIntroduction to DPDK
Introduction to DPDK
 
Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking Explained
 
Xdp and ebpf_maps
Xdp and ebpf_mapsXdp and ebpf_maps
Xdp and ebpf_maps
 
Linux Internals - Part II
Linux Internals - Part IILinux Internals - Part II
Linux Internals - Part II
 
Linux Locking Mechanisms
Linux Locking MechanismsLinux Locking Mechanisms
Linux Locking Mechanisms
 
DPDK in Containers Hands-on Lab
DPDK in Containers Hands-on LabDPDK in Containers Hands-on Lab
DPDK in Containers Hands-on Lab
 
Network Drivers
Network DriversNetwork Drivers
Network Drivers
 

Similar to Yet another introduction to Linux RCU

Userspace RCU library : what linear multiprocessor scalability means for your...
Userspace RCU library : what linear multiprocessor scalability means for your...Userspace RCU library : what linear multiprocessor scalability means for your...
Userspace RCU library : what linear multiprocessor scalability means for your...
Alexey Ivanov
 
Gluster d thread_synchronization_using_urcu_lca2016
Gluster d thread_synchronization_using_urcu_lca2016Gluster d thread_synchronization_using_urcu_lca2016
Gluster d thread_synchronization_using_urcu_lca2016
Gluster.org
 
Linux Synchronization Mechanism: RCU (Read Copy Update)
Linux Synchronization Mechanism: RCU (Read Copy Update)Linux Synchronization Mechanism: RCU (Read Copy Update)
Linux Synchronization Mechanism: RCU (Read Copy Update)
Adrian Huang
 
RCU
RCURCU
Glusterd_thread_synchronization_using_urcu_lca2016
Glusterd_thread_synchronization_using_urcu_lca2016Glusterd_thread_synchronization_using_urcu_lca2016
Glusterd_thread_synchronization_using_urcu_lca2016
Atin Mukherjee
 
CONFidence 2017: Escaping the (sand)box: The promises and pitfalls of modern ...
CONFidence 2017: Escaping the (sand)box: The promises and pitfalls of modern ...CONFidence 2017: Escaping the (sand)box: The promises and pitfalls of modern ...
CONFidence 2017: Escaping the (sand)box: The promises and pitfalls of modern ...
PROIDEA
 
Thread synchronization in GlusterD using URCU
Thread synchronization in GlusterD using URCUThread synchronization in GlusterD using URCU
Thread synchronization in GlusterD using URCU
Atin Mukherjee
 
Security Monitoring with eBPF
Security Monitoring with eBPFSecurity Monitoring with eBPF
Security Monitoring with eBPF
Alex Maestretti
 
Eco-friendly Linux kernel development
Eco-friendly Linux kernel developmentEco-friendly Linux kernel development
Eco-friendly Linux kernel development
Andrea Righi
 
Playing BBR with a userspace network stack
Playing BBR with a userspace network stackPlaying BBR with a userspace network stack
Playing BBR with a userspace network stack
Hajime Tazaki
 
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)
Wei Shan Ang
 
Swapping Pacemaker Corosync with repmgr
Swapping Pacemaker Corosync with repmgrSwapping Pacemaker Corosync with repmgr
Swapping Pacemaker Corosync with repmgr
PGConf APAC
 
Java and Containers - Make it Awesome !
Java and Containers - Make it Awesome !Java and Containers - Make it Awesome !
Java and Containers - Make it Awesome !
Dinakar Guniguntala
 
OpenHPC: Community Building Blocks for HPC Systems
OpenHPC: Community Building Blocks for HPC SystemsOpenHPC: Community Building Blocks for HPC Systems
OpenHPC: Community Building Blocks for HPC Systems
inside-BigData.com
 
Presentation 14 09_2012
Presentation 14 09_2012Presentation 14 09_2012
Presentation 14 09_2012
Youcheng Sun
 
Shoot4U: Using VMM Assists to Optimize TLB Operations on Preempted vCPUs
Shoot4U: Using VMM Assists to Optimize TLB Operations on Preempted vCPUsShoot4U: Using VMM Assists to Optimize TLB Operations on Preempted vCPUs
Shoot4U: Using VMM Assists to Optimize TLB Operations on Preempted vCPUs
Jiannan Ouyang, PhD
 
Checkpoint and Restore In Userspace
Checkpoint and Restore In UserspaceCheckpoint and Restore In Userspace
Checkpoint and Restore In Userspace
OpenVZ
 
Open WG Talk #2 Everything you wanted to know about CRIU (but were afraid to ...
Open WG Talk #2 Everything you wanted to know about CRIU (but were afraid to ...Open WG Talk #2 Everything you wanted to know about CRIU (but were afraid to ...
Open WG Talk #2 Everything you wanted to know about CRIU (but were afraid to ...
OpenVZ
 
Андрей Вагин. Все что вы хотели знать о Criu, но стеснялись спросить...
Андрей Вагин. Все что вы хотели знать о Criu, но стеснялись спросить...Андрей Вагин. Все что вы хотели знать о Criu, но стеснялись спросить...
Андрей Вагин. Все что вы хотели знать о Criu, но стеснялись спросить...
WG_ Events
 
Open WG Talk #2 Everything you wanted to know about CRIU (but were afraid to ...
Open WG Talk #2 Everything you wanted to know about CRIU (but were afraid to ...Open WG Talk #2 Everything you wanted to know about CRIU (but were afraid to ...
Open WG Talk #2 Everything you wanted to know about CRIU (but were afraid to ...
Andrey Vagin
 

Similar to Yet another introduction to Linux RCU (20)

Userspace RCU library : what linear multiprocessor scalability means for your...
Userspace RCU library : what linear multiprocessor scalability means for your...Userspace RCU library : what linear multiprocessor scalability means for your...
Userspace RCU library : what linear multiprocessor scalability means for your...
 
Gluster d thread_synchronization_using_urcu_lca2016
Gluster d thread_synchronization_using_urcu_lca2016Gluster d thread_synchronization_using_urcu_lca2016
Gluster d thread_synchronization_using_urcu_lca2016
 
Linux Synchronization Mechanism: RCU (Read Copy Update)
Linux Synchronization Mechanism: RCU (Read Copy Update)Linux Synchronization Mechanism: RCU (Read Copy Update)
Linux Synchronization Mechanism: RCU (Read Copy Update)
 
RCU
RCURCU
RCU
 
Glusterd_thread_synchronization_using_urcu_lca2016
Glusterd_thread_synchronization_using_urcu_lca2016Glusterd_thread_synchronization_using_urcu_lca2016
Glusterd_thread_synchronization_using_urcu_lca2016
 
CONFidence 2017: Escaping the (sand)box: The promises and pitfalls of modern ...
CONFidence 2017: Escaping the (sand)box: The promises and pitfalls of modern ...CONFidence 2017: Escaping the (sand)box: The promises and pitfalls of modern ...
CONFidence 2017: Escaping the (sand)box: The promises and pitfalls of modern ...
 
Thread synchronization in GlusterD using URCU
Thread synchronization in GlusterD using URCUThread synchronization in GlusterD using URCU
Thread synchronization in GlusterD using URCU
 
Security Monitoring with eBPF
Security Monitoring with eBPFSecurity Monitoring with eBPF
Security Monitoring with eBPF
 
Eco-friendly Linux kernel development
Eco-friendly Linux kernel developmentEco-friendly Linux kernel development
Eco-friendly Linux kernel development
 
Playing BBR with a userspace network stack
Playing BBR with a userspace network stackPlaying BBR with a userspace network stack
Playing BBR with a userspace network stack
 
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)
 
Swapping Pacemaker Corosync with repmgr
Swapping Pacemaker Corosync with repmgrSwapping Pacemaker Corosync with repmgr
Swapping Pacemaker Corosync with repmgr
 
Java and Containers - Make it Awesome !
Java and Containers - Make it Awesome !Java and Containers - Make it Awesome !
Java and Containers - Make it Awesome !
 
OpenHPC: Community Building Blocks for HPC Systems
OpenHPC: Community Building Blocks for HPC SystemsOpenHPC: Community Building Blocks for HPC Systems
OpenHPC: Community Building Blocks for HPC Systems
 
Presentation 14 09_2012
Presentation 14 09_2012Presentation 14 09_2012
Presentation 14 09_2012
 
Shoot4U: Using VMM Assists to Optimize TLB Operations on Preempted vCPUs
Shoot4U: Using VMM Assists to Optimize TLB Operations on Preempted vCPUsShoot4U: Using VMM Assists to Optimize TLB Operations on Preempted vCPUs
Shoot4U: Using VMM Assists to Optimize TLB Operations on Preempted vCPUs
 
Checkpoint and Restore In Userspace
Checkpoint and Restore In UserspaceCheckpoint and Restore In Userspace
Checkpoint and Restore In Userspace
 
Open WG Talk #2 Everything you wanted to know about CRIU (but were afraid to ...
Open WG Talk #2 Everything you wanted to know about CRIU (but were afraid to ...Open WG Talk #2 Everything you wanted to know about CRIU (but were afraid to ...
Open WG Talk #2 Everything you wanted to know about CRIU (but were afraid to ...
 
Андрей Вагин. Все что вы хотели знать о Criu, но стеснялись спросить...
Андрей Вагин. Все что вы хотели знать о Criu, но стеснялись спросить...Андрей Вагин. Все что вы хотели знать о Criu, но стеснялись спросить...
Андрей Вагин. Все что вы хотели знать о Criu, но стеснялись спросить...
 
Open WG Talk #2 Everything you wanted to know about CRIU (but were afraid to ...
Open WG Talk #2 Everything you wanted to know about CRIU (but were afraid to ...Open WG Talk #2 Everything you wanted to know about CRIU (but were afraid to ...
Open WG Talk #2 Everything you wanted to know about CRIU (but were afraid to ...
 

More from Viller Hsiao

Bpf performance tools chapter 4 bcc
Bpf performance tools chapter 4   bccBpf performance tools chapter 4   bcc
Bpf performance tools chapter 4 bcc
Viller Hsiao
 
Prerequisite knowledge for shared memory concurrency
Prerequisite knowledge for shared memory concurrencyPrerequisite knowledge for shared memory concurrency
Prerequisite knowledge for shared memory concurrency
Viller Hsiao
 
twlkh-linux-vsyscall-and-vdso
twlkh-linux-vsyscall-and-vdsotwlkh-linux-vsyscall-and-vdso
twlkh-linux-vsyscall-and-vdso
Viller Hsiao
 
Linux kernel tracing
Linux kernel tracingLinux kernel tracing
Linux kernel tracing
Viller Hsiao
 
mbed-os 3.0 modules dependency graph
mbed-os 3.0 modules dependency graphmbed-os 3.0 modules dependency graph
mbed-os 3.0 modules dependency graph
Viller Hsiao
 
Introduction to ARM mbed-OS 3.0 uvisor
Introduction to ARM mbed-OS 3.0 uvisorIntroduction to ARM mbed-OS 3.0 uvisor
Introduction to ARM mbed-OS 3.0 uvisor
Viller Hsiao
 
My first-crawler-in-python
My first-crawler-in-pythonMy first-crawler-in-python
My first-crawler-in-python
Viller Hsiao
 
Trace kernel code tips
Trace kernel code tipsTrace kernel code tips
Trace kernel code tips
Viller Hsiao
 
f9-microkernel-ktimer
f9-microkernel-ktimerf9-microkernel-ktimer
f9-microkernel-ktimer
Viller Hsiao
 

More from Viller Hsiao (9)

Bpf performance tools chapter 4 bcc
Bpf performance tools chapter 4   bccBpf performance tools chapter 4   bcc
Bpf performance tools chapter 4 bcc
 
Prerequisite knowledge for shared memory concurrency
Prerequisite knowledge for shared memory concurrencyPrerequisite knowledge for shared memory concurrency
Prerequisite knowledge for shared memory concurrency
 
twlkh-linux-vsyscall-and-vdso
twlkh-linux-vsyscall-and-vdsotwlkh-linux-vsyscall-and-vdso
twlkh-linux-vsyscall-and-vdso
 
Linux kernel tracing
Linux kernel tracingLinux kernel tracing
Linux kernel tracing
 
mbed-os 3.0 modules dependency graph
mbed-os 3.0 modules dependency graphmbed-os 3.0 modules dependency graph
mbed-os 3.0 modules dependency graph
 
Introduction to ARM mbed-OS 3.0 uvisor
Introduction to ARM mbed-OS 3.0 uvisorIntroduction to ARM mbed-OS 3.0 uvisor
Introduction to ARM mbed-OS 3.0 uvisor
 
My first-crawler-in-python
My first-crawler-in-pythonMy first-crawler-in-python
My first-crawler-in-python
 
Trace kernel code tips
Trace kernel code tipsTrace kernel code tips
Trace kernel code tips
 
f9-microkernel-ktimer
f9-microkernel-ktimerf9-microkernel-ktimer
f9-microkernel-ktimer
 

Recently uploaded

How To Fill Timesheet in TaskSprint: Quick Guide 2024
How To Fill Timesheet in TaskSprint: Quick Guide 2024How To Fill Timesheet in TaskSprint: Quick Guide 2024
How To Fill Timesheet in TaskSprint: Quick Guide 2024
TaskSprint | Employee Efficiency Software
 
BATber53 AWS Modernize your applications with purpose-built AWS databases
BATber53 AWS Modernize your applications with purpose-built AWS databasesBATber53 AWS Modernize your applications with purpose-built AWS databases
BATber53 AWS Modernize your applications with purpose-built AWS databases
BATbern
 
03. Ruby Variables & Regex - Ruby Core Teaching
03. Ruby Variables & Regex - Ruby Core Teaching03. Ruby Variables & Regex - Ruby Core Teaching
03. Ruby Variables & Regex - Ruby Core Teaching
quanhoangd129
 
Agra Girls Call Agra 0X0000000X Unlimited Short Providing Girls Service Avail...
Agra Girls Call Agra 0X0000000X Unlimited Short Providing Girls Service Avail...Agra Girls Call Agra 0X0000000X Unlimited Short Providing Girls Service Avail...
Agra Girls Call Agra 0X0000000X Unlimited Short Providing Girls Service Avail...
rachitkumar09887
 
Russian Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service ...
Russian Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service ...Russian Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service ...
Russian Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service ...
shanihomely
 
AI - Your Startup Sidekick (Leveraging AI to Bootstrap a Lean Startup).pdf
AI - Your Startup Sidekick (Leveraging AI to Bootstrap a Lean Startup).pdfAI - Your Startup Sidekick (Leveraging AI to Bootstrap a Lean Startup).pdf
AI - Your Startup Sidekick (Leveraging AI to Bootstrap a Lean Startup).pdf
Daniel Zivkovic
 
Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...
Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...
Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...
John Gallagher
 
Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
kiara pandey
 
🚂🚘 Premium Girls Call Ranchi 🛵🚡000XX00000 💃 Choose Best And Top Girl Service...
🚂🚘 Premium Girls Call Ranchi  🛵🚡000XX00000 💃 Choose Best And Top Girl Service...🚂🚘 Premium Girls Call Ranchi  🛵🚡000XX00000 💃 Choose Best And Top Girl Service...
🚂🚘 Premium Girls Call Ranchi 🛵🚡000XX00000 💃 Choose Best And Top Girl Service...
bahubalikumar09988
 
02. Ruby Basic slides - Ruby Core Teaching
02. Ruby Basic slides - Ruby Core Teaching02. Ruby Basic slides - Ruby Core Teaching
02. Ruby Basic slides - Ruby Core Teaching
quanhoangd129
 
GT degree offer diploma Transcript
GT degree offer diploma TranscriptGT degree offer diploma Transcript
GT degree offer diploma Transcript
attueb
 
Empowering Businesses with Intelligent Software Solutions - Grawlix
Empowering Businesses with Intelligent Software Solutions - GrawlixEmpowering Businesses with Intelligent Software Solutions - Grawlix
Empowering Businesses with Intelligent Software Solutions - Grawlix
Aarisha Shaikh
 
Private Girls Call Navi Mumbai 🛵🚡9820252231 💃 Choose Best And Top Girl Servic...
Private Girls Call Navi Mumbai 🛵🚡9820252231 💃 Choose Best And Top Girl Servic...Private Girls Call Navi Mumbai 🛵🚡9820252231 💃 Choose Best And Top Girl Servic...
Private Girls Call Navi Mumbai 🛵🚡9820252231 💃 Choose Best And Top Girl Servic...
902basic
 
Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...
Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...
Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...
revolutionary575
 
SEO Cheat Sheet with Learning Resources by Balti Bloggers.pdf
SEO Cheat Sheet with Learning Resources by Balti Bloggers.pdfSEO Cheat Sheet with Learning Resources by Balti Bloggers.pdf
SEO Cheat Sheet with Learning Resources by Balti Bloggers.pdf
Balti Bloggers
 
Russian Girls Call Mumbai 🛵🚡9833363713 💃 Choose Best And Top Girl Service And...
Russian Girls Call Mumbai 🛵🚡9833363713 💃 Choose Best And Top Girl Service And...Russian Girls Call Mumbai 🛵🚡9833363713 💃 Choose Best And Top Girl Service And...
Russian Girls Call Mumbai 🛵🚡9833363713 💃 Choose Best And Top Girl Service And...
dream girl
 
01. Ruby Introduction - Ruby Core Teaching
01. Ruby Introduction - Ruby Core Teaching01. Ruby Introduction - Ruby Core Teaching
01. Ruby Introduction - Ruby Core Teaching
quanhoangd129
 
Celebrity Girls Call Mumbai 🛵🚡9910780858 💃 Choose Best And Top Girl Service A...
Celebrity Girls Call Mumbai 🛵🚡9910780858 💃 Choose Best And Top Girl Service A...Celebrity Girls Call Mumbai 🛵🚡9910780858 💃 Choose Best And Top Girl Service A...
Celebrity Girls Call Mumbai 🛵🚡9910780858 💃 Choose Best And Top Girl Service A...
norina2645
 
DSD-INT 2024 Rainfall nowcasting – now and then - Uijlenhoet
DSD-INT 2024 Rainfall nowcasting – now and then - UijlenhoetDSD-INT 2024 Rainfall nowcasting – now and then - Uijlenhoet
DSD-INT 2024 Rainfall nowcasting – now and then - Uijlenhoet
Deltares
 
05. Ruby Control Structures - Ruby Core Teaching
05. Ruby Control Structures - Ruby Core Teaching05. Ruby Control Structures - Ruby Core Teaching
05. Ruby Control Structures - Ruby Core Teaching
quanhoangd129
 

Recently uploaded (20)

How To Fill Timesheet in TaskSprint: Quick Guide 2024
How To Fill Timesheet in TaskSprint: Quick Guide 2024How To Fill Timesheet in TaskSprint: Quick Guide 2024
How To Fill Timesheet in TaskSprint: Quick Guide 2024
 
BATber53 AWS Modernize your applications with purpose-built AWS databases
BATber53 AWS Modernize your applications with purpose-built AWS databasesBATber53 AWS Modernize your applications with purpose-built AWS databases
BATber53 AWS Modernize your applications with purpose-built AWS databases
 
03. Ruby Variables & Regex - Ruby Core Teaching
03. Ruby Variables & Regex - Ruby Core Teaching03. Ruby Variables & Regex - Ruby Core Teaching
03. Ruby Variables & Regex - Ruby Core Teaching
 
Agra Girls Call Agra 0X0000000X Unlimited Short Providing Girls Service Avail...
Agra Girls Call Agra 0X0000000X Unlimited Short Providing Girls Service Avail...Agra Girls Call Agra 0X0000000X Unlimited Short Providing Girls Service Avail...
Agra Girls Call Agra 0X0000000X Unlimited Short Providing Girls Service Avail...
 
Russian Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service ...
Russian Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service ...Russian Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service ...
Russian Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service ...
 
AI - Your Startup Sidekick (Leveraging AI to Bootstrap a Lean Startup).pdf
AI - Your Startup Sidekick (Leveraging AI to Bootstrap a Lean Startup).pdfAI - Your Startup Sidekick (Leveraging AI to Bootstrap a Lean Startup).pdf
AI - Your Startup Sidekick (Leveraging AI to Bootstrap a Lean Startup).pdf
 
Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...
Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...
Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...
 
Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
 
🚂🚘 Premium Girls Call Ranchi 🛵🚡000XX00000 💃 Choose Best And Top Girl Service...
🚂🚘 Premium Girls Call Ranchi  🛵🚡000XX00000 💃 Choose Best And Top Girl Service...🚂🚘 Premium Girls Call Ranchi  🛵🚡000XX00000 💃 Choose Best And Top Girl Service...
🚂🚘 Premium Girls Call Ranchi 🛵🚡000XX00000 💃 Choose Best And Top Girl Service...
 
02. Ruby Basic slides - Ruby Core Teaching
02. Ruby Basic slides - Ruby Core Teaching02. Ruby Basic slides - Ruby Core Teaching
02. Ruby Basic slides - Ruby Core Teaching
 
GT degree offer diploma Transcript
GT degree offer diploma TranscriptGT degree offer diploma Transcript
GT degree offer diploma Transcript
 
Empowering Businesses with Intelligent Software Solutions - Grawlix
Empowering Businesses with Intelligent Software Solutions - GrawlixEmpowering Businesses with Intelligent Software Solutions - Grawlix
Empowering Businesses with Intelligent Software Solutions - Grawlix
 
Private Girls Call Navi Mumbai 🛵🚡9820252231 💃 Choose Best And Top Girl Servic...
Private Girls Call Navi Mumbai 🛵🚡9820252231 💃 Choose Best And Top Girl Servic...Private Girls Call Navi Mumbai 🛵🚡9820252231 💃 Choose Best And Top Girl Servic...
Private Girls Call Navi Mumbai 🛵🚡9820252231 💃 Choose Best And Top Girl Servic...
 
Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...
Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...
Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...
 
SEO Cheat Sheet with Learning Resources by Balti Bloggers.pdf
SEO Cheat Sheet with Learning Resources by Balti Bloggers.pdfSEO Cheat Sheet with Learning Resources by Balti Bloggers.pdf
SEO Cheat Sheet with Learning Resources by Balti Bloggers.pdf
 
Russian Girls Call Mumbai 🛵🚡9833363713 💃 Choose Best And Top Girl Service And...
Russian Girls Call Mumbai 🛵🚡9833363713 💃 Choose Best And Top Girl Service And...Russian Girls Call Mumbai 🛵🚡9833363713 💃 Choose Best And Top Girl Service And...
Russian Girls Call Mumbai 🛵🚡9833363713 💃 Choose Best And Top Girl Service And...
 
01. Ruby Introduction - Ruby Core Teaching
01. Ruby Introduction - Ruby Core Teaching01. Ruby Introduction - Ruby Core Teaching
01. Ruby Introduction - Ruby Core Teaching
 
Celebrity Girls Call Mumbai 🛵🚡9910780858 💃 Choose Best And Top Girl Service A...
Celebrity Girls Call Mumbai 🛵🚡9910780858 💃 Choose Best And Top Girl Service A...Celebrity Girls Call Mumbai 🛵🚡9910780858 💃 Choose Best And Top Girl Service A...
Celebrity Girls Call Mumbai 🛵🚡9910780858 💃 Choose Best And Top Girl Service A...
 
DSD-INT 2024 Rainfall nowcasting – now and then - Uijlenhoet
DSD-INT 2024 Rainfall nowcasting – now and then - UijlenhoetDSD-INT 2024 Rainfall nowcasting – now and then - Uijlenhoet
DSD-INT 2024 Rainfall nowcasting – now and then - Uijlenhoet
 
05. Ruby Control Structures - Ruby Core Teaching
05. Ruby Control Structures - Ruby Core Teaching05. Ruby Control Structures - Ruby Core Teaching
05. Ruby Control Structures - Ruby Core Teaching
 

Yet another introduction to Linux RCU

  • 1. Yet Another Introduction to Linux RCU Viller Hsiao <villerhsiao@gmail.com> May. 14, 2015
  • 2. 9/3/16 2/60 Who am I ? Viller Hsiao Embedded Linux / RTOS engineer    http://image.dfdaily.com/2012/5/4/634716931128751250504b050c1_nEO_IMG.jpg
  • 4. 9/3/16 4/60 What is RCU ? ● Read-Copy Update ● A kind of read/write synchronization mechanism
  • 5. 9/3/16 5/60 Agenda ● Synchronization inside Linux ● RCU basic operations ● Linux RCU internal
  • 7. 9/3/16 7/60 R/W Synchronization in SMP System ● Protect Shared data from concurrent access ● Synchronization mechanism ● atomic operation ● spinlock ● reader-writer spinlock (rwlock) ● seqlock ● RCU
  • 8. 9/3/16 8/60 Atomic Operation ● Operations that read and change data within a single, uninterruptible step ● Architecture support ● test-and-set (TSR) ● compare-and-swap (CAS) ● load-link/store-conditional (ll/sc)
  • 9. 9/3/16 9/60 spinlock Owner 3 update Owner 2 read Owner 1 read spin spinsp in spin update ● Implement by mutual exclusive u u u u
  • 10. 9/3/16 10/60 rwlock ● Allow multi reader ● Mutual exclusive between reader and writer Reader3 Writer update read Reader2 read Reader1 read spin read read read spin spin spinsp in spinsp in sp in u u u u u u u
  • 11. 9/3/16 11/60 seqlock ● Consistent mechanism without starving writers. Reader Writer Update data seq = 1 seq = 2 seq = 0 seq = 2 seq = 2 RetryFirst trial Start with even seq Same seq with start point
  • 12. 9/3/16 12/60 Architecture Support – Atomic Ops ● Load-link store-conditional – e.g. ARMv7 ldrex/strex http://infocenter.arm.com/help/topic/com.arm.doc.ddi0360f/graphics/exclusive_monitor_state_machine2.svg
  • 13. 9/3/16 13/60 Architecture Support – Barrier ● Optimization in modern computer architecture ● Optimizing compilers ● Multi-issuing ● Out-of-Order Execution ● Load/Store optimization ● … etc CPU 1 CPU 2 ====== ======= { A = 1; B = 2 } A = 3; x = B; B = 4; y = A; CPU 1 CPU 2 ====== ======= { A = 1; B = 2 } A = 3; x = B; B = 4; y = A;
  • 14. 9/3/16 14/60 Architecture Support – Barrier (Cont.) ● Compiler barrier ● CPU barrier instructions ● Ensure the order of some operations ● e.g. dmb/dsb/isb, ldar/stlr void foo() {     A = B + 1;     asm volatile("" ::: "memory");     B = 0; } void foo() {     A = B + 1;     asm volatile("" ::: "memory");     B = 0; }
  • 15. 9/3/16 15/60 The problem ● Bad in scalability and performance ● Multiple CPUs to break even with single CPU http://www.rdrop.com/~paulmck/RCU/RCU.2014.05.18a.TU-Dresden.pdf
  • 17. 9/3/16 17/60 RCU Operations – Read rcu_read_lock(); p = rcu_dereference(gp); /* p = gp */ if (p != NULL) { c do_something(p->a, p->b); } rcu_read_unlock(); rcu_read_lock(); p = rcu_dereference(gp); /* p = gp */ if (p != NULL) { c do_something(p->a, p->b); } rcu_read_unlock(); Read side Critical section ● Blocking/preemption within an RCU read-side critical section is illegal
  • 18. 9/3/16 18/60 RCU Operations – Update & Reclaim q = kmalloc(sizeof(*q), GFP_KERNEL); q->a = 1; q->b = 2; rcu_assign_pointer(gp, q); /* gp = q */ synchronize_rcu(); /* call_rcu (&callbacks()) */ kfree(p); q = kmalloc(sizeof(*q), GFP_KERNEL); q->a = 1; q->b = 2; rcu_assign_pointer(gp, q); /* gp = q */ synchronize_rcu(); /* call_rcu (&callbacks()) */ kfree(p); Removal (Updater) Reclaimer ● Maintain multiple version of recently updated object ● Spinlock is acquired if multiple udpater
  • 19. 9/3/16 19/60 RCU Primitives READER UPDATER RECLAIMER rcu_dereference() rcu_assign_pointer() rcu_read_lock() rcu_read_unlock() call_rcu() synchronize_rcu() wmb rmb only on DEC alpha preempt­disable only if preemptible kernel Re-painted from [13]
  • 20. 9/3/16 20/60 Quiz: Why does it improve scalability in read side?
  • 21. 9/3/16 21/60 Why RCU is better? ● Almost nothing in read side lock (non preempt kernel) static inline void rcu_read_lock(void) { __asm__ __volatile__("": : :"memory"); (void) 0; do { } while (0); do { } while (0); } static inline void rcu_read_lock(void) { __asm__ __volatile__("": : :"memory"); (void) 0; do { } while (0); do { } while (0); } Real content of rcu_read_lock() after preprocessor. (! PREEMPT)
  • 22. 9/3/16 22/60 Read side Lock Overhead Comparison http://lwn.net/images/ns/kernel/rcu/rwlockRCUperf.jpg
  • 23. 9/3/16 23/60 What's the benifit? ● Zero-overhead and wait-free in read side ● No memory barrier is required ● No lock is required ● Allow recursive lock ● No deadlock between readers and writer
  • 24. 9/3/16 24/60 RCU List APIs [10] Operations list Circular doubly linked list hlist Linear doubly linked list Initialization INIT_LIST_HEAD_RCU() Full traversal list_for_each_entry_rcu() hlist_for_each_entry_rcu() hlist_for_each_entry_rcu_bh() hlist_for_each_entry_rcu_notrace() Resume traversal list_for_each_entry_continue_rcu() hlist_for_each_entry_continue_rcu() hlist_for_each_entry_continue_rcu_bh() Stepwise traversal list_entry_rcu() list_first_or_null_rcu() list_next_rcu() list_first_rcu() hlist_next_rcu() hlist_pprev_rcu() Add list_add_rcu() list_add_tail_rcu() hlist_add_after_rcu() hlist_add_before_rcu() hlist_add_head_rcu() Delete list_del_rcu() hlist_del_rcu() hlist_del_init_rcu() Replacement list_replace_rcu() hlist_replace_rcu() Splice list_splice_init_rcu()
  • 25. 9/3/16 25/60 RCU Model Removal ReclamationGrace Period Reader Reader Reader Reader Reader Reader Reader Reader Reader Repainted from https://lwn.net/images/ns/kernel/rcu/GracePeriodGood.png
  • 26. 9/3/16 26/60 RCU vs rwlock ● RCU has lower overhead and better scalability ● RCU readers see updated data faster ● rwlock readers get the consistent data after writer updated c https://lwn.net/Articles/263130/
  • 27. 9/3/16 27/60 Replace rwlock by RCU[13] http://en.wikipedia.org/wiki/Read-copy-update
  • 28. 9/3/16 28/60 Replace rwlock by RCU[13] http://en.wikipedia.org/wiki/Read-copy-update
  • 29. 9/3/16 29/60 What is RCU, again ● Read-Copy Update ● A kind of read-write synchronization mechanism ● A publish-subscribe mechanism[5] ● A poor man's garbage collector[5]
  • 30. 9/3/16 30/60 But Quiz: How does reclaimer know the time to release old object?
  • 32. 9/3/16 32/60 History and Contributors[9][13] ● 1980 H. T. Kung and Q. Lehman  ● use of garbage collectors to defer destruction of nodes in a parellel binary search tree. ● 1986, Hennessy, Osisek, and Seigh ● Passive serialization, which is an RCU­like mechanism that relies on the presence of "quiescent states" in  the VM/XA hypervisor  ● 1995 J. Slingwine and P. E. McKenney ● US Patent 5,442,758, implement RCU in DYNIX/ptx kernel. ● 2002, D. Sarma ● added RCU to version 2.5.43 of the Linux kernel ● 2005, P. E. McKenney ● Permitting preemption of RCU realtime critical sections ● 2009, P. E. McKenny  ● Introduce user­level RCU implementation ● Work of P. E. McKenney, Mathieu Desnoyers, Alan Stern, Michel Dagenais, Manish Gupta, Maged  Michael, Phil Howard, Joshua Triplett, Jonathan Walpole, and the Linux kernel community
  • 33. 9/3/16 33/60 The Problem ● How can we know when it's safe to reclaim memory without paying too high a cost? ● especially in the read path ● Possible implementation – Reference count – Hazard pointer ~ The page is extracted and tweaked from [14]
  • 34. 9/3/16 34/60 Lock-based Synchronization Model Reader nReader 1 Update nUpdater 1 Reader 1 Reader 1 Reader n Reader n <lock icon url> Obj 1 Obj n
  • 35. 9/3/16 35/60 RCU Synchronization Model RCU Core Reader 2 Reader nReader 1 Reclaimer 2 Reclaimer nReclaimer 1 Update 2 Update nUpdater 1 Reader 1 Reader 1 Reader 2 Reader 2 Reader n Reader n
  • 36. 9/3/16 36/60 Terms ● Recall that constraint of read side critical section operations ● Non-blocked inside read lock (!PREEMPT) ● Non-preempted (PREEMPT) ● Irq disable, bh disable imply read side critical section
  • 37. 9/3/16 37/60 Terms – Grace Period Removal ReclamationGrace Period Reader Reader Reader Reader Reader Reader Reader Reader Reader Repainted from https://lwn.net/images/ns/kernel/rcu/GracePeriodGood.png
  • 38. 9/3/16 38/60 Terms – Quiescent State Reader Reader Reader Quiescent State ● Period outside the read critical section ● It implies complete of one grace period in its CPU
  • 39. 9/3/16 39/60 Toy RCU Implementation #define rcu_assign_pointer(p, v)  ({          smp_wmb();          (p) = (v);  }) void synchronize_rcu(void) {         int cpu;         for_each_online_cpu(cpu)                 run_on(cpu); } #define rcu_assign_pointer(p, v)  ({          smp_wmb();          (p) = (v);  }) void synchronize_rcu(void) {         int cpu;         for_each_online_cpu(cpu)                 run_on(cpu); } #define rcu_read_lock() #define rcu_read_unlock() #define rcu_dereference(p)  ({          typeof(p) _p1 = (*(volatile typeof(p)*)&(p));          smp_read_barrier_depends();          _p1;  }) #define rcu_read_lock() #define rcu_read_unlock() #define rcu_dereference(p)  ({          typeof(p) _p1 = (*(volatile typeof(p)*)&(p));          smp_read_barrier_depends();          _p1;  }) Read Update
  • 40. 9/3/16 40/60 RCU Core State CPU 0: call_rcu(cb) RCU State list 0 cb cb cb list 1 cb cb cb list n cb cb cb Quiescent State Recorder CPU 0 CPU 1 CPU n
  • 41. 9/3/16 41/60 Quiescent State ● Condition of quiescent state ● Context switch ● Dynticks or idle ● User mode execution ● Check RCU state and execute RCU operations in system background
  • 42. 9/3/16 42/60 RCU Implementation – Classical RCU ● a.k.a tiny RCU ● Single data structure to record Quiescent State ● Scalability is not good for large numbers of CPUs, e.g. 4096 CPUs http://lwn.net/Articles/305782/
  • 43. 9/3/16 43/60 RCU Implementation – Hirarchical RCU ● a.k.a tree RCU ● Towards a more scalable RCU implementation ● Default solution in Linux kernel http://lwn.net/Articles/305782/
  • 44. 9/3/16 44/60 Tree RCU Core – List Operations CPU x call_rcu(cb) cb1 cb2 cbxnxtlist cb0 DONE TAIL WAIT TAIL NEXT READY TAIL NEXT TAIL cb Next Complete (DONE) Next Complete (WAIT) Next Complete (NXTRDY) Next complete CPUx RCU Data RCU State / RCU Node gpnum complete gpnum complete gpnum complete
  • 45. 9/3/16 45/60 Tree RCU Core – System Components invoke_rcu_core() rcu_gp_kthread_invoke() Put callback into list Updater call_rcu() tick_handle_periodic rcu_check_callback() RCU SOFTIRQ rcu_process_callbacks() rcu_gp_kthread Process GP Call callback rcu_do_batch() Pass QSs rcu_bh_qs() rcu_sched_qs() invoke_rcu_core()
  • 46. 9/3/16 46/60 Tree RCU Core http://lwn.net/images/ns/kernel/brcu/RCUbweBlock.png
  • 47. 9/3/16 47/60 RCU state: rcu-sched vs rcu-bh ● What the #$I#@(&!!! is RCU-bh For??? ● Ran a DDoS workload that hung the system – Load was so heavy that system never left irq!!! ● No context switches, no quiescent states, no grace periods – Eventually, OOM!!! ● Dipankar created RCU-bh ● Additional quiescent state in softirq execution ● Routing cache converted to RCU-bh, then withstood DDoS” ~ The page is extracted from [8]
  • 48. 9/3/16 48/60 Condition of Quiescent State ● rcu_sched ● Context switch ● Dynticks or idle ● User mode execution ● rcu_bh ● Any code outside of softirq with interrupt enabled
  • 49. 9/3/16 49/60 Condition of Quiescent State ● When to check it? ● Scheduler ● __do_softirq() ● Scheduler clock interrupt handler – rcu_check_callbacks()
  • 50. 9/3/16 50/60 RCU Stall[16] ● Possiblility of memory leak if it takes a long grace period ● Force Quiescent state ● Part of conditions of which RCU stall happened ● Documentation/RCU/stallwarn.txt ● A CPU looping in an RCU read-side critical section. ● A CPU looping with interrupts disabled. This condition can result in RCU- sched and RCU-bh stalls. ● A CPU looping with preemption disabled. This condition can result in RCU- sched stalls and, if ksoftirqd is in use, RCU-bh stalls. ● A CPU looping with bottom halves disabled. This condition can result in RCU-sched and RCU-bh stalls.
  • 51. 9/3/16 51/60 Topic – Sleepable RCU[2] ● Blocking or sleeping of any sort is strictly prohibited in classical RCU. This has frequently been an obstacle to the use of RCU ● Implement the sleepable RCU (SRCU) that permits arbitrary sleeping (or blocking) within RCU read-side critical sections.
  • 52. 9/3/16 52/60 Topic – Userspace RCU[7] ● Use cases ● LTTng ● Atomic operation API utilities ● Barrier ● URCU protected hash ● URCU stack/queue API
  • 53. 9/3/16 53/60 Other Topics ● Dynticks ● When some CPU is sleeping in dynticks mode – Waking up CPU for quiescent state consumes power – Extened its quiescent state ● Use RCU in kernel module ● CPU hotplugs ● nocb ● realtime ● RCU priority boost
  • 54. 9/3/16 54/60 RCU Uses in Linux Kernel http://www2.rdrop.com/~paulmck/RCU/linuxusage.html
  • 55. 9/3/16 55/60 What is RCU's Area of Applicability? ● Choose the suitable mechanism for your application https://www.kernel.org/pub/linux/kernel/people/paulmck/Answers/RCU/RCUAreaApp.html
  • 57. 9/3/16 57/60 Reference [1] McKenney, Paul E., “Introduction to RCU” [2] McKenney Paul E. (Oct. 2006), “Sleepable RCU”, LWN [3] McKenney Paul E. (Feb. 2007), “Priority-Boosting RCU Read-Side Critical Sections ”, LWN [4] McKenney, Paul E.; Walpole, Jonathan (Dec. 2007), “What is RCU, Fundamentally?”, LWN. [5] McKenney Paul E. (Dec. 2007), “What is RCU? Part 2: Usage”, LWN. [6] McKenney Paul E. (Dec. 2008), “Hierarchical RCU”, LWN. [7] McKenney Paul E. (Nov. 2013), “User-space RCU”, LWN [8] McKenney, Paul E. (Sep. 2009), “RCU and Breakage ”, presented to Netconf 2009 [9] McKenney, Paul E. (May 2014), “What Is RCU? ”, presented to TU Dresden Distributed OS class [10] Jake (Sep. 2014), "The RCU API tables", LWN. [11] Wiki: “Load-link/store-conditional” [12] Wiki: “Memory Barrier” [13] Wiki: “Read-Copy Update”
  • 58. 9/3/16 58/60 Reference (Cont.) [12] 杨燚 , (Jul. 2005), “ Linux 2.6内核中新的锁机制--RCU“ , IBM Developer Work [13] Leiflindholm, (Mar. 2011), “Memory access ordering - an introduction”, ARM Connected Community [14] Walpole, Jonathan (2014), “CS510 Concurrent Systems: What is RCU, Fundamentally?” [15] “What is RCU's Area of Applicability?” [16] All Linux kernel documentations under Documentation/RCU/
  • 59. 9/3/16 59/60 ● ARM are trademarks or registered trademarks of ARM Holdings. ● DYNIX (short for DYNamic unIX) is an operating system developed by Sequent Computer Systems. ● Linux is a registered trademark of Linus Torvalds. ● The RCU, spinlock, seqlock are the joint work of its maintainers and the Linux kernel community. ● HCSM is the community of Hsinchu Coders in Taiwan. ● Other company, product, and service names may be trademarks or service marks of others. ● The license of each graph belongs to each website listed individually. ● The others of my work in the slide is licensed under a CC-BY-SA License. ● License text: http://creativecommons.org/licenses/by-sa/4.0/legalcode Rights to Copy copyright © 2015 Viller Hsiao