Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3125126ybl; Fri, 20 Dec 2019 04:21:55 -0800 (PST) X-Google-Smtp-Source: APXvYqxXFTqHO4cNxBNE3it4ZK8TmzOYfXZW56xLULIl0x6E7oaNba3P4LairNjTCZKxyO7EY3AZ X-Received: by 2002:a9d:7448:: with SMTP id p8mr4464392otk.96.1576844515629; Fri, 20 Dec 2019 04:21:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576844515; cv=none; d=google.com; s=arc-20160816; b=zvwzaUs6BLP/1+eCkZ+kdoA/NBNB8thpl8f5zcUH3/UrPkEgmiH0eswo4fPF4pk7Tz fOdynpnN697MrpMa+HVHyHmN7hwzRKff4M9v+L8gEGlpWubGQXStmwZS3FCh6TKEG9jp 7vI86qezfaqZD9rGhyPQQgzqCqwr1O3iXXVNRCVUhj3RIOMuKgK84NUg2wvCjONWweAp n6/GS6XBWgJnEB3sM5Jp1FVMLDajLTntZ4X7TSTldGvRmvT/QNPk2OxKmvfKKWs58ENO cgdlfE/r/zSTYBqUOnn5ZNqDhehbXWlHgGkNpVrhnEEVLAdeikopN0Es+oGksGIn8gwU +6Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=R5Zw3DDJm4ULPliPYUAssjzZ7w7pMoy4+U0VF7anJkg=; b=g6nRrr2DvIz82qq78jiLzaba3ptnq7AMH1W3/WHH9XxbFMkF+F8l4BLtX2eawExxZu oYaFQejoIR7Nre9MMFd5O+22k3mII2js5CgOYqwF0JCCRqiSfZ6KuhftwOhwpxGFIyfF aH7U7mMmu2CUrgirpZLh77I4VVLcZ4v/El2HD0IDWYHk/sFr8oNHvWevd2/e6zzyN9yl gXUiptQOyqCaGqrSk67Bt5L5w29uMcy6SVKxXy5+vUC3WPxpA4qLlwWb/ULNLZCKWAiX 1R9nmTN7piWVu3gEKBweE3u78ncYywrIeOhWbQAzCPHxIGZMcPNDd1N8mWH/E94Kdi3b nB4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=kGleREul; 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 b131si4789655oif.53.2019.12.20.04.21.44; Fri, 20 Dec 2019 04:21:55 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=kGleREul; 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 S1727341AbfLTMUG (ORCPT + 99 others); Fri, 20 Dec 2019 07:20:06 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:48508 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727209AbfLTMUG (ORCPT ); Fri, 20 Dec 2019 07:20:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=R5Zw3DDJm4ULPliPYUAssjzZ7w7pMoy4+U0VF7anJkg=; b=kGleREul1+TOIzHsXgqHZ4Cbq 4MeHJK5OCxVpyeUhcrn4CWbXjCzzGTXNYQmilD7zoJVZs2mlZ+++cSHPzBI73i9aDHhRjONctFEsT /VW6qnZo1P8/l5b+cU+nB+zxwjnAWy6svrA3N/QHZQotSX3ahFyfe3RQbJhB4uotDaqG7FWxgQdwK BZIN/8nCFvnv1iqS5ZcLLw66PHJNQlh53yIqPDCv800XrVXKZH3ehTze5Xt2dFWEJTSUudSYHPHRH LBV2u4nm8Qco5AwB9aVQrWj3p+g/ZFQ/9fj4LSQJNheTcNBqGe1yQVMU4XdjpMeHSfe1oAhe8OwfF I+egC4T4g==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iiHG1-0005GX-Fr; Fri, 20 Dec 2019 12:19:51 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 82D67300DB7; Fri, 20 Dec 2019 13:18:23 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 6D4702B270F5D; Fri, 20 Dec 2019 13:19:47 +0100 (CET) Date: Fri, 20 Dec 2019 13:19:47 +0100 From: Peter Zijlstra To: Rasmus Villemoes Cc: Steven Rostedt , linux-kernel@vger.kernel.org, Kirill Tkhai , Kirill Tkhai , "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: Re: [RFC][PATCH 1/4] sched: Force the address order of each sched class descriptor Message-ID: <20191220121947.GH2844@hirez.programming.kicks-ass.net> References: <20191219214451.340746474@goodmis.org> <20191219214558.510271353@goodmis.org> <0a957e8d-7af8-613c-11ae-f51b9b241eb7@rasmusvillemoes.dk> <20191220100033.GE2844@hirez.programming.kicks-ass.net> <1ac359e8-fa7f-7ded-e2f2-9f7d0b23a4e1@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1ac359e8-fa7f-7ded-e2f2-9f7d0b23a4e1@rasmusvillemoes.dk> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 20, 2019 at 11:12:37AM +0100, Rasmus Villemoes wrote: > On 20/12/2019 11.00, Peter Zijlstra wrote: > >>> +/* > >>> + * The order of the sched class addresses are important, as they are > >>> + * used to determine the order of the priority of each sched class in > >>> + * relation to each other. > >>> + */ > >>> +#define SCHED_DATA \ > >>> + *(__idle_sched_class) \ > >>> + *(__fair_sched_class) \ > >>> + *(__rt_sched_class) \ > >>> + *(__dl_sched_class) \ > >>> + STOP_SCHED_CLASS > > > > I'm confused, why does that STOP_SCHED_CLASS need magic here at all? > > Doesn't the linker deal with empty sections already by making them 0 > > sized? > > Yes, but dropping the STOP_SCHED_CLASS define doesn't prevent one from > needing some ifdeffery to define highest_sched_class if they are laid > out in (higher sched class <-> higher address) order. Would not something like: __begin_sched_classes = .; *(__idle_sched_class) *(__fair_sched_class) *(__rt_sched_class) *(__dl_sched_class) *(__stop_sched_class) __end_sched_classes = .; combined with something like: extern struct sched_class *__begin_sched_classes; extern struct sched_class *__end_sched_classes; #define sched_class_highest (__end_sched_classes - 1) #define sched_class_lowest (__begin_sched_classes - 1) #define for_class_range(class, _from, _to) \ for (class = (_from); class != (_to), class--) #define for_each_class(class) \ for_class_range(class, sched_class_highest, sched_class_lowest) just work? When no __stop_sched_class is present, that section is 0 sized, and __end_sched_classes points to one past __dl_sched_class, no?