From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0A72C433EF for ; Thu, 17 Feb 2022 11:12:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239321AbiBQLND (ORCPT ); Thu, 17 Feb 2022 06:13:03 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:60182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231664AbiBQLNA (ORCPT ); Thu, 17 Feb 2022 06:13:00 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49B4E1DE8BC for ; Thu, 17 Feb 2022 03:12:46 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 023FCB82120 for ; Thu, 17 Feb 2022 11:12:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36156C340E8; Thu, 17 Feb 2022 11:12:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645096363; bh=4vyVg3lYc5vB8v5XnU2hefV+S70YYNeOi2ZcjG7nAjE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SSa1IC9fhvgmDYrRdk+if9uK/wx/p2iG8u6OuXqRB5Wq7RueEdM5eEPNn0LpV8OR2 UGqmOwhNlci7MoZEZ1WgXBNTPwVT3ndz8c+lVQHs6a09eCy/52v4sg9gNwLIbXyJfP lLjocmdmjo8aUEEyNk2/dTw8wo7+FRbV+PrvHqU4elOo4Yt5RW4HYEDLntJsvEdb9K Aszae3Zx0BwuHr+9N8Yn/87KbfIqAMFSWXSQD9XgtCPDjcZvv4VVZKXHEP9DiqXkDk /DtseDkGdMqow6HGU12gHFo9E+cSASArZT/SIpI93JvWx+mfuubbPhjoCOjRQliTuz Ox7aB3HXQf+UA== Date: Thu, 17 Feb 2022 12:12:40 +0100 From: Frederic Weisbecker To: Valentin Schneider Cc: Peter Zijlstra , LKML Subject: [PATCH v2] sched/preempt: Tell about PREEMPT_DYNAMIC on kernel headers Message-ID: <20220217111240.GA742892@lothringen> References: <20220202145954.458370-1-frederic@kernel.org> <87mtj9nn3q.mognet@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87mtj9nn3q.mognet@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 02, 2022 at 06:24:09PM +0000, Valentin Schneider wrote: > On 02/02/22 15:59, Frederic Weisbecker wrote: > > 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. > > > > Looks sensible. One small further cleanup nit below, otherwise: > > Reviewed-by: Valentin Schneider [...] > > 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 Good point! Here you go: --- From: Frederic Weisbecker 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. Reviewed-by: Valentin Schneider Signed-off-by: Frederic Weisbecker --- init/Makefile | 3 ++- scripts/mkcompile_h | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/init/Makefile b/init/Makefile index 06326e304384..d82623d7fc8e 100644 --- a/init/Makefile +++ b/init/Makefile @@ -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) diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h index 6a2a04d92f42..ca40a5258c87 100755 --- a/scripts/mkcompile_h +++ b/scripts/mkcompile_h @@ -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 -- 2.25.1