Skip to content

Commit a0a7e45

Browse files
Frederic WeisbeckerPeter Zijlstra
authored andcommitted
sched/preempt: Tell about PREEMPT_DYNAMIC on kernel headers
Displaying "PREEMPT" on kernel headers when CONFIG_PREEMPT_DYNAMIC=y can be misleading for anybody involved in remote debugging because it is then not guaranteed that there is an actual preemption behaviour. It depends on default Kconfig or boot defined choices. Therefore, tell about PREEMPT_DYNAMIC on static kernel headers and leave the search for the actual preemption behaviour to browsing dmesg. Reviewed-by: Valentin Schneider <[email protected]> Signed-off-by: Frederic Weisbecker <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/20220217111240.GA742892@lothringen
1 parent 7f434df commit a0a7e45

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

init/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ quiet_cmd_compile.h = CHK $@
3131
cmd_compile.h = \
3232
$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \
3333
"$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT_BUILD)" \
34-
"$(CONFIG_PREEMPT_RT)" "$(CONFIG_CC_VERSION_TEXT)" "$(LD)"
34+
"$(CONFIG_PREEMPT_DYNAMIC)" "$(CONFIG_PREEMPT_RT)" \
35+
"$(CONFIG_CC_VERSION_TEXT)" "$(LD)"
3536

3637
include/generated/compile.h: FORCE
3738
$(call cmd,compile.h)

scripts/mkcompile_h

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ TARGET=$1
55
ARCH=$2
66
SMP=$3
77
PREEMPT=$4
8-
PREEMPT_RT=$5
9-
CC_VERSION="$6"
10-
LD=$7
8+
PREEMPT_DYNAMIC=$5
9+
PREEMPT_RT=$6
10+
CC_VERSION="$7"
11+
LD=$8
1112

1213
# Do not expand names
1314
set -f
@@ -41,8 +42,14 @@ fi
4142
UTS_VERSION="#$VERSION"
4243
CONFIG_FLAGS=""
4344
if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi
44-
if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi
45-
if [ -n "$PREEMPT_RT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT_RT"; fi
45+
46+
if [ -n "$PREEMPT_RT" ] ; then
47+
CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT_RT"
48+
elif [ -n "$PREEMPT_DYNAMIC" ] ; then
49+
CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT_DYNAMIC"
50+
elif [ -n "$PREEMPT" ] ; then
51+
CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"
52+
fi
4653

4754
# Truncate to maximum length
4855
UTS_LEN=64

0 commit comments

Comments
 (0)