Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2107399ybl; Thu, 19 Dec 2019 08:12:18 -0800 (PST) X-Google-Smtp-Source: APXvYqwUF4zCj0+psfZw6xw4DnsEXyExwcQwXpM3pxTwXXwzBW7IyAEedANLlohfmxqCX6Cj4fMo X-Received: by 2002:a05:6830:13da:: with SMTP id e26mr9674019otq.302.1576771937529; Thu, 19 Dec 2019 08:12:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576771937; cv=none; d=google.com; s=arc-20160816; b=X3gXekygmc+5rL2Z+daHDeidaI6mlEGoQuP7wvvdaZeDKyNCAlbRlsUfPKlki3M1Ub 6fObfAzxU/ZX/qTTpzrx+Hm9bsEhufOXFwPtUYZltTfjKfR373kHmWXm++2nO7T6YFi+ o2fkw1BUw7Elv3C+P/OotXh/eAIjVyieDFgZbh9iE6yN/MJifI2Uq07jil748MXGUGAa v4pVrHsWSPkNnLthYq/UE7sSU5DXouM5kh7GvofBh/Pb+1S5GmUn+6ICgnXt5hRCmIGK Cw7HzPuDim8EhQoqfEWi9tst3UwFAHt9rpBdp8KfuiubzfAxbXthsnZo4+alzm1viWfg exbw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=HocR1c46t5yp3QPpkp8WHl8m2ibyU3y48h3iTju79pc=; b=XpbpxU5nJmOi3TokaVj5E4KWRBH37J+mGwf2e78JuDzTNv/CWAVkAgvIC2hqX1V2nn n5AWtWdvsz9Ct+61m9Sa31Hq4dtu17IKqPMv8y+Odic1g4fmCBVKmz9sCf9v47F4SMOD ZqnAJZgBYlZxmAJgne0GUZl8sikZqFUqBrP0g0Cu9kAbmTdT8JASChIcNmuaMJzKKepp 0x08gDQTe52KOyDAc2r71vjAJ8rpCy1Vr9fN2FtQwgjZLoxzWwemhTiyyiUFH0sC+ZRt 3ofcF2+uNtUtGf/SrK0ltxFciLEyEzHPmCGUdExKRW8TENFFd23dA1/6xko5Plrsx6US RmSQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w10si3551601otg.295.2019.12.19.08.12.03; Thu, 19 Dec 2019 08:12: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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726818AbfLSQIY (ORCPT + 99 others); Thu, 19 Dec 2019 11:08:24 -0500 Received: from relay.sw.ru ([185.231.240.75]:57908 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726778AbfLSQIY (ORCPT ); Thu, 19 Dec 2019 11:08:24 -0500 Received: from dhcp-172-16-24-104.sw.ru ([172.16.24.104]) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1ihyLP-0007T1-L5; Thu, 19 Dec 2019 19:08:07 +0300 Subject: Re: [PATCH v2] sched: Micro optimization in pick_next_task() and in check_preempt_curr() To: Steven Rostedt Cc: Peter Zijlstra , mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, bsegall@google.com, mgorman@suse.de, linux-kernel@vger.kernel.org References: <157675913272.349305.8936736338884044103.stgit@localhost.localdomain> <20191219131242.GK2827@hirez.programming.kicks-ass.net> <20191219140252.GS2871@hirez.programming.kicks-ass.net> <20191219094330.0e44c748@gandalf.local.home> <11d755e9-e4f8-dd9e-30b0-45aebe260b2f@virtuozzo.com> <20191219095941.2eebed84@gandalf.local.home> <44c95c18-7593-f3e7-f710-a7d424af7442@virtuozzo.com> <20191219104018.5f8e50d2@gandalf.local.home> From: Kirill Tkhai Message-ID: Date: Thu, 19 Dec 2019 19:08:05 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191219104018.5f8e50d2@gandalf.local.home> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19.12.2019 18:40, Steven Rostedt wrote: > On Thu, 19 Dec 2019 18:20:58 +0300 > Kirill Tkhai wrote: > >> From: Kirill Tkhai >> >> This introduces an optimization based on xxx_sched_class addresses >> in two hot scheduler functions: pick_next_task() and check_preempt_curr(). >> >> After this patch, it will be possible to compare pointers to sched classes >> to check, which of them has a higher priority, instead of current iterations >> using for_each_class(). >> >> One more result of the patch is that size of object file becomes a little >> less (excluding added BUG_ON(), which goes in __init section): >> >> $size kernel/sched/core.o >> text data bss dec hex filename >> before: 66446 18957 676 86079 1503f kernel/sched/core.o >> after: 66398 18957 676 86031 1500f kernel/sched/core.o >> >> SCHED_DATA improvements guaranteeing order of sched classes are made >> by Steven Rostedt > > For the above changes, you can add: > > Signed-off-by: Steven Rostedt (VMware) Should I resend this as two patches, with your changes in a separate? > >> >> Signed-off-by: Kirill Tkhai >> >> v2: Steven's data sections ordering. Hunk with comment in Makefile is removed. >> --- >> include/asm-generic/vmlinux.lds.h | 8 ++++++++ >> kernel/sched/core.c | 24 +++++++++--------------- >> kernel/sched/deadline.c | 3 ++- >> kernel/sched/fair.c | 3 ++- >> kernel/sched/idle.c | 3 ++- >> kernel/sched/rt.c | 3 ++- >> kernel/sched/stop_task.c | 3 ++- >> 7 files changed, 27 insertions(+), 20 deletions(-) >> >> diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h >> index e00f41aa8ec4..ff12a422ff19 100644 >> --- a/include/asm-generic/vmlinux.lds.h >> +++ b/include/asm-generic/vmlinux.lds.h >> @@ -108,6 +108,13 @@ >> #define SBSS_MAIN .sbss >> #endif >>