sched/preempt: Tell about PREEMPT_DYNAMIC on kernel headers
PATCH 1/1 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.
--- init/Makefile | 3 ++- scripts/mkcompile_h | 15 +++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-)
init/Makefile +2 -1
@@ -31,7 +31,8 @@ quiet_cmd_compile.h = CHK $@ cmd_compile.h = \ $(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \ "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT_BUILD)" \ - "$(CONFIG_PREEMPT_RT)" "$(CONFIG_CC_VERSION_TEXT)" "$(LD)" + "$(CONFIG_PREEMPT_DYNAMIC)" "$(CONFIG_PREEMPT_RT)" \ + "$(CONFIG_CC_VERSION_TEXT)" "$(LD)" include/generated/compile.h: FORCE $(call cmd,compile.h)
scripts/mkcompile_h +11 -4
@@ -5,9 +5,10 @@ TARGET=$1 ARCH=$2 SMP=$3 PREEMPT=$4 -PREEMPT_RT=$5 -CC_VERSION="$6" -LD=$7 +PREEMPT_DYNAMIC=$5 +PREEMPT_RT=$6 +CC_VERSION="$7" +LD=$8 # Do not expand names set -f
@@ -41,7 +42,13 @@ fi UTS_VERSION="#$VERSION" CONFIG_FLAGS="" if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi -if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi +if [ -n "$PREEMPT" ] ; then + if [ -n "$PREEMPT_DYNAMIC" ] ; then + CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT_DYNAMIC"; + else + CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; + fi +fi if [ -n "$PREEMPT_RT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT_RT"; fi # Truncate to maximum length
Signature · 1 line
2.25.1
Quoted 8 lines · Frederic Weisbecker
Displaying "PREEMPT" on kernel headers when
CONFIG_PREEMPT_DYNAMIC=ycan be misleading for anybody involved in remote debugging because it is then not guaranteed that there is an actual preemption behaviour. It depends on defaultKconfigor boot defined choices.Therefore, tell about
PREEMPT_DYNAMICon static kernel headers and leave the search for the actual preemption behaviour to browsing dmesg.
Looks sensible. One small further cleanup nit below, otherwise:
Quoted 43 lines
Signed-off-by Frederic Weisbecker <[email protected]>Cc Valentin Schneider <[email protected]>--- init/Makefile | 3 ++- scripts/mkcompile_h | 15 +++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-)init/Makefile +2
-1@@ -31,7 +31,8 @@ quiet_cmd_compile.h = CHK $@ cmd_compile.h = \ $(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \ "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT_BUILD)" \ - "$(CONFIG_PREEMPT_RT)" "$(CONFIG_CC_VERSION_TEXT)" "$(LD)" + "$(CONFIG_PREEMPT_DYNAMIC)" "$(CONFIG_PREEMPT_RT)" \ + "$(CONFIG_CC_VERSION_TEXT)" "$(LD)" include/generated/compile.h: FORCE $(call cmd,compile.h)scripts/mkcompile_h +4
-3@@ -5,9 +5,10 @@ TARGET=$1 ARCH=$2 SMP=$3 PREEMPT=$4 -PREEMPT_RT=$5 -CC_VERSION="$6" -LD=$7 +PREEMPT_DYNAMIC=$5 +PREEMPT_RT=$6 +CC_VERSION="$7" +LD=$8 # Do not expand names set -f@@ -41,7 +42,13 @@ fi UTS_VERSION="#$VERSION" CONFIG_FLAGS="" if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi
scripts/mkcompile_h fi · line 53
Quoted 10 lines
scripts/mkcompile_h +7
-1-if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi +if [ -n "$PREEMPT" ] ; then + if [ -n "$PREEMPT_DYNAMIC" ] ; then + CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT_DYNAMIC"; + else + CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; + fi +fi if [ -n "$PREEMPT_RT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT_RT"; fi
I got suspicious of that PREEMPT_RT line, but it works because PREEMPT_BUILD and PREEMPT_RT are mutually exclusive. Nevertheless, could we clear out the ambiguity and make that into:
if [ -n "$PREEMPT_RT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT_RT";
elif [ -n "$PREEMPT_DYNAMIC" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT_DYNAMIC";
elif [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT";
fi
Quoted 3 lines
scripts/mkcompile_h +0
-1# Truncate to maximum length --2.25.1
PATCH v2 1/1 sched/preempt: Tell about PREEMPT_DYNAMIC on kernel headers
Quoted 13 lines · Valentin Schneider
Quoted 8 lines · Frederic Weisbecker
Displaying "PREEMPT" on kernel headers when
CONFIG_PREEMPT_DYNAMIC=ycan be misleading for anybody involved in remote debugging because it is then not guaranteed that there is an actual preemption behaviour. It depends on defaultKconfigor boot defined choices.Therefore, tell about
PREEMPT_DYNAMICon static kernel headers and leave the search for the actual preemption behaviour to browsing dmesg.Looks sensible. One small further cleanup nit below, otherwise:
Reviewed-by Valentin Schneider <[email protected]>
[...]
Quoted 9 lines
I got suspicious of that
PREEMPT_RTline, but it works becausePREEMPT_BUILDandPREEMPT_RTare mutually exclusive. Nevertheless, could we clear out the ambiguity and make that into:if [ -n "$PREEMPT_RT" ] ; then
CONFIG_FLAGS="$CONFIG_FLAGSPREEMPT_RT";
elif [ -n "$PREEMPT_DYNAMIC" ] ; thenCONFIG_FLAGS="$CONFIG_FLAGSPREEMPT_DYNAMIC";
elif [ -n "$PREEMPT" ] ; thenCONFIG_FLAGS="$CONFIG_FLAGSPREEMPT";
fi
Good point!
Here you go:
---
From: Frederic Weisbecker <[email protected]>
Date: Wed, 2 Feb 2022 15:59:54 +0100
Subject: [PATCH] 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.
--- init/Makefile | 3 ++- scripts/mkcompile_h | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-)
init/Makefile +2 -1
@@ -31,7 +31,8 @@ quiet_cmd_compile.h = CHK $@ cmd_compile.h = \ $(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \ "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT_BUILD)" \ - "$(CONFIG_PREEMPT_RT)" "$(CONFIG_CC_VERSION_TEXT)" "$(LD)" + "$(CONFIG_PREEMPT_DYNAMIC)" "$(CONFIG_PREEMPT_RT)" \ + "$(CONFIG_CC_VERSION_TEXT)" "$(LD)" include/generated/compile.h: FORCE $(call cmd,compile.h)
scripts/mkcompile_h +12 -5
@@ -5,9 +5,10 @@ TARGET=$1 ARCH=$2 SMP=$3 PREEMPT=$4 -PREEMPT_RT=$5 -CC_VERSION="$6" -LD=$7 +PREEMPT_DYNAMIC=$5 +PREEMPT_RT=$6 +CC_VERSION="$7" +LD=$8 # Do not expand names set -f
@@ -41,8 +42,14 @@ fi UTS_VERSION="#$VERSION" CONFIG_FLAGS="" if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi -if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi -if [ -n "$PREEMPT_RT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT_RT"; fi + +if [ -n "$PREEMPT_RT" ] ; then + CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT_RT" +elif [ -n "$PREEMPT_DYNAMIC" ] ; then + CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT_DYNAMIC" +elif [ -n "$PREEMPT" ] ; then + CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT" +fi # Truncate to maximum length UTS_LEN=64
Signature · 1 line
2.25.1
Quoted 9 lines · Frederic Weisbecker
From: Frederic Weisbecker <[email protected]>
Date: Wed, 2 Feb 2022 15:59:54 +0100
Subject: [PATCH] sched/preempt: Tell aboutPREEMPT_DYNAMICon kernel headersDisplaying "PREEMPT" on kernel headers when
CONFIG_PREEMPT_DYNAMIC=ycan be misleading for anybody involved in remote debugging because it is then not guaranteed that there is an actual preemption behaviour. It depends on defaultKconfigor boot defined choices.
Quoted 5 lines
Therefore, tell about
PREEMPT_DYNAMICon 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]>
Hurmph.. if you all think this matters I suppose.
Let me go queue it.
Quoted 57 lines
--- init/Makefile | 3 ++- scripts/mkcompile_h | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-)init/Makefile +2
-1@@ -31,7 +31,8 @@ quiet_cmd_compile.h = CHK $@ cmd_compile.h = \ $(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \ "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT_BUILD)" \ - "$(CONFIG_PREEMPT_RT)" "$(CONFIG_CC_VERSION_TEXT)" "$(LD)" + "$(CONFIG_PREEMPT_DYNAMIC)" "$(CONFIG_PREEMPT_RT)" \ + "$(CONFIG_CC_VERSION_TEXT)" "$(LD)" include/generated/compile.h: FORCE $(call cmd,compile.h)scripts/mkcompile_h +12
-5@@ -5,9 +5,10 @@ TARGET=$1 ARCH=$2 SMP=$3 PREEMPT=$4 -PREEMPT_RT=$5 -CC_VERSION="$6" -LD=$7 +PREEMPT_DYNAMIC=$5 +PREEMPT_RT=$6 +CC_VERSION="$7" +LD=$8 # Do not expand names set -f@@ -41,8 +42,14 @@ fi UTS_VERSION="#$VERSION" CONFIG_FLAGS="" if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi -if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi -if [ -n "$PREEMPT_RT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT_RT"; fi + +if [ -n "$PREEMPT_RT" ] ; then + CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT_RT" +elif [ -n "$PREEMPT_DYNAMIC" ] ; then + CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT_DYNAMIC" +elif [ -n "$PREEMPT" ] ; then + CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT" +fi # Truncate to maximum length UTS_LEN=64Signature · 1 line
2.25.1
The following commit has been merged into the sched/core branch of tip:
The following commit has been merged into the sched/core branch of tip:
Commit-ID: a0a7e453b502cbbf7ff372f907a4e27a2ebf5445 Gitweb: https://git.kernel.org/tip/a0a7e453b502cbbf7ff372f907a4e27a2ebf5445 Author: Frederic Weisbecker <[email protected]> AuthorDate: Thu, 17 Feb 2022 12:12:40 +01:00 Committer: Peter Zijlstra <[email protected]> CommitterDate: Fri, 11 Mar 2022 15:36:35 +01:00
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.
--- init/Makefile | 3 ++- scripts/mkcompile_h | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-)
init/Makefile +2 -1
@@ -31,7 +31,8 @@ quiet_cmd_compile.h = CHK $@ cmd_compile.h = \ $(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \ "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT_BUILD)" \ - "$(CONFIG_PREEMPT_RT)" "$(CONFIG_CC_VERSION_TEXT)" "$(LD)" + "$(CONFIG_PREEMPT_DYNAMIC)" "$(CONFIG_PREEMPT_RT)" \ + "$(CONFIG_CC_VERSION_TEXT)" "$(LD)" include/generated/compile.h: FORCE $(call cmd,compile.h)
scripts/mkcompile_h +12 -5
@@ -5,9 +5,10 @@ TARGET=$1 ARCH=$2 SMP=$3 PREEMPT=$4 -PREEMPT_RT=$5 -CC_VERSION="$6" -LD=$7 +PREEMPT_DYNAMIC=$5 +PREEMPT_RT=$6 +CC_VERSION="$7" +LD=$8 # Do not expand names set -f
@@ -41,8 +42,14 @@ fi UTS_VERSION="#$VERSION" CONFIG_FLAGS="" if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi -if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi -if [ -n "$PREEMPT_RT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT_RT"; fi + +if [ -n "$PREEMPT_RT" ] ; then + CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT_RT" +elif [ -n "$PREEMPT_DYNAMIC" ] ; then + CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT_DYNAMIC" +elif [ -n "$PREEMPT" ] ; then + CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT" +fi # Truncate to maximum length UTS_LEN=64