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 X-Spam-Level: X-Spam-Status: No, score=-15.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 916B4C07E94 for ; Fri, 4 Jun 2021 15:44:58 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 600846101C for ; Fri, 4 Jun 2021 15:44:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 600846101C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=R/7qAHWtNpjX2FQpFxgzqdM0FlKjKJOjClENB3MPqNc=; b=FKyFcldcqh+5Ax eaoL3PP079BGj8nUetVuGRE/767MCxkTRxlTZboSTdpNhHS7qe4Ojr8Gz54bmc6RNk9J0p67VtJnX lCKnfLtwkwXnoYebhUUINlFpWTBp3cWbBTHEHA8RE655/aENYwOY/kUHiP1/OiVjo76nYsQlNrd5F Pf+EfCNTt8yZPWK+iWXKS9r4jaXDPS9gP1GAB7hafI/UjaqwzfwEjTvNdY2lOOUfnCjMiePIVw126 9TvYzA++K/eHD1tvE/vpDVb66XcgZ+jBFmNl3EonU84GdM+3I7gtJ4xotQqGvBCKsnpAo+7EFl23Y lJluLSMENyGNWJxt98qA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lpByr-00EDZX-4t; Fri, 04 Jun 2021 15:43:29 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lpByd-00EDYM-Er for linux-arm-kernel@lists.infradead.org; Fri, 04 Jun 2021 15:43:16 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id EF416613D8; Fri, 4 Jun 2021 15:43:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622821395; bh=H30lDEKxO3pXk4vGOlwp68Th9j6CHlON+yUxadCyqrU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NlldMMrO5kL15QfqZs/RPDwtfw1/mRhERol/q7ppeNegxKBfxkOHE6Ot4X6VcBofJ OMGcvB8bQSXAwt9MAn0GAVjRPQqPNgDuTWtWQ0Uf59DbJx2yYbpPLmjMq+7kw7evVe NDJG1sFahJEplZG1FIVISJojweenWSpAUpsUZn44pmKNZiAsn2yl85PEk3rB8rPyMr +juud81d8QSrc2PBlORC98tZzyRefJzVoPZ8ZzeeqJizxfe+4qIMtYzhK7mBcPkBq3 QKZfLsDzx5nM9kpgP7wFJ8wJJ+1jNWpxXuzSvrjELlpAa+gyvI+0CvKooxWUk3vqEB 3MoakvWVOxi+w== Date: Fri, 4 Jun 2021 16:43:10 +0100 From: Will Deacon To: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, james.morse@arm.com, joey.gouly@arm.com, maz@kernel.org Subject: Re: [PATCH v3 05/20] arm64: entry: move preempt logic to C Message-ID: <20210604154310.GD2793@willie-the-truck> References: <20210525183302.56293-1-mark.rutland@arm.com> <20210525183302.56293-6-mark.rutland@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210525183302.56293-6-mark.rutland@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210604_084315_533850_37BEDD42 X-CRM114-Status: GOOD ( 20.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, May 25, 2021 at 07:32:47PM +0100, Mark Rutland wrote: > Currently portions of our preempt logic are written in C while other > parts are written in assembly. There's no reason any of this needs to > live in assembly, so let's move the rest of the lgoic to C. At the same > time, let's make the comment a bit clearer. > > Other than the increased lockdep coverage there should be no functional > change as a result of this patch. > > Signed-off-by: Mark Rutland > Reviewed-by: Joey Gouly > Cc: Catalin Marinas > Cc: James Morse > Cc: Marc Zyngier > Cc: Will Deacon > --- > arch/arm64/kernel/entry-common.c | 12 ++++++++++++ > arch/arm64/kernel/entry.S | 13 ------------- > 2 files changed, 12 insertions(+), 13 deletions(-) > > diff --git a/arch/arm64/kernel/entry-common.c b/arch/arm64/kernel/entry-common.c > index 1fe60578e556..dbe0bb09fe86 100644 > --- a/arch/arm64/kernel/entry-common.c > +++ b/arch/arm64/kernel/entry-common.c > @@ -121,6 +121,18 @@ asmlinkage void __sched arm64_preempt_schedule_irq(void) > { > lockdep_assert_irqs_disabled(); > > + if (preempt_count() != 0) > + return; Careful, I don't think this is quite the same: preempt_count() just looks at the 32-bit count portion of the preempt-structure, whereas the old code only bothers calling into the scheduler if we actually need to reschedule: > diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S > index 656f3129bfef..8c7ddd651756 100644 > --- a/arch/arm64/kernel/entry.S > +++ b/arch/arm64/kernel/entry.S > @@ -561,20 +561,7 @@ tsk .req x28 // current thread_info > irq_handler \handler > > #ifdef CONFIG_PREEMPTION > - ldr x24, [tsk, #TSK_TI_PREEMPT] // get preempt count It would be nice if we could keep this check on the fast path. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel