Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp133154pxb; Mon, 25 Oct 2021 05:24:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymq/Wy5wtXb5psuYUeSQL2+Cfpm0gL69XC20vZ4et1NV8qLfihe4Bq1ykwy/Gl5g1H7PJK X-Received: by 2002:a17:90a:408f:: with SMTP id l15mr20359371pjg.34.1635164641992; Mon, 25 Oct 2021 05:24:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635164641; cv=none; d=google.com; s=arc-20160816; b=NAh3PCSNqspXYffyYGOUYmuC4ArAeXp+srNcE5WiBmmqQEwCyLXXJRKqKRy7LAXXjl prEtY2OKx51IlZhThiuDWMAY5jlUyP+w6sqxS7RgjkSBkbf8YrcvnE8L7sIkt6pBI1VR WW8O6+Itu59wSlB22sWN8z4GKW/m8OHzJsYb9+YVHudg1rNn4vY3KZbRO3FVyhpADgGa JhidByYwNy+qVo2Rqt4wtIl+zgAdcz/qUtLKFK+PSXTZFI84NHjR8E2RE4BYAFHomeVU w96cQhKFsqgv42mqynGL1JDzHuuoF2e9vSrixIUapr2Kh/zK43qYnMPUHqFvldfOw5EX QDVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lk0CfsVcDHWkke7/CdWO1uIyLcH5UAnyuiPeM1FP4Vs=; b=Wk72mNRGK1DRP+iRBsdt90sH+e2/T5/Z3NL1EDGwOSZFmnH2LJm2HMmJ22xbBbA1FH Nm+1I6Jmc1EHENq+uh1cZS6C+Ri+LVOXeBNIOjlZcTE8MI/yGlF9V4Np/Zv0u8XRtTBM vSOUF8hAQx6Kb/X/pzG4nj2LGI5vYVovvwDZi3aSWCoKZEXKmh5f9DOZts6wRm7+v5Ou OI29BXCe2o956Q6bBYpUddrA6CkyKSqENtwrT+a16oaxRGesDhCdg7sM9xAYHpLum0oi DurtAT8cqQE9du/bfrKPiZyPqTc/20u86GEFFxBZGNsBKvV4UYzjUoswxYZz719yDlDN luHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="J/Q2P6Wq"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z2si25573260plg.183.2021.10.25.05.23.43; Mon, 25 Oct 2021 05:24:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="J/Q2P6Wq"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233098AbhJYMXe (ORCPT + 99 others); Mon, 25 Oct 2021 08:23:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:58974 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233077AbhJYMXc (ORCPT ); Mon, 25 Oct 2021 08:23:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D34B660FDA; Mon, 25 Oct 2021 12:21:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635164470; bh=iJPL6ri+3jIEI3mzCUSmmhFHFXJ1nNy8ottCFOGumFI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J/Q2P6WqDGu62EoR4HJgr81XgVdeRJbM5ko9+VH7i75XU1J9scovHBxkm+uILX0vu oXNXtB2oPCkdY8vn6gedyXmLGLHKSRG19G14BTBFb13IBKV5jNUyDE0UsU7PxIiSQ+ LhSvE5B3ui1vEDSWpUG88mQGiZTIaxr23nrnrhPz0ztP6Rd3OFSOg/QFs8CJG+jX/B usMKGtDNcEvnTCVppSes6BIrdfQW30HcS0ZUd1f4wdE9BsCwlcjSfvTez54tZwC5eF IJ5p95hJHuI+9Tv8PA37d5BhiZSASgoq2df1dxZjBlOAFKJzFQgJKdpDKn9om91wHi WTMVkth3CMBwg== From: Frederic Weisbecker To: Peter Zijlstra , Ard Biesheuvel Cc: LKML , Frederic Weisbecker , James Morse , David Laight , Quentin Perret , Catalin Marinas , Will Deacon , Mark Rutland Subject: [PATCH 1/4] sched/preempt: Prepare for supporting !CONFIG_GENERIC_ENTRY dynamic preemption Date: Mon, 25 Oct 2021 14:20:59 +0200 Message-Id: <20211025122102.46089-2-frederic@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211025122102.46089-1-frederic@kernel.org> References: <20211025122102.46089-1-frederic@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is no need to force dynamic preemption to depend on the generic entry code. The latter is convenient but not mandatory. An architecture that doesn't support it just need to provide a static call on its kernel IRQ exit preemption path. Prepare the preempt dynamic code to handle that. Signed-off-by: Frederic Weisbecker Cc: Mark Rutland Cc: Quentin Perret Cc: Peter Zijlstra Cc: Catalin Marinas Cc: James Morse Cc: Will Deacon Cc: Ard Biesheuvel Cc: David Laight --- arch/Kconfig | 1 - include/linux/entry-common.h | 3 ++- kernel/sched/core.c | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/Kconfig b/arch/Kconfig index 8df1c7102643..9af493999d43 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -1255,7 +1255,6 @@ config HAVE_STATIC_CALL_INLINE config HAVE_PREEMPT_DYNAMIC bool depends on HAVE_STATIC_CALL - depends on GENERIC_ENTRY help Select this if the architecture support boot time preempt setting on top of static calls. It is strongly advised to support inline diff --git a/include/linux/entry-common.h b/include/linux/entry-common.h index 2e2b8d6140ed..81166bbc0f22 100644 --- a/include/linux/entry-common.h +++ b/include/linux/entry-common.h @@ -456,7 +456,8 @@ irqentry_state_t noinstr irqentry_enter(struct pt_regs *regs); */ void irqentry_exit_cond_resched(void); #ifdef CONFIG_PREEMPT_DYNAMIC -DECLARE_STATIC_CALL(irqentry_exit_cond_resched, irqentry_exit_cond_resched); +#define __irqentry_exit_cond_resched_func irqentry_exit_cond_resched +DECLARE_STATIC_CALL(irqentry_exit_cond_resched, __irqentry_exit_cond_resched_func); #endif /** diff --git a/kernel/sched/core.c b/kernel/sched/core.c index f2611b9cf503..355722abcd79 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6510,7 +6510,9 @@ EXPORT_STATIC_CALL_TRAMP(preempt_schedule_notrace); #ifdef CONFIG_PREEMPT_DYNAMIC +#ifdef CONFIG_GENERIC_ENTRY #include +#endif /* * SC:cond_resched @@ -6575,7 +6577,7 @@ void sched_dynamic_update(int mode) static_call_update(might_resched, __cond_resched); static_call_update(preempt_schedule, __preempt_schedule_func); static_call_update(preempt_schedule_notrace, __preempt_schedule_notrace_func); - static_call_update(irqentry_exit_cond_resched, irqentry_exit_cond_resched); + static_call_update(irqentry_exit_cond_resched, __irqentry_exit_cond_resched_func); switch (mode) { case preempt_dynamic_none: @@ -6601,7 +6603,7 @@ void sched_dynamic_update(int mode) static_call_update(might_resched, (void *)&__static_call_return0); static_call_update(preempt_schedule, __preempt_schedule_func); static_call_update(preempt_schedule_notrace, __preempt_schedule_notrace_func); - static_call_update(irqentry_exit_cond_resched, irqentry_exit_cond_resched); + static_call_update(irqentry_exit_cond_resched, __irqentry_exit_cond_resched_func); pr_info("Dynamic Preempt: full\n"); break; } -- 2.25.1