Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2074987ybl; Thu, 19 Dec 2019 07:41:31 -0800 (PST) X-Google-Smtp-Source: APXvYqwz2YcwG70IXIP88U1sxU8/y5pf10W5WBu53MTuqKOoMIGZm/sZ1wbx1AP5JnXz2l+PVhLi X-Received: by 2002:a05:6830:68b:: with SMTP id q11mr9682290otr.81.1576770091495; Thu, 19 Dec 2019 07:41:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576770091; cv=none; d=google.com; s=arc-20160816; b=gHNutoId0OLX4G6nvcCtm0+7jbBxQhO8/sijLHxhNuGDrt9CDX3XwUDCbOb9ASHYN2 0naRQhD0UzgTHw5+Wmcr7kZFEDEJTia8H4ZzVdhRkciCbxi6/Oan1kr2vufKthBsxsFw qWKjXMRsIUMd2J35TEQX9UYVk71RihWxFS9QJ4KBx6mbrKmLyKlXIHYmbWAOoGBbuVw+ CwpXf+wTOWnVW7Y2IehgMRw1fLIszceYDK6kJU4gLMvWhicYSzfTBufer428A2v31FwL NPkTBuOHHYueAm/xTm2/UkCVKsyP4QtVd1kzr00YVplljDesz5ZcVRebIkb7Ca5S0EIa hpFA== 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:subject:cc:to:from:date; bh=ifZRY4xHnOU8e2RgOPAQLo2ywNx2UXDLHl6T9spE1d8=; b=TMxrmIcYpElXY+7negVN4e90qqEmoGt5IAySrYxq4I/+zrAPa4blWPCd6LkdBdvrbj QP1QwKRk7dLVXtHE1zT+4MRpvFgNoW1dSk7GTrVjiU2rQ+lsX+srmSJAJ+b+R9ssrp9O UoH0g3C/Ptb8ObxG9H7fppGtyyMZmb7sBMEMvL9tpixdY1nmai7YIMYy3U4OQpdwr5Ez ikTpcFT8pum2l1uhpaQQ6U9xsrusXnTIVD/TjmkrwpgUHu07dyaPzaIwb2qOcF590Aql OW4toBzNdJSPl/Q/mX8aYVsNojbYD4JLol9CINNR87NP6N4Io/ZV41jbz6lVMnCZ7Nm3 dFFw== 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 w7si3375941otq.250.2019.12.19.07.41.20; Thu, 19 Dec 2019 07:41:31 -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 S1726866AbfLSPkW (ORCPT + 99 others); Thu, 19 Dec 2019 10:40:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:41158 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726758AbfLSPkW (ORCPT ); Thu, 19 Dec 2019 10:40:22 -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 DCE20206EC; Thu, 19 Dec 2019 15:40:20 +0000 (UTC) Date: Thu, 19 Dec 2019 10:40:18 -0500 From: Steven Rostedt To: Kirill Tkhai 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 Subject: Re: [PATCH v2] sched: Micro optimization in pick_next_task() and in check_preempt_curr() Message-ID: <20191219104018.5f8e50d2@gandalf.local.home> In-Reply-To: <44c95c18-7593-f3e7-f710-a7d424af7442@virtuozzo.com> 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> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) -- Steve > > 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 >