Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2442910ybl; Thu, 19 Dec 2019 13:47:26 -0800 (PST) X-Google-Smtp-Source: APXvYqx2gDc92E0TUE7jJk39PWrtb8cRe0F616+jn7DxLTv1iAc+fxduo5S+L4wI469E6+n3NVFO X-Received: by 2002:a05:6830:3013:: with SMTP id a19mr11117019otn.217.1576792046123; Thu, 19 Dec 2019 13:47:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576792046; cv=none; d=google.com; s=arc-20160816; b=qHj6g3eCe4qGfv0Ck4+2Z4exkiuaqQg8tAuK7wbR5+/16kwoChfhFhFfzpQbMTlp5a 3ore5BGhDN4dCOe6h11RyF59YmROUmZ7NsRYgPQzSSdtdbNQ+h3zRA3/M7YxUmN5k/f/ zbRGOP+rG81jDQGqFwHh4JB6h796yjSsHHgvgI6MKDUMBtKeH7nLJ2DFn6MJIUgX61Yx tNAzdcLUbtmUvBpBx5xDQN5P/Bl90GX2OE3xvKqArqKp1JMTPQo+BCADSEEjMxyq7aby nH7WzJvsW6BFIDRZ9jUVF54dnyNUXr9bn9vnzkqxH8R1z4Q4BhUK9gib6xlfF6VteKUj wurg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:subject:cc:to :from:date:user-agent:message-id; bh=H40EwSD6MvknXw5Grfk2KaqLcasMpM+nu8uxhI7Tf0o=; b=YntUdQPkikQsLexEOgVN2+ezgXQmkUKpvF4J11m1kRGMcmkqhO46SsRszV40kkVdmH 0HgbrXzMTezqd1xvN32BzNaQukfP+AGiyzWbzSUhO3WuZmRT1P7FV1R4eE1nKmZpGCAs ELVSDxx+Wr7oH0ln7RBv13PUA1nqAXSHD1kuOqX6bkYVAe8gavSs3N/ugwAKe5xd81GG 0jNDNoRcSPgnxMJOoljAv2Xfkus46BeVBY3oIbyqWPnjC7PyF6T2Wudf7K94eQ4TSEAn hdNzXIrMPN9h/zU80C+1kvWQa3xabKqU/MRClS3+3G5mrhaPp1DXEjtt3CLcu9cUQePC +Geg== 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 w15si3860310otm.263.2019.12.19.13.47.14; Thu, 19 Dec 2019 13:47:26 -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 S1727492AbfLSVqA (ORCPT + 99 others); Thu, 19 Dec 2019 16:46:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:35694 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727370AbfLSVqA (ORCPT ); Thu, 19 Dec 2019 16:46:00 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AD16B24683; Thu, 19 Dec 2019 21:45:59 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.92.3) (envelope-from ) id 1ii3cM-000Um2-QF; Thu, 19 Dec 2019 16:45:58 -0500 Message-Id: <20191219214558.682913590@goodmis.org> User-Agent: quilt/0.65 Date: Thu, 19 Dec 2019 16:44:53 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Kirill Tkhai , Kirill Tkhai , Peter Zijlstra , "mingo@redhat.com" , "juri.lelli@redhat.com" , "vincent.guittot@linaro.org" , "dietmar.eggemann@arm.com" , "bsegall@google.com" , "mgorman@suse.de" , Ingo Molnar , Andrew Morton Subject: [RFC][PATCH 2/4] sched: Have sched_class_highest define by vmlinux.lds.h References: <20191219214451.340746474@goodmis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Steven Rostedt (VMware)" Now that the sched_class descriptors are defined by the linker script, and this needs to be aware of the existance of stop_sched_class when SMP is enabled or not, as it is used as the "highest" priority when defined. Move the declaration of sched_class_highest to the same location in the linker script that inserts stop_sched_class, and this will also make it easier to see what should be defined as the highest class, as this linker script location defines the priorities as well. Signed-off-by: Steven Rostedt (VMware) --- include/asm-generic/vmlinux.lds.h | 11 ++++++++++- kernel/sched/sched.h | 9 +++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 772d961c69a5..1c14c4ddf785 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -109,9 +109,16 @@ #endif #ifdef CONFIG_SMP -#define STOP_SCHED_CLASS *(__stop_sched_class) +#define STOP_SCHED_CLASS \ + STRUCT_ALIGN(); \ + sched_class_highest = .; \ + *(__stop_sched_class) +#define BEFORE_DL_SCHED_CLASS #else #define STOP_SCHED_CLASS +#define BEFORE_DL_SCHED_CLASS \ + STRUCT_ALIGN(); \ + sched_class_highest = .; #endif /* @@ -120,9 +127,11 @@ * relation to each other. */ #define SCHED_DATA \ + STRUCT_ALIGN(); \ *(__idle_sched_class) \ *(__fair_sched_class) \ *(__rt_sched_class) \ + BEFORE_DL_SCHED_CLASS \ *(__dl_sched_class) \ STOP_SCHED_CLASS diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 280a3c735935..0554c588ad85 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1771,17 +1771,14 @@ static inline void set_next_task(struct rq *rq, struct task_struct *next) next->sched_class->set_next_task(rq, next, false); } -#ifdef CONFIG_SMP -#define sched_class_highest (&stop_sched_class) -#else -#define sched_class_highest (&dl_sched_class) -#endif +/* Defined in include/asm-generic/vmlinux.lds.h */ +extern struct sched_class sched_class_highest; #define for_class_range(class, _from, _to) \ for (class = (_from); class != (_to); class = class->next) #define for_each_class(class) \ - for_class_range(class, sched_class_highest, NULL) + for_class_range(class, &sched_class_highest, NULL) extern const struct sched_class stop_sched_class; extern const struct sched_class dl_sched_class; -- 2.24.0