How can I check my kernel preemption configuration?

Whether a kernel is preemptive or not depends on what you want to preempt, as in the Linux kernel, there are various things that can have preemption enabled/disabled separately.

If your kernel has CONFIG_IKCONFIG and CONFIG_IKCONFIG_PROC enabled, you can find out your preemption configuration through /proc/config.gz (if you don't have this, some distributions ship the kernel config in /boot instead):

$ gzip -cd /proc/config.gz | grep PREEMPT
CONFIG_TREE_PREEMPT_RCU=y
CONFIG_PREEMPT_RCU=y
CONFIG_PREEMPT_NOTIFIERS=y
# CONFIG_PREEMPT_NONE is not set
# CONFIG_PREEMPT_VOLUNTARY is not set
CONFIG_PREEMPT=y
CONFIG_PREEMPT_COUNT=y
# CONFIG_DEBUG_PREEMPT is not set
# CONFIG_PREEMPT_TRACER is not set

If you have CONFIG_IKCONFIG, but not CONFIG_IKCONFIG_PROC, you can still get it out of the kernel image with extract-ikconfig.


A preemptible kernel (low-latency desktop) has PREEMPT tagged in its version name (uname -a). This also appears in /proc/version and in the "version magic" string used to decide whether modules can/cannot be loaded on a given kernel, e.g.

mymodule: version magic '3.4.35 mod_unload ARMv7 p2v8 ' 
              should be '3.4.35 preempt mod_unload ARMv7 p2v8 '

No such tagging exist for CONFIG_PREEMPT_VOLUNTARY, afaik.

Tags:

Linux

Kernel