• Kees Cook's avatar
    lkdtm: Provide timing tests for atomic_t vs refcount_t · c7fea488
    Kees Cook authored
    While not a crash test, this does provide two tight atomic_t and
    refcount_t loops for performance comparisons:
    
    	cd /sys/kernel/debug/provoke-crash
    	perf stat -B -- cat <(echo ATOMIC_TIMING) > DIRECT
    	perf stat -B -- cat <(echo REFCOUNT_TIMING) > DIRECT
    
    Looking a CPU cycles is the best way to example the fast-path (rather
    than instruction counts, since conditional jumps will be executed but
    will be negligible due to branch-prediction).
    Signed-off-by: default avatarKees Cook <keescook@chromium.org>
    c7fea488
lkdtm_refcount.c 9.92 KB