From patchwork Tue May 28 10:48:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Schneider X-Patchwork-Id: 10964715 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5FAA576 for ; Tue, 28 May 2019 10:49:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CDE828306 for ; Tue, 28 May 2019 10:49:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3F80828682; Tue, 28 May 2019 10:49:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DB33E28306 for ; Tue, 28 May 2019 10:49:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UpGcgsA22uUpdCtR/ULrFjeVb2wJIky4xevWZI4r/Oc=; b=mD7dcK5FSUEYRl iko1M8e6M6PH53P7JjqK5Ifb+cp3L1d7MqxPWKMJVjlBSouK9dRBgbl8xngUMDnhqS17aNLUdGRQi e0DtJLOv3l8LP1D6ZZoJDF2I+1jtbeodXrHowBtv3WPVRx1BgPWznHl+ntyzJGR8sxDTig550FiPh V/TKakNBOn/LXi5qSrM5cY50tXzYaVfevkxMDPe+LHgcNloZGHodBmJPSp6VMB3YBAcbsL31vjuby Pnqt5kxISO3V0/bmLwdwI0w8YI64RPDMXXC68HhGyQC5f9ef/Okx5yH9JTEclqZmAyl/eYiUC5X07 yZvquB0veH1VTKZbR/rA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hVZfh-0003uv-QQ; Tue, 28 May 2019 10:49:33 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hVZff-0003uE-9z for linux-riscv@lists.infradead.org; Tue, 28 May 2019 10:49:32 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9DCCF15AD; Tue, 28 May 2019 03:49:30 -0700 (PDT) Received: from e113632-lin.cambridge.arm.com (e113632-lin.cambridge.arm.com [10.1.194.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 840293F59C; Tue, 28 May 2019 03:49:29 -0700 (PDT) From: Valentin Schneider To: linux-kernel@vger.kernel.org Subject: [PATCH RESEND 5/7] RISC-V: entry: Remove unneeded need_resched() loop Date: Tue, 28 May 2019 11:48:46 +0100 Message-Id: <20190528104848.13160-6-valentin.schneider@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528104848.13160-1-valentin.schneider@arm.com> References: <20190528104848.13160-1-valentin.schneider@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190528_034931_346944_AC9DE257 X-CRM114-Status: UNSURE ( 9.25 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-riscv@lists.infradead.org, Palmer Dabbelt , Albert Ou Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Since the enabling and disabling of IRQs within preempt_schedule_irq() is contained in a need_resched() loop, we don't need the outer arch code loop. Signed-off-by: Valentin Schneider Cc: Palmer Dabbelt Cc: Albert Ou Cc: linux-riscv@lists.infradead.org Reviewed-by: Palmer Dabbelt --- arch/riscv/kernel/entry.S | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/riscv/kernel/entry.S b/arch/riscv/kernel/entry.S index 1c1ecc238cfa..d0b1b9660283 100644 --- a/arch/riscv/kernel/entry.S +++ b/arch/riscv/kernel/entry.S @@ -258,12 +258,11 @@ restore_all: resume_kernel: REG_L s0, TASK_TI_PREEMPT_COUNT(tp) bnez s0, restore_all -need_resched: REG_L s0, TASK_TI_FLAGS(tp) andi s0, s0, _TIF_NEED_RESCHED beqz s0, restore_all call preempt_schedule_irq - j need_resched + j restore_all #endif work_pending: