SlideShare a Scribd company logo
1 of 54
Download to read offline
Memory Barriers in the Linux Kernel
Semantics and Practices
Embedded Linux Conference – April 2016. San Diego, CA.
Davidlohr Bueso <dave@stgolabs.net>
SUSE Labs.
2
Agenda
1. Introduction
• Reordering Examples
• Underlying need for memory barriers
2. Barriers in the kernel
● Building blocks
● Implicit barriers
● Atomic operations
● Acquire/release semantics.
3
References
i. David Howells, Paul E. McKenney. Linux Kernel source:
Documentation/memory-barriers.txt
ii. Paul E. McKenney. Is Parallel Programming Hard, And, If So, What
Can You Do About It?
iii. Paul E. McKenney.
Memory Barriers: a Hardware View for Software Hackers. June 2010.
iv. Sorin, Hill, Wood. A Primer on Memory Consistency and Cache
Coherence. Synthesis Lectures on Computer Architecture. 2011.
4
5
Flagship Example
A = 0, B = 0 (shared variables)
CPU0
A = 1
x = B
CPU1
B = 1
y = A
6
Flagship Example
A = 0, B = 0 (shared variables)
CPU0
A = 1
x = B
CPU1
B = 1
y = A
(x, y) =
7
Flagship Example
A = 0, B = 0 (shared variables)
CPU0
A = 1
x = B
CPU1
B = 1
y = A
(x, y) =
(0, 1)
A = 1
x = B
              B = 1
              y = A
8
Flagship Example
A = 0, B = 0 (shared variables)
CPU0
A = 1
x = B
CPU1
B = 1
y = A
(x, y) =
(0, 1)
              B = 1
              y = A
A = 1
x = B
(1, 0)
9
Flagship Example
A = 0, B = 0 (shared variables)
CPU0
A = 1
x = B
CPU1
B = 1
y = A
(x, y) =
(0, 1)
A = 1
              B = 1
              y = A
x = B
(1, 0)
(1, 1)
10
Flagship Example
A = 0, B = 0 (shared variables)
CPU0
A = 1
x = B
CPU1
B = 1
y = A
(x, y) =
(0, 1)
x = B   y = A   
A = 1 B = 1
(1, 0)
(1, 1)
 (0, 0)
11
Memory Consistency Models
• Most modern multicore systems are coherent but not
consistent.
‒ Same address is subject to the cache coherency protocol.
• Describes what the CPU can do regarding instruction
ordering across addresses.
‒ Helps programmers make sense of the world.
‒ CPU is not aware if application is single or multi-threaded.
When optimizing, it only ensures single threaded correctness.
12
Sequential Consistency (SC)
“A multiprocessor is sequentially consistent if the result of any
execution is the same as some sequential order, and within any
processor, the operations are executed in program order”
– Lamport, 1979.
• Intuitively a programmer's ideal scenario.
‒ The instructions are executed by the same CPU in the order in
which it was written.
‒ All processes see the same interleaving of operations.
13
Total Store Order (TSO)
• SPARC, x86 (Intel, AMD)
• Similar to SC, but:
‒ Loads may be reordered with writes.
[l] B
[s] B
[l] B
[s] C
[l] B
[s] A
[l] A
[s] B
14
Total Store Order (TSO)
• SPARC, x86 (Intel, AMD)
• Similar to SC, but:
‒ Loads may be reordered with writes.
[l] B
[s] B
[l] B
[s] C
[l] B
[s] A
[l] A
[s] B
L→L
15
Total Store Order (TSO)
• SPARC, x86 (Intel, AMD)
• Similar to SC, but:
‒ Loads may be reordered with writes.
[l] B
[s] B
[l] B
[s] C
[l] B
[s] A
[l] A
[s] B
L→L
S→S
16
Total Store Order (TSO)
• SPARC, x86 (Intel, AMD)
• Similar to SC, but:
‒ Loads may be reordered with writes.
[l] B
[s] B
[l] B
[s] C
[l] B
[s] A
[l] A
[s] B
L→L
S→S
L→S
17
Total Store Order (TSO)
• SPARC, x86 (Intel, AMD)
• Similar to SC, but:
‒ Loads may be reordered with writes.
[l] B
[s] B
[l] B
[s] C
[l] B
[s] A
[l] A
[s] B
L→L
S→S
L→S
S→L
18
Relaxed Models
• Arbitrary reorder limited only by explicit memory-
barrier instructions.
• ARM, Power, tilera, Alpha.
19
Fixing the Example
A = 0, B = 0 (shared variables)
CPU0
A = 1
x = B
CPU1
B = 1
y = A
CPU1
B = 1
y = A
20
Fixing the Example
A = 0, B = 0 (shared variables)
CPU0
A = 1
<MB>
x = B
CPU1
B = 1
y = A
CPU1
B = 1
<MB>
y = A
21
Fixing the Example
A = 0, B = 0 (shared variables)
CPU0
A = 1
<MB>
x = B
CPU1
B = 1
y = A
CPU1
B = 1
<MB>
y = A
● Compiler barrier
22
Fixing the Example
A = 0, B = 0 (shared variables)
CPU0
A = 1
<MB>
x = B
CPU1
B = 1
y = A
CPU1
B = 1
<MB>
y = A
● Compiler barrier
● Mandatory barriers (general+rw)
23
Fixing the Example
A = 0, B = 0 (shared variables)
CPU0
A = 1
<MB>
x = B
CPU1
B = 1
y = A
CPU1
B = 1
<MB>
y = A
● Compiler barrier
● Mandatory barriers (general+rw)
● SMP-conditional barriers
24
Fixing the Example
A = 0, B = 0 (shared variables)
CPU0
A = 1
<MB>
x = B
CPU1
B = 1
y = A
CPU1
B = 1
<MB>
y = A
● Compiler barrier
● Mandatory barriers (general+rw)
● SMP-conditional barriers
● acquire/release
25
Fixing the Example
A = 0, B = 0 (shared variables)
CPU0
A = 1
<MB>
x = B
CPU1
B = 1
y = A
CPU1
B = 1
<MB>
y = A
● Compiler barrier
● Mandatory barriers (general+rw)
● SMP-conditional barriers
● acquire/release
● Data dependency barriers
● Device barriers
Barriers in the Linux Kernel
27
Abstracting Architectures
• Most kernel programmers need not worry about
ordering specifics of every architecture.
‒ Some notion of barrier usage is handy nonetheless – implicit
vs explicit, semantics, etc.
• Linux must handle the CPU's memory ordering
specifics in a portable way with LCD semantics of
memory barriers.
‒ CPU appears to execute in program order.
‒ Single variable consistency.
‒ Barriers operate in pairs.
‒ Sufficient to implement synchronization primitives.
28
Abstracting Architectures
mb()
mfence
dsb
sync
...
● Each architecture must implement its own calls or
otherwise default to the generic and highly
unoptimized behavior.
● <arch/xxx/include/asm/barriers.h> will
always define the low-level CPU specifics, then rely
on <include/asm­generic/barriers.h>
29
A Note on barrier()
• Prevents the compiler from getting smart, acting as a
general barrier.
• Within a loop forces the compiler to reload conditional
variables – READ/WRITE_ONCE.
30
Implicit Barriers
• Calls that have implied barriers, the caller can safely
rely on:
‒ Locking functions
‒ Scheduler functions
‒ Interrupt disabling functions
‒ Others.
31
Sleeping/Waking
• Extremely common task in the kernel and flagship
example of flag-based CPU-CPU interaction.
CPU0 CPU1
while (!done) { done = true;
schedule();      wake_up_process(t);
current→state = …;
}
32
Sleeping/Waking
• Extremely common task in the kernel and flagship
example of flag-based CPU-CPU interaction.
CPU0 CPU1
while (!done) { done = true;
schedule();      wake_up_process(t);
current→state = …;
set_current_state(…);
}
33
Sleeping/Waking
• Extremely common task in the kernel and flagship
example of flag-based CPU-CPU interaction.
CPU0 CPU1
while (!done) { done = true;
schedule();      wake_up_process(t);
current→state = …;
set_current_state(…);
}
smp_store_mb():
  [s] →state = … 
  smp_mb()
34
Atomic Operations
• Any atomic operation that modifies some state in
memory and returns information about the state can
potentially imply a SMP barrier:
‒ smp_mb() on each side of the actual operation
[atomic_*_]xchg()
atomic_*_return()
atomic_*_and_test()
atomic_*_add_negative()
35
Atomic Operations
• Any atomic operation that modifies some state in
memory and returns information about the state can
potentially imply a SMP barrier:
‒ smp_mb() on each side of the actual operation
‒ Conditional calls imply barriers only when successful.
[atomic_*_]xchg()
atomic_*_return()
atomic_*_and_test()
atomic_*_add_negative()
[atomic_*_]cmpxchg()
atomic_*_add_unless()
36
Atomic Operations
• Most basic of operations therefore do not imply
barriers.
• Many contexts can require barriers:
cpumask_set_cpu(cpu, vec­>mask);
/*
 * When adding a new vector, we update the mask first,
 * do a write memory barrier, and then update the count, to
 * make sure the vector is visible when count is set.
 */
smp_mb__before_atomic();
atomic_inc(&(vec)­>count);
37
Atomic Operations
• Most basic of operations therefore do not imply
barriers.
• Many contexts can require barriers:
/*
 * When removing from the vector, we decrement the counter first
 * do a memory barrier and then clear the mask.
 */
atomic_dec(&(vec)­>count);
smp_mb__after_atomic();
cpumask_clear_cpu(cpu, vec­>mask);
38
Acquire/Release Semantics
• One way barriers.
• Passing information reliably between threads about a
variable.
‒ Ideal in producer/consumer type situations (pairing!!).
‒ After an ACQUIRE on a given variable, all memory accesses
preceding any prior RELEASE on that same variable are
guaranteed to be visible.
‒ All accesses of all previous critical sections for that variable
are guaranteed to have completed.
‒ C++11's memory_order_acquire,
memory_order_release and memory_order_relaxed.
39
Acquire/Release Semantics
CPU0
spin_lock
  …
  …
CPU0
spin_lock(&l)
spin_unlock(&l)
CPU1
spin_lock(&l)
  
 
spin_unlock(&l)
CR
CR
40
Acquire/Release Semantics
CPU0
spin_lock
  …
  …
CPU0
spin_lock(&l)
spin_unlock(&l)
CPU1
spin_lock(&l)
  
 
spin_unlock(&l)
CR
CR
smp_store_release(lock→val, 0) <­> cmpxchg_acquire(lock→val, 0, LOCKED)  
41
Acquire/Release Semantics
CPU0
spin_lock
  …
  …
CPU0
spin_lock(&l)
spin_unlock(&l)
CPU1
spin_lock(&l)
  
 
spin_unlock(&l)
CR
CR
RELEASE
ACQUIRE
smp_store_release(lock→val, 0) <­> cmpxchg_acquire(lock→val, 0, LOCKED)  
42
Acquire/Release Semantics
CPU0
spin_lock
  …
  …
CPU0
spin_lock(&l)
spin_unlock(&l)
CPU1
spin_lock(&l)
  
 
spin_unlock(&l)
CR
CR
RELEASE
(LS, SS)
ACQUIRE
(LL, LS)
smp_store_release(lock→val, 0) <­> cmpxchg_acquire(lock→val, 0, LOCKED)
43
Acquire/Release Semantics
CPU0
spin_lock
  …
  …
CPU0
spin_lock(&l)
spin_unlock(&l)
CPU1
spin_lock(&l)
  
 
spin_unlock(&l)
CR
CR
RELEASE
ACQUIRE
smp_store_release(lock→val, 0) <­> cmpxchg_acquire(lock→val, 0, LOCKED)
44
Acquire/Release Semantics
CPU0
spin_lock
  …
  …
CPU0
spin_lock(&l)
spin_unlock(&l)
CPU1
spin_lock(&l)
  
 
spin_unlock(&l)
CR
CR
RELEASE
ACQUIRE
smp_store_release(lock→val, 0) <­> cmpxchg_acquire(lock→val, 0, LOCKED)
45
Acquire/Release Semantics
CPU0
spin_lock
  …
  …
CPU0
spin_lock(&l)
spin_unlock(&l)
CPU1
spin_lock(&l)
  
 
spin_unlock(&l)
CR
CR
RELEASE
ACQUIRE
smp_store_release(lock→val, 0) <­> cmpxchg_acquire(lock→val, 0, LOCKED)
46
Acquire/Release Semantics
• Regular atomic/RMW calls have been fine grained for
archs that support strict acquire/release semantics.
• Currently only used by arm64 and PPC.
‒ LDAR/STLR
cmpxchg()
cmpxchg_acquire()
cmpxchg_release()
cmpxchg_relaxed()
smp_load_acquire()
smp_cond_acquire()
smp_store_release()
47
Acquire/Release Semantics
• These are minimal guarantees.
‒ Ensuring barriers on both sides of a lock operation will require
therefore, full barrier semantics:
smp_mb__before_spinlock()
smp_mb__after_spinlock()
• Certainly not limited to locking.
‒ perf, IPI paths, scheduler, tty, etc.
48
Acquire/Release Semantics
• Busy-waiting on a variable that requires ACQUIRE
semantics:
CPU0
while (!done)
cpu_relax();
smp_rmb();
CPU1
smp_store_release(done, 1);
49
Acquire/Release Semantics
• Busy-waiting on a variable that requires ACQUIRE
semantics:
CPU0
while (!done)
cpu_relax();
               [LS]  
smp_rmb();     [LL]
CPU1
smp_store_release(done, 1);
50
Acquire/Release Semantics
• Busy-waiting on a variable that requires ACQUIRE
semantics:
CPU0
while (!done)
cpu_relax();
               [LS]  
smp_rmb();     [LL]
CPU1
smp_store_release(done, 1);
smp_load_acquire(!done);
51
Acquire/Release Semantics
• Busy-waiting on a variable that requires ACQUIRE
semantics:
CPU0
while (!done)
cpu_relax();
               [LS]  
smp_rmb();     [LL]
CPU1
smp_store_release(done, 1);
• Fine-graining SMP barriers while a performance
optimization, makes it harder for kernel programmers.
52
Concluding Remarks
• Assume nothing.
• Read memory-barriers.txt
• Use barrier pairings.
• Comment barriers.
Thank you.
54

More Related Content

What's hot

Linux Crash Dump Capture and Analysis
Linux Crash Dump Capture and AnalysisLinux Crash Dump Capture and Analysis
Linux Crash Dump Capture and AnalysisPaul V. Novarese
 
Case study operating systems
Case study operating systemsCase study operating systems
Case study operating systemsAkhil Bevara
 
New Ways to Find Latency in Linux Using Tracing
New Ways to Find Latency in Linux Using TracingNew Ways to Find Latency in Linux Using Tracing
New Ways to Find Latency in Linux Using TracingScyllaDB
 
LISA2019 Linux Systems Performance
LISA2019 Linux Systems PerformanceLISA2019 Linux Systems Performance
LISA2019 Linux Systems PerformanceBrendan Gregg
 
Linux monitoring and Troubleshooting for DBA's
Linux monitoring and Troubleshooting for DBA'sLinux monitoring and Troubleshooting for DBA's
Linux monitoring and Troubleshooting for DBA'sMydbops
 
Reverse Mapping (rmap) in Linux Kernel
Reverse Mapping (rmap) in Linux KernelReverse Mapping (rmap) in Linux Kernel
Reverse Mapping (rmap) in Linux KernelAdrian Huang
 
Physical Memory Models.pdf
Physical Memory Models.pdfPhysical Memory Models.pdf
Physical Memory Models.pdfAdrian Huang
 
LCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
LCA14: LCA14-306: CPUidle & CPUfreq integration with schedulerLCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
LCA14: LCA14-306: CPUidle & CPUfreq integration with schedulerLinaro
 
05.2 virtio introduction
05.2 virtio introduction05.2 virtio introduction
05.2 virtio introductionzenixls2
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsBrendan Gregg
 
GlusterFS CTDB Integration
GlusterFS CTDB IntegrationGlusterFS CTDB Integration
GlusterFS CTDB IntegrationEtsuji Nakai
 
Writing Character driver (loadable module) in linux
Writing Character driver (loadable module) in linuxWriting Character driver (loadable module) in linux
Writing Character driver (loadable module) in linuxRajKumar Rampelli
 
Memory Management with Page Folios
Memory Management with Page FoliosMemory Management with Page Folios
Memory Management with Page FoliosAdrian Huang
 
Glibc内存管理ptmalloc源代码分析4
Glibc内存管理ptmalloc源代码分析4Glibc内存管理ptmalloc源代码分析4
Glibc内存管理ptmalloc源代码分析4hans511002
 
Linux memory-management-kamal
Linux memory-management-kamalLinux memory-management-kamal
Linux memory-management-kamalKamal Maiti
 
Kernel_Crash_Dump_Analysis
Kernel_Crash_Dump_AnalysisKernel_Crash_Dump_Analysis
Kernel_Crash_Dump_AnalysisBuland Singh
 

What's hot (20)

Linux Crash Dump Capture and Analysis
Linux Crash Dump Capture and AnalysisLinux Crash Dump Capture and Analysis
Linux Crash Dump Capture and Analysis
 
Case study operating systems
Case study operating systemsCase study operating systems
Case study operating systems
 
淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道 淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道
 
New Ways to Find Latency in Linux Using Tracing
New Ways to Find Latency in Linux Using TracingNew Ways to Find Latency in Linux Using Tracing
New Ways to Find Latency in Linux Using Tracing
 
LISA2019 Linux Systems Performance
LISA2019 Linux Systems PerformanceLISA2019 Linux Systems Performance
LISA2019 Linux Systems Performance
 
Linux monitoring and Troubleshooting for DBA's
Linux monitoring and Troubleshooting for DBA'sLinux monitoring and Troubleshooting for DBA's
Linux monitoring and Troubleshooting for DBA's
 
Reverse Mapping (rmap) in Linux Kernel
Reverse Mapping (rmap) in Linux KernelReverse Mapping (rmap) in Linux Kernel
Reverse Mapping (rmap) in Linux Kernel
 
Nfs
NfsNfs
Nfs
 
Physical Memory Models.pdf
Physical Memory Models.pdfPhysical Memory Models.pdf
Physical Memory Models.pdf
 
LCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
LCA14: LCA14-306: CPUidle & CPUfreq integration with schedulerLCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
LCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
 
05.2 virtio introduction
05.2 virtio introduction05.2 virtio introduction
05.2 virtio introduction
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old Secrets
 
GlusterFS CTDB Integration
GlusterFS CTDB IntegrationGlusterFS CTDB Integration
GlusterFS CTDB Integration
 
Writing Character driver (loadable module) in linux
Writing Character driver (loadable module) in linuxWriting Character driver (loadable module) in linux
Writing Character driver (loadable module) in linux
 
Memory Management with Page Folios
Memory Management with Page FoliosMemory Management with Page Folios
Memory Management with Page Folios
 
Glibc内存管理ptmalloc源代码分析4
Glibc内存管理ptmalloc源代码分析4Glibc内存管理ptmalloc源代码分析4
Glibc内存管理ptmalloc源代码分析4
 
Linux Kernel I/O Schedulers
Linux Kernel I/O SchedulersLinux Kernel I/O Schedulers
Linux Kernel I/O Schedulers
 
Linux memory-management-kamal
Linux memory-management-kamalLinux memory-management-kamal
Linux memory-management-kamal
 
Character Drivers
Character DriversCharacter Drivers
Character Drivers
 
Kernel_Crash_Dump_Analysis
Kernel_Crash_Dump_AnalysisKernel_Crash_Dump_Analysis
Kernel_Crash_Dump_Analysis
 

Viewers also liked

Futex Scaling for Multi-core Systems
Futex Scaling for Multi-core SystemsFutex Scaling for Multi-core Systems
Futex Scaling for Multi-core SystemsDavidlohr Bueso
 
An Overview of [Linux] Kernel Lock Improvements -- Linuxcon NA 2014
An Overview of [Linux] Kernel Lock Improvements -- Linuxcon NA 2014An Overview of [Linux] Kernel Lock Improvements -- Linuxcon NA 2014
An Overview of [Linux] Kernel Lock Improvements -- Linuxcon NA 2014Davidlohr Bueso
 
Dead Lock Analysis of spin_lock() in Linux Kernel (english)
Dead Lock Analysis of spin_lock() in Linux Kernel (english)Dead Lock Analysis of spin_lock() in Linux Kernel (english)
Dead Lock Analysis of spin_lock() in Linux Kernel (english)Sneeker Yeh
 
Linux kernel development chapter 10
Linux kernel development chapter 10Linux kernel development chapter 10
Linux kernel development chapter 10huangachou
 
Enabling ARM® Server Technology for the Datacenter
Enabling ARM® Server Technology for the DatacenterEnabling ARM® Server Technology for the Datacenter
Enabling ARM® Server Technology for the DatacenterAMD
 
6 Dean Google
6 Dean Google6 Dean Google
6 Dean GoogleFrank Cai
 
Red Hat Virtualization Where Performance Takes Off!
Red Hat Virtualization Where Performance Takes Off!Red Hat Virtualization Where Performance Takes Off!
Red Hat Virtualization Where Performance Takes Off!andreas kuncoro
 
Sql server engine cpu cache as the new ram
Sql server engine cpu cache as the new ramSql server engine cpu cache as the new ram
Sql server engine cpu cache as the new ramChris Adkin
 
Linux Locking Mechanisms
Linux Locking MechanismsLinux Locking Mechanisms
Linux Locking MechanismsKernel TLV
 
Red hat enterprise_virtualization_load
Red hat enterprise_virtualization_loadRed hat enterprise_virtualization_load
Red hat enterprise_virtualization_loadsilviucojocaru
 
Linux and H/W optimizations for MySQL
Linux and H/W optimizations for MySQLLinux and H/W optimizations for MySQL
Linux and H/W optimizations for MySQLYoshinori Matsunobu
 
6th Generation Processor Announcement
6th Generation Processor Announcement6th Generation Processor Announcement
6th Generation Processor AnnouncementAMD
 
ENERGY EFFICIENCY OF ARM ARCHITECTURES FOR CLOUD COMPUTING APPLICATIONS
ENERGY EFFICIENCY OF ARM ARCHITECTURES FOR CLOUD COMPUTING APPLICATIONSENERGY EFFICIENCY OF ARM ARCHITECTURES FOR CLOUD COMPUTING APPLICATIONS
ENERGY EFFICIENCY OF ARM ARCHITECTURES FOR CLOUD COMPUTING APPLICATIONSStephan Cadene
 
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 vCPUsJiannan Ouyang, PhD
 
Achieving Performance Isolation with Lightweight Co-Kernels
Achieving Performance Isolation with Lightweight Co-KernelsAchieving Performance Isolation with Lightweight Co-Kernels
Achieving Performance Isolation with Lightweight Co-KernelsJiannan Ouyang, PhD
 
LinuxCon2009: 10Gbit/s Bi-Directional Routing on standard hardware running Linux
LinuxCon2009: 10Gbit/s Bi-Directional Routing on standard hardware running LinuxLinuxCon2009: 10Gbit/s Bi-Directional Routing on standard hardware running Linux
LinuxCon2009: 10Gbit/s Bi-Directional Routing on standard hardware running Linuxbrouer
 
Denser, cooler, faster, stronger: PHP on ARM microservers
Denser, cooler, faster, stronger: PHP on ARM microserversDenser, cooler, faster, stronger: PHP on ARM microservers
Denser, cooler, faster, stronger: PHP on ARM microserversJez Halford
 

Viewers also liked (20)

Futex Scaling for Multi-core Systems
Futex Scaling for Multi-core SystemsFutex Scaling for Multi-core Systems
Futex Scaling for Multi-core Systems
 
An Overview of [Linux] Kernel Lock Improvements -- Linuxcon NA 2014
An Overview of [Linux] Kernel Lock Improvements -- Linuxcon NA 2014An Overview of [Linux] Kernel Lock Improvements -- Linuxcon NA 2014
An Overview of [Linux] Kernel Lock Improvements -- Linuxcon NA 2014
 
Dead Lock Analysis of spin_lock() in Linux Kernel (english)
Dead Lock Analysis of spin_lock() in Linux Kernel (english)Dead Lock Analysis of spin_lock() in Linux Kernel (english)
Dead Lock Analysis of spin_lock() in Linux Kernel (english)
 
Linux kernel development chapter 10
Linux kernel development chapter 10Linux kernel development chapter 10
Linux kernel development chapter 10
 
Enabling ARM® Server Technology for the Datacenter
Enabling ARM® Server Technology for the DatacenterEnabling ARM® Server Technology for the Datacenter
Enabling ARM® Server Technology for the Datacenter
 
6 Dean Google
6 Dean Google6 Dean Google
6 Dean Google
 
Red Hat Virtualization Where Performance Takes Off!
Red Hat Virtualization Where Performance Takes Off!Red Hat Virtualization Where Performance Takes Off!
Red Hat Virtualization Where Performance Takes Off!
 
Sql server engine cpu cache as the new ram
Sql server engine cpu cache as the new ramSql server engine cpu cache as the new ram
Sql server engine cpu cache as the new ram
 
Java memory model
Java memory modelJava memory model
Java memory model
 
Linux Locking Mechanisms
Linux Locking MechanismsLinux Locking Mechanisms
Linux Locking Mechanisms
 
Red hat enterprise_virtualization_load
Red hat enterprise_virtualization_loadRed hat enterprise_virtualization_load
Red hat enterprise_virtualization_load
 
Linux and H/W optimizations for MySQL
Linux and H/W optimizations for MySQLLinux and H/W optimizations for MySQL
Linux and H/W optimizations for MySQL
 
6th Generation Processor Announcement
6th Generation Processor Announcement6th Generation Processor Announcement
6th Generation Processor Announcement
 
ENERGY EFFICIENCY OF ARM ARCHITECTURES FOR CLOUD COMPUTING APPLICATIONS
ENERGY EFFICIENCY OF ARM ARCHITECTURES FOR CLOUD COMPUTING APPLICATIONSENERGY EFFICIENCY OF ARM ARCHITECTURES FOR CLOUD COMPUTING APPLICATIONS
ENERGY EFFICIENCY OF ARM ARCHITECTURES FOR CLOUD COMPUTING APPLICATIONS
 
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
 
Achieving Performance Isolation with Lightweight Co-Kernels
Achieving Performance Isolation with Lightweight Co-KernelsAchieving Performance Isolation with Lightweight Co-Kernels
Achieving Performance Isolation with Lightweight Co-Kernels
 
LinuxCon2009: 10Gbit/s Bi-Directional Routing on standard hardware running Linux
LinuxCon2009: 10Gbit/s Bi-Directional Routing on standard hardware running LinuxLinuxCon2009: 10Gbit/s Bi-Directional Routing on standard hardware running Linux
LinuxCon2009: 10Gbit/s Bi-Directional Routing on standard hardware running Linux
 
Denser, cooler, faster, stronger: PHP on ARM microservers
Denser, cooler, faster, stronger: PHP on ARM microserversDenser, cooler, faster, stronger: PHP on ARM microservers
Denser, cooler, faster, stronger: PHP on ARM microservers
 
Cache profiling on ARM Linux
Cache profiling on ARM LinuxCache profiling on ARM Linux
Cache profiling on ARM Linux
 
Docker by demo
Docker by demoDocker by demo
Docker by demo
 

Similar to Memory Barriers in the Linux Kernel

W1.1 i os in database
W1.1   i os in databaseW1.1   i os in database
W1.1 i os in databasegafurov_x
 
Cpu Cache and Memory Ordering——并发程序设计入门
Cpu Cache and Memory Ordering——并发程序设计入门Cpu Cache and Memory Ordering——并发程序设计入门
Cpu Cache and Memory Ordering——并发程序设计入门frogd
 
Parallelism Processor Design
Parallelism Processor DesignParallelism Processor Design
Parallelism Processor DesignSri Prasanna
 
Asynchronous Io Programming
Asynchronous Io ProgrammingAsynchronous Io Programming
Asynchronous Io Programmingl xf
 
lec5 - The processor.pptx
lec5 - The processor.pptxlec5 - The processor.pptx
lec5 - The processor.pptxMahadevaAH
 
ScyllaDB: NoSQL at Ludicrous Speed
ScyllaDB: NoSQL at Ludicrous SpeedScyllaDB: NoSQL at Ludicrous Speed
ScyllaDB: NoSQL at Ludicrous SpeedJ On The Beach
 
Spark Summit EU talk by Qifan Pu
Spark Summit EU talk by Qifan PuSpark Summit EU talk by Qifan Pu
Spark Summit EU talk by Qifan PuSpark Summit
 
qdoc.tips_oracle-dba-interview-questions.pdf
qdoc.tips_oracle-dba-interview-questions.pdfqdoc.tips_oracle-dba-interview-questions.pdf
qdoc.tips_oracle-dba-interview-questions.pdfOsamaQahtan
 
[Harvard CS264] 02 - Parallel Thinking, Architecture, Theory & Patterns
[Harvard CS264] 02 - Parallel Thinking, Architecture, Theory & Patterns[Harvard CS264] 02 - Parallel Thinking, Architecture, Theory & Patterns
[Harvard CS264] 02 - Parallel Thinking, Architecture, Theory & Patternsnpinto
 
Integrating Cache Oblivious Approach with Modern Processor Architecture: The ...
Integrating Cache Oblivious Approach with Modern Processor Architecture: The ...Integrating Cache Oblivious Approach with Modern Processor Architecture: The ...
Integrating Cache Oblivious Approach with Modern Processor Architecture: The ...Tokyo Institute of Technology
 
Scylla Summit 2018: Make Scylla Fast Again! Find out how using Tools, Talent,...
Scylla Summit 2018: Make Scylla Fast Again! Find out how using Tools, Talent,...Scylla Summit 2018: Make Scylla Fast Again! Find out how using Tools, Talent,...
Scylla Summit 2018: Make Scylla Fast Again! Find out how using Tools, Talent,...ScyllaDB
 
Smashing the stack for fun and profit
Smashing the stack for fun and profitSmashing the stack for fun and profit
Smashing the stack for fun and profitAlexey Miasoedov
 
Porting FreeRTOS on OpenRISC
Porting FreeRTOS   on   OpenRISCPorting FreeRTOS   on   OpenRISC
Porting FreeRTOS on OpenRISCYi-Chiao
 
Re-Architecting Spark For Performance Understandability
Re-Architecting Spark For Performance UnderstandabilityRe-Architecting Spark For Performance Understandability
Re-Architecting Spark For Performance UnderstandabilityJen Aman
 
Re-Architecting Spark For Performance Understandability
Re-Architecting Spark For Performance UnderstandabilityRe-Architecting Spark For Performance Understandability
Re-Architecting Spark For Performance UnderstandabilityJen Aman
 

Similar to Memory Barriers in the Linux Kernel (20)

Memory model
Memory modelMemory model
Memory model
 
W1.1 i os in database
W1.1   i os in databaseW1.1   i os in database
W1.1 i os in database
 
Cpu Cache and Memory Ordering——并发程序设计入门
Cpu Cache and Memory Ordering——并发程序设计入门Cpu Cache and Memory Ordering——并发程序设计入门
Cpu Cache and Memory Ordering——并发程序设计入门
 
Parallelism Processor Design
Parallelism Processor DesignParallelism Processor Design
Parallelism Processor Design
 
Asynchronous Io Programming
Asynchronous Io ProgrammingAsynchronous Io Programming
Asynchronous Io Programming
 
lec5 - The processor.pptx
lec5 - The processor.pptxlec5 - The processor.pptx
lec5 - The processor.pptx
 
Beginbackup
BeginbackupBeginbackup
Beginbackup
 
ScyllaDB: NoSQL at Ludicrous Speed
ScyllaDB: NoSQL at Ludicrous SpeedScyllaDB: NoSQL at Ludicrous Speed
ScyllaDB: NoSQL at Ludicrous Speed
 
Spark Summit EU talk by Qifan Pu
Spark Summit EU talk by Qifan PuSpark Summit EU talk by Qifan Pu
Spark Summit EU talk by Qifan Pu
 
qdoc.tips_oracle-dba-interview-questions.pdf
qdoc.tips_oracle-dba-interview-questions.pdfqdoc.tips_oracle-dba-interview-questions.pdf
qdoc.tips_oracle-dba-interview-questions.pdf
 
spinlock.pdf
spinlock.pdfspinlock.pdf
spinlock.pdf
 
Memory model
Memory modelMemory model
Memory model
 
Lec7
Lec7Lec7
Lec7
 
[Harvard CS264] 02 - Parallel Thinking, Architecture, Theory & Patterns
[Harvard CS264] 02 - Parallel Thinking, Architecture, Theory & Patterns[Harvard CS264] 02 - Parallel Thinking, Architecture, Theory & Patterns
[Harvard CS264] 02 - Parallel Thinking, Architecture, Theory & Patterns
 
Integrating Cache Oblivious Approach with Modern Processor Architecture: The ...
Integrating Cache Oblivious Approach with Modern Processor Architecture: The ...Integrating Cache Oblivious Approach with Modern Processor Architecture: The ...
Integrating Cache Oblivious Approach with Modern Processor Architecture: The ...
 
Scylla Summit 2018: Make Scylla Fast Again! Find out how using Tools, Talent,...
Scylla Summit 2018: Make Scylla Fast Again! Find out how using Tools, Talent,...Scylla Summit 2018: Make Scylla Fast Again! Find out how using Tools, Talent,...
Scylla Summit 2018: Make Scylla Fast Again! Find out how using Tools, Talent,...
 
Smashing the stack for fun and profit
Smashing the stack for fun and profitSmashing the stack for fun and profit
Smashing the stack for fun and profit
 
Porting FreeRTOS on OpenRISC
Porting FreeRTOS   on   OpenRISCPorting FreeRTOS   on   OpenRISC
Porting FreeRTOS on OpenRISC
 
Re-Architecting Spark For Performance Understandability
Re-Architecting Spark For Performance UnderstandabilityRe-Architecting Spark For Performance Understandability
Re-Architecting Spark For Performance Understandability
 
Re-Architecting Spark For Performance Understandability
Re-Architecting Spark For Performance UnderstandabilityRe-Architecting Spark For Performance Understandability
Re-Architecting Spark For Performance Understandability
 

Recently uploaded

Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsJean Silva
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?Alexandre Beguel
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingShane Coughlan
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptxVinzoCenzo
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfRTS corp
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
Data modeling 101 - Basics - Software Domain
Data modeling 101 - Basics - Software DomainData modeling 101 - Basics - Software Domain
Data modeling 101 - Basics - Software DomainAbdul Ahad
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldRoberto Pérez Alcolea
 
Copilot para Microsoft 365 y Power Platform Copilot
Copilot para Microsoft 365 y Power Platform CopilotCopilot para Microsoft 365 y Power Platform Copilot
Copilot para Microsoft 365 y Power Platform CopilotEdgard Alejos
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxRTS corp
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfmaor17
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITmanoharjgpsolutions
 
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdfAndrey Devyatkin
 

Recently uploaded (20)

Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero results
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptx
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
Data modeling 101 - Basics - Software Domain
Data modeling 101 - Basics - Software DomainData modeling 101 - Basics - Software Domain
Data modeling 101 - Basics - Software Domain
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
Copilot para Microsoft 365 y Power Platform Copilot
Copilot para Microsoft 365 y Power Platform CopilotCopilot para Microsoft 365 y Power Platform Copilot
Copilot para Microsoft 365 y Power Platform Copilot
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdf
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh IT
 
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
 

Memory Barriers in the Linux Kernel