From patchwork Fri Nov 30 17:34:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 152576 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3923639ljp; Fri, 30 Nov 2018 09:34:17 -0800 (PST) X-Google-Smtp-Source: AFSGD/UOGArIhX1qJM1pX1xq7hxvRKSl3+XUaECY63j8Ww8SokiumsrTs00lP6uJrPeuItq57OuY X-Received: by 2002:a63:eb0e:: with SMTP id t14mr5619407pgh.445.1543599257249; Fri, 30 Nov 2018 09:34:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543599257; cv=none; d=google.com; s=arc-20160816; b=VnmMEoQqnMszpzKOLCSC3Xm9AZuQQiIMWfw+rAgCTVFBuzykF28au+p0QgEB0CG+yk Zv2xZirvw8EkOEa4Lwzdw4A9E3iLsDDxQoFXwhTvyRzBVa362ZQ6Uo8v94CM1AhmUVG5 e4OmMKCDP2SGXsvpTdnsDoK3atUUEbQQz+vmeVNKaTBnkrng0OD2HZWa48YWYh2NnP/E mz0iY/PrvVydDbC27+ACfewB+D9ZwLSki8nbwgUHaRDvKGnMYFqX2rSUm2p7TzOzLKxt 1mHpqlbZ7lS6AH0h0djVGpinT0CdUsGZgg9fwZC4AYU5jVJUNoZKQQaz5Xj3NuAR2Hvc LFlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=mYHNG8lfEzIyMHUhDDLvx87Kw5p0THgL4LdZGWas/wk=; b=vikUjEmtYA0I4e3JoqulmPrRCllh5ZHTjCdWtCso/wA6QSfYhZfvTfQwluOZWjjHaP Ski0mD2S8FHgN84sICK9PTwHSa+DwsLcq6s7wf/F2zmNIqqrkFXx2vReiLh0zK/wWNww XyD19yXIH8uSDI0/gpToxywqJ7YBYp0sLj5QSo9l656WBMu27eBoZaRhboFkbOkyT0Gb VG+PN83uqppvNgKrptGZuiuFku7DjMkU9wO73I3X6aHeUu3TAxZ+yxLGAz/B6v1HCbF5 UU3LNr5acmrGcuWwzEJYzv2613fyCn0B37f0xkHr1xx9Gs30Z4FSPFP0FpYV0hjW755W oCrA== 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:17 -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 S1727189AbeLAEoP (ORCPT + 32 others); Fri, 30 Nov 2018 23:44:15 -0500 Received: from foss.arm.com ([217.140.101.70]:33166 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726650AbeLAEoO (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 E4C8B1596; 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 B50883F73C; Fri, 30 Nov 2018 09:34:13 -0800 (PST) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 846C21AE0808; 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 1/2] preempt: Move PREEMPT_NEED_RESCHED definition into arch code Date: Fri, 30 Nov 2018 17:34:30 +0000 Message-Id: <1543599271-14339-2-git-send-email-will.deacon@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1543599271-14339-1-git-send-email-will.deacon@arm.com> References: <1543599271-14339-1-git-send-email-will.deacon@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org PREEMPT_NEED_RESCHED is never used directly, so move it into the arch code where it can potentially be implemented using either a different bit in the preempt count or as an entirely separate entity. Cc: Robert Love Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: Martin Schwidefsky Signed-off-by: Will Deacon --- arch/s390/include/asm/preempt.h | 2 ++ arch/x86/include/asm/preempt.h | 3 +++ include/linux/preempt.h | 3 --- 3 files changed, 5 insertions(+), 3 deletions(-) -- 2.1.4 diff --git a/arch/s390/include/asm/preempt.h b/arch/s390/include/asm/preempt.h index 23a14d187fb1..b5ea9e14c017 100644 --- a/arch/s390/include/asm/preempt.h +++ b/arch/s390/include/asm/preempt.h @@ -8,6 +8,8 @@ #ifdef CONFIG_HAVE_MARCH_Z196_FEATURES +/* We use the MSB mostly because its available */ +#define PREEMPT_NEED_RESCHED 0x80000000 #define PREEMPT_ENABLED (0 + PREEMPT_NEED_RESCHED) static inline int preempt_count(void) diff --git a/arch/x86/include/asm/preempt.h b/arch/x86/include/asm/preempt.h index 90cb2f36c042..99a7fa9ab0a3 100644 --- a/arch/x86/include/asm/preempt.h +++ b/arch/x86/include/asm/preempt.h @@ -8,6 +8,9 @@ DECLARE_PER_CPU(int, __preempt_count); +/* We use the MSB mostly because its available */ +#define PREEMPT_NEED_RESCHED 0x80000000 + /* * We use the PREEMPT_NEED_RESCHED bit as an inverted NEED_RESCHED such * that a decrement hitting 0 means we can and should reschedule. diff --git a/include/linux/preempt.h b/include/linux/preempt.h index c01813c3fbe9..dd92b1a93919 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -53,9 +53,6 @@ #define SOFTIRQ_DISABLE_OFFSET (2 * SOFTIRQ_OFFSET) -/* We use the MSB mostly because its available */ -#define PREEMPT_NEED_RESCHED 0x80000000 - #define PREEMPT_DISABLED (PREEMPT_DISABLE_OFFSET + PREEMPT_ENABLED) /*