summaryrefslogtreecommitdiff
path: root/include/linux/compiler_types.h
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2023-01-12 20:44:04 +0100
committerIngo Molnar <mingo@kernel.org>2023-01-13 11:48:18 +0100
commit0e985e9d22864e29d5d2b3d909ad15134d7f6d46 (patch)
tree710fbac5e48688b81dec48394c2007de459252ce /include/linux/compiler_types.h
parent26388a7c353f7b1d3fd8a6df6452fa9773193155 (diff)
cpuidle: Add comments about noinstr/__cpuidle usage
Add a few words on noinstr / __cpuidle usage. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20230112195542.397238052@infradead.org
Diffstat (limited to 'include/linux/compiler_types.h')
-rw-r--r--include/linux/compiler_types.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h
index d7858901f035..dea5bf5bd09c 100644
--- a/include/linux/compiler_types.h
+++ b/include/linux/compiler_types.h
@@ -239,6 +239,16 @@ struct ftrace_likely_data {
#define noinstr __noinstr_section(".noinstr.text")
+/*
+ * The __cpuidle section is used twofold:
+ *
+ * 1) the original use -- identifying if a CPU is 'stuck' in idle state based
+ * on it's instruction pointer. See cpu_in_idle().
+ *
+ * 2) supressing instrumentation around where cpuidle disables RCU; where the
+ * function isn't strictly required for #1, this is interchangeable with
+ * noinstr.
+ */
#define __cpuidle __noinstr_section(".cpuidle.text")
#endif /* __KERNEL__ */