From patchwork Fri Nov 30 17:34:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 152575 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3923632ljp; Fri, 30 Nov 2018 09:34:16 -0800 (PST) X-Google-Smtp-Source: AFSGD/XDYfw74NSgTXOrm4/tk/B2NKDWoGboT0cecK4iRbEnRm43h04SolL+zGFrgTgLwpitVN1M X-Received: by 2002:a63:c70d:: with SMTP id n13mr5713179pgg.108.1543599256715; Fri, 30 Nov 2018 09:34:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543599256; cv=none; d=google.com; s=arc-20160816; b=B1FJrYdVZ74TY0ITRu3B0t1K2Oo2SSvrBR6a5WEP1tV/km7PbzNYD0OP3G8WRJP7ru aETUSMuoi202+47YFU5lSAklsaZuzQglKk5nqDnc6AIQqIqGdHohi7SCIkL6jHjAptPU 5Z/xvP+zXfIHowR2Cyuu0v2jiLakzA/zalR1yNyml7t6C7V71StKXeFREBwh2zUtvaQK NCD8Biu4I4/acUSQj+lQkXcK+RWlZz5zzo2MvBFnqLBYQOdn5rmuP/3rIwUdcoxLjrAM TilWxGsrnyMRR9qoDbfuSlsFAxjWGpV9bF5Nd+NsYS4ykm4mVu51ob5rfk7rvPXww97N fm9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=6aF3Q3pvaNCpEGCQM3SQ6O+Bfi2oGN2hUqkSuMdOwuo=; b=pU8ZJvxtHbY6g3p5DtJeT6EiSBJt54xS2FtTIQfv+4oF/cYu4secV37AFclDACHpFy /EDpFFm+V15rVmuI9TXUC0m+i8gHYciDb8gGlIjcf1NW9fX8H+Wj/KV3v/6xbtXHtpSO aEri11BRsj792uSqSZ8avUHUD0hJvdHY49rkAf2G0mms9pwI4U20L5ymBwPYogXxm5Wy /EQfg3pl/OJ5Vz6MgDtO0SvRD5rrBxFjC+51af2+JX+LPXb7LGyzJU+45esJbBcP0WZi wVBlkfGQVoi1P5hQbSAAe3qB1tFIMDoV3NyTSPxsO7ceIj1Nrr4pda54GCp+mny2MApm pdAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y8si5927551pfn.26.2018.11.30.09.34.16; Fri, 30 Nov 2018 09:34:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727027AbeLAEoO (ORCPT + 32 others); Fri, 30 Nov 2018 23:44:14 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:33162 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726292AbeLAEoO (ORCPT ); Fri, 30 Nov 2018 23:44:14 -0500 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 D20F6EBD; Fri, 30 Nov 2018 09:34:13 -0800 (PST) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A191E3F5A0; Fri, 30 Nov 2018 09:34:13 -0800 (PST) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 774221AE0FA2; Fri, 30 Nov 2018 17:34:32 +0000 (GMT) From: Will Deacon To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, ard.biesheuvel@linaro.org, catalin.marinas@arm.com, rml@tech9.net, tglx@linutronix.de, peterz@infradead.org, schwidefsky@de.ibm.com, Will Deacon Subject: [PATCH v2 0/2] arm64: Only call into preempt_schedule() if need_resched() Date: Fri, 30 Nov 2018 17:34:29 +0000 Message-Id: <1543599271-14339-1-git-send-email-will.deacon@arm.com> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, This is version two of the patches I originally posted here: http://lkml.kernel.org/r/1543347902-21170-1-git-send-email-will.deacon@arm.com The only change since v1 is that __preempt_count_dec_and_test() now reloads the need_resched flag if it initially saw that it was set. This resolves the issue spotted by Peter, where an IRQ coming in during the decrement can cause a reschedule to be missed. Feedback welcome. Will --->8 Will Deacon (2): preempt: Move PREEMPT_NEED_RESCHED definition into arch code arm64: preempt: Provide our own implementation of asm/preempt.h arch/arm64/include/asm/Kbuild | 1 - arch/arm64/include/asm/preempt.h | 88 ++++++++++++++++++++++++++++++++++++ arch/arm64/include/asm/thread_info.h | 13 +++++- arch/s390/include/asm/preempt.h | 2 + arch/x86/include/asm/preempt.h | 3 ++ include/linux/preempt.h | 3 -- 6 files changed, 105 insertions(+), 5 deletions(-) create mode 100644 arch/arm64/include/asm/preempt.h -- 2.1.4 Acked-by: Peter Zijlstra (Intel)