]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - lib/Kconfig.kfence
printk: restore flushing of NMI buffers on remote CPUs after NMI backtraces
[mirror_ubuntu-jammy-kernel.git] / lib / Kconfig.kfence
index 78f50ccb3b45ff9333a2de947f05c95dc7c35e2c..912f252a41fc63744b168ddb43dcd42aec07433e 100644 (file)
@@ -7,6 +7,7 @@ menuconfig KFENCE
        bool "KFENCE: low-overhead sampling-based memory safety error detector"
        depends on HAVE_ARCH_KFENCE && (SLAB || SLUB)
        select STACKTRACE
+       select IRQ_WORK
        help
          KFENCE is a low-overhead sampling-based detector of heap out-of-bounds
          access, use-after-free, and invalid-free errors. KFENCE is designed
@@ -24,17 +25,6 @@ menuconfig KFENCE
 
 if KFENCE
 
-config KFENCE_STATIC_KEYS
-       bool "Use static keys to set up allocations"
-       default y
-       depends on JUMP_LABEL # To ensure performance, require jump labels
-       help
-         Use static keys (static branches) to set up KFENCE allocations. Using
-         static keys is normally recommended, because it avoids a dynamic
-         branch in the allocator's fast path. However, with very low sample
-         intervals, or on systems that do not support jump labels, a dynamic
-         branch may still be an acceptable performance trade-off.
-
 config KFENCE_SAMPLE_INTERVAL
        int "Default sample interval in milliseconds"
        default 100
@@ -55,6 +45,21 @@ config KFENCE_NUM_OBJECTS
          pages are required; with one containing the object and two adjacent
          ones used as guard pages.
 
+config KFENCE_STATIC_KEYS
+       bool "Use static keys to set up allocations" if EXPERT
+       depends on JUMP_LABEL
+       help
+         Use static keys (static branches) to set up KFENCE allocations. This
+         option is only recommended when using very large sample intervals, or
+         performance has carefully been evaluated with this option.
+
+         Using static keys comes with trade-offs that need to be carefully
+         evaluated given target workloads and system architectures. Notably,
+         enabling and disabling static keys invoke IPI broadcasts, the latency
+         and impact of which is much harder to predict than a dynamic branch.
+
+         Say N if you are unsure.
+
 config KFENCE_STRESS_TEST_FAULTS
        int "Stress testing of fault handling and error reporting" if EXPERT
        default 0