Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp824430ybh; Wed, 11 Mar 2020 11:34:07 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuDW9VaqGxXRaImE0yiHE/V9qDpqMaWMxIRYhvajPLdK1ySaVVZg/57bacpN0t8PfNcx6Ik X-Received: by 2002:aca:d553:: with SMTP id m80mr51342oig.30.1583951647391; Wed, 11 Mar 2020 11:34:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583951647; cv=none; d=google.com; s=arc-20160816; b=ES1LvuLiC5/aeJuDAk4W9TZF/nsQCqwjnCaX7PRWHPX8x/XdZueKORsC/xhIGFSa/T N1xAo1vqwIreRpe3dgOoqnYUgUnkw1F1Wyd3wDHyMokn4sFuNtQIpK0WJtTnS0lPfRDn 7XUQb4bzijvfyppY8pjDEqXspygPmwq0A+wMDqg6NsgHAUdsnWB2I98hhizdF6gB/iyq BwIW5N+L0aXZqNmbevlIaxKHS0VBWDCwR9RicJ8Tv8wxdtKsIrAd6jS8ydBUUQ4UD3ak u5d/xgyn4P+G1z0KhH/sRx/uOont3+XQED05ZMPHvVCcMiG7nWtzji8NnUGDdEfjSKua 7XXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=rnmKc4BwI/07vqMKycP+JxSMjAH6LRdtLmoP8pOF/GY=; b=IgiN+wV43ZuPAppisNlLIvwI4kO+CC8Zv3Z1Izl3jY5ZWtXQOmtAxp4NS5ZeiaIqnf GPmi/X3F5yO2N2Fyeip1kMiHZS5Lo6oh27kXuvJgqEUK5a/ydEi5YVYr/VCceANkHTk1 /4ZE6sIa/rfjsJxy2ZnlZgQI5gtfmdeWJEbRlKMY3uRJZR+FBB1k3UTcFC6vXk6GqXGj Gkb5kF2PZEN+67pet+NBG8gU2cC/CKnpBWQDu7vcpAKT8ykU/NpKzlIXHA1JcrPqJhIo mNKxXpaHfTizncO9sglokjEQna+uMU0dJbur9qrQ4LzauaPBj/k6HOdYAVlRJc7Ay1Fa uMNg== 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 d7si1543216ote.131.2020.03.11.11.33.55; Wed, 11 Mar 2020 11:34:07 -0700 (PDT) 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 S1730886AbgCKSdd (ORCPT + 99 others); Wed, 11 Mar 2020 14:33:33 -0400 Received: from foss.arm.com ([217.140.110.172]:53420 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730468AbgCKSdc (ORCPT ); Wed, 11 Mar 2020 14:33:32 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5C56E7FA; Wed, 11 Mar 2020 11:33:32 -0700 (PDT) Received: from e113632-lin.cambridge.arm.com (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5C12C3F6CF; Wed, 11 Mar 2020 11:33:31 -0700 (PDT) From: Valentin Schneider To: linux-kernel@vger.kernel.org Cc: mingo@kernel.org, peterz@infradead.org, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, morten.rasmussen@arm.com Subject: [RFC PATCH 1/3] sched/topology: Split out SD_* flags declaration to its own file Date: Wed, 11 Mar 2020 18:33:18 +0000 Message-Id: <20200311183320.19186-2-valentin.schneider@arm.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200311183320.19186-1-valentin.schneider@arm.com> References: <20200311183320.19186-1-valentin.schneider@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To associate the SD flags with some metadata, we need some more structure in the way they are declared. Rather than shove that in a free-standing macro list, move the declaration in a separate file that can be re-imported with different SD_FLAG definitions. This is inspired by the syscalls numbering header. No change in functionality. Signed-off-by: Valentin Schneider --- include/linux/sched/sd_flags.h | 33 +++++++++++++++++++++++++++++++++ include/linux/sched/topology.h | 17 +++-------------- 2 files changed, 36 insertions(+), 14 deletions(-) create mode 100644 include/linux/sched/sd_flags.h diff --git a/include/linux/sched/sd_flags.h b/include/linux/sched/sd_flags.h new file mode 100644 index 000000000000..685bbe736945 --- /dev/null +++ b/include/linux/sched/sd_flags.h @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * sched-domains (multiprocessor balancing) flag declarations. + */ + +/* Balance when about to become idle */ +SD_FLAG(SD_BALANCE_NEWIDLE, 0) +/* Balance on exec */ +SD_FLAG(SD_BALANCE_EXEC, 1) +/* Balance on fork, clone */ +SD_FLAG(SD_BALANCE_FORK, 2) +/* Balance on wakeup */ +SD_FLAG(SD_BALANCE_WAKE, 3) +/* Wake task to waking CPU */ +SD_FLAG(SD_WAKE_AFFINE, 4) +/* Domain members have different CPU capacities */ +SD_FLAG(SD_ASYM_CPUCAPACITY, 5) +/* Domain members share CPU capacity */ +SD_FLAG(SD_SHARE_CPUCAPACITY, 6) +/* Domain members share power domain */ +SD_FLAG(SD_SHARE_POWERDOMAIN, 7) +/* Domain members share CPU pkg resources */ +SD_FLAG(SD_SHARE_PKG_RESOURCES, 8) +/* Only a single load balancing instance */ +SD_FLAG(SD_SERIALIZE, 9) +/* Place busy groups earlier in the domain */ +SD_FLAG(SD_ASYM_PACKING, 10) +/* Prefer to place tasks in a sibling domain */ +SD_FLAG(SD_PREFER_SIBLING, 11) +/* sched_domains of this level overlap */ +SD_FLAG(SD_OVERLAP, 12) +/* cross-node balancing */ +SD_FLAG(SD_NUMA, 13) diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h index 8de2f9744569..db7d24c0174b 100644 --- a/include/linux/sched/topology.h +++ b/include/linux/sched/topology.h @@ -11,20 +11,9 @@ */ #ifdef CONFIG_SMP -#define SD_BALANCE_NEWIDLE 0x0001 /* Balance when about to become idle */ -#define SD_BALANCE_EXEC 0x0002 /* Balance on exec */ -#define SD_BALANCE_FORK 0x0004 /* Balance on fork, clone */ -#define SD_BALANCE_WAKE 0x0008 /* Balance on wakeup */ -#define SD_WAKE_AFFINE 0x0010 /* Wake task to waking CPU */ -#define SD_ASYM_CPUCAPACITY 0x0020 /* Domain members have different CPU capacities */ -#define SD_SHARE_CPUCAPACITY 0x0040 /* Domain members share CPU capacity */ -#define SD_SHARE_POWERDOMAIN 0x0080 /* Domain members share power domain */ -#define SD_SHARE_PKG_RESOURCES 0x0100 /* Domain members share CPU pkg resources */ -#define SD_SERIALIZE 0x0200 /* Only a single load balancing instance */ -#define SD_ASYM_PACKING 0x0400 /* Place busy groups earlier in the domain */ -#define SD_PREFER_SIBLING 0x0800 /* Prefer to place tasks in a sibling domain */ -#define SD_OVERLAP 0x1000 /* sched_domains of this level overlap */ -#define SD_NUMA 0x2000 /* cross-node balancing */ +#define SD_FLAG(name, idx) static const unsigned int name = BIT(idx); +#include +#undef SD_FLAG #ifdef CONFIG_SCHED_SMT static inline int cpu_smt_flags(void) -- 2.24.0