From nobody Mon Nov 25 19:46:24 2024 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DCDCA2003C5 for ; Fri, 25 Oct 2024 10:08:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.190 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729850932; cv=none; b=Vy2mwwJPUq0WNsY5ZgG1Pj7y/fdMFnNp/B3EVPDjoqnAUybwrkcMagti0xekPtbg/AiSRkgE+eDYdxz7R4TmkxfuBfr1BeG2Ulvbj4l+nLJyi0KKeO+jhYv37VQniwEy0g4t1/Dkp/hXDZ3FZnoFRsi0HPGueHFCVA893eSPxOQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729850932; c=relaxed/simple; bh=nwRo69/b02TZ0djNQMgVRpNwZSsAQF+pxOwFEiQsxuY=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=BOllEirycKgsNevgnytGWkPOZhoYYp4nA4uHqBFMC6pwLsElpxV/9Gl22L0wd9t9SWJFNDdSue1cmNwX788A4uXccfdOAQhVkkXhgwh5kWJd/qn3o83pPJxsdmOTkGpoX9lfx8rUfz4T+WQa8cfpuC+sT78TF5FEirJryVphwdI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.190 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.234]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4XZdkw6p65z20qy6; Fri, 25 Oct 2024 18:07:52 +0800 (CST) Received: from kwepemg200008.china.huawei.com (unknown [7.202.181.35]) by mail.maildlp.com (Postfix) with ESMTPS id CD2451401F1; Fri, 25 Oct 2024 18:08:46 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemg200008.china.huawei.com (7.202.181.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 25 Oct 2024 18:08:45 +0800 From: Jinjie Ruan To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH -next v4 10/19] arm64: entry: preempt_schedule_irq() only if PREEMPTION enabled Date: Fri, 25 Oct 2024 18:06:51 +0800 Message-ID: <20241025100700.3714552-11-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241025100700.3714552-1-ruanjinjie@huawei.com> References: <20241025100700.3714552-1-ruanjinjie@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemg200008.china.huawei.com (7.202.181.35) Content-Type: text/plain; charset="utf-8" Whether PREEMPT_DYNAMIC enabled or not, PREEMPTION should be enabled to allow reschedule after an interrupt. Signed-off-by: Jinjie Ruan --- arch/arm64/kernel/entry-common.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/arm64/kernel/entry-common.c b/arch/arm64/kernel/entry-com= mon.c index 3ea3ab32d232..58d660878c09 100644 --- a/arch/arm64/kernel/entry-common.c +++ b/arch/arm64/kernel/entry-common.c @@ -65,8 +65,6 @@ static noinstr irqentry_state_t enter_from_kernel_mode(st= ruct pt_regs *regs) DEFINE_STATIC_KEY_TRUE(sk_dynamic_irqentry_exit_cond_resched); #define need_irq_preemption() \ (static_branch_unlikely(&sk_dynamic_irqentry_exit_cond_resched)) -#else -#define need_irq_preemption() (IS_ENABLED(CONFIG_PREEMPTION)) #endif =20 static inline bool arm64_irqentry_exit_need_resched(void) @@ -121,9 +119,12 @@ static void noinstr exit_to_kernel_mode(struct pt_regs= *regs, return; } =20 - if (!preempt_count()) { - if (need_resched() && arm64_irqentry_exit_need_resched()) - preempt_schedule_irq(); + if (IS_ENABLED(CONFIG_PREEMPTION)) { + if (!preempt_count()) { + if (need_resched() && + arm64_irqentry_exit_need_resched()) + preempt_schedule_irq(); + } } =20 trace_hardirqs_on(); --=20 2.34.1