Skip to content

guowangy/kernel-lock-bench

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Linux Kernel spinlock Benchmark

Benchmark for testing Linux kernel spin locks performance with different threads and critical sections. The test scenario is similar to glibc bench-pthread-lock.

The bench configuration consists of 3 parts:

  1. thread number
  2. critical-section length
  3. non-critical-section length

The length is the number of unit work, each unit work will roughly take 15 cycles in Icelake.

Usage

Compile and install the kernel module:

make
sudo make install

Run the test

echo "[nthreads] [crit_len] [non_crit_len] > /proc/spinlock_bench

# nthreads should <= num_online_cpus()
# example: echo "16 2 8" > /proc/spinlock_bench

Check the results

cat /proc/spinlock_bench

The benchmark will run several rounds and show result in throughputs. The highest and lowest number are discarded as outliers.

About

Lock micro benchmarks for Linux kernel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published