Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp787116imu; Tue, 11 Dec 2018 07:34:52 -0800 (PST) X-Google-Smtp-Source: AFSGD/VjbookCIK9HZFyg+NN5+TSN3B8pdTOmDEMMu8lju6f0E9M2vdCId/1ZNQcR0zW+iMNAghQ X-Received: by 2002:a62:c185:: with SMTP id i127mr16912448pfg.43.1544542492870; Tue, 11 Dec 2018 07:34:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544542492; cv=none; d=google.com; s=arc-20160816; b=0ppeCL3bKABiOGJ6jYyC+ARH8RgGJ+CSfLixEy/brGcp5UGAdNk3a3l8c+DhAFkAA9 EVGRB1gGsULeACiFcu37PfkJN6axc0aYsmb7Wmp91TwOzIVsBcfjMKvj2OfbGUUGCFVf fUyiQzGvasP2mY1T9EecDY5Yk8crZyaaxAsZhn4OzKim5Ew6B6GjfY0mKrmnFBjZfoTo fZrvK4nnQv3ns5gdN9j/my7FDkZL8jgtmtamBci7GXld4awjRKHcQrlcqsRrJOLIGzzu FPlOwC8pIQxdBUUeYvI4ZXAeywU/E5Z7umz0r1H+Ud4rQ7WfsuzQI+GteNlbwDyy/YUn /ZYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date; bh=Fb8awiYgWELRN2nfeC13hu72WWSCY0mRpIkVGPtS9uY=; b=0Z72Mz01CF9ouymRoB9IcuXdwYVGUCCIc3B2kttFY+KHj1nEbZgDjKnxGu+h4yELay oVAa+QBX9EZa3z04J7XFS15LAv54/lXE9N2oi4CMNP6TQMh4wkkL1aj1gOsWCVMrgrDN V5D9LgHstlxhhZUCiIIakavU5U6gkEeo12gxci0H58HEM8993nVmTahrGeDLzWuUB5j7 VCO4APYLlenX4P47XiERcYbqnUg1kXvKGsh4Qva2xcFihD6G+josi+1ETiScBOWxM0DN mRqpoVrNe5E8jO1LE2fh7lgiIOdV9IrwCN3L9ZtEtA2BatG4wCY6NwTrsQqGzw1TvV4+ E7pQ== 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 u3si12276009pgj.300.2018.12.11.07.34.37; Tue, 11 Dec 2018 07:34:52 -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 S1727028AbeLKPbs (ORCPT + 99 others); Tue, 11 Dec 2018 10:31:48 -0500 Received: from terminus.zytor.com ([198.137.202.136]:55185 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726417AbeLKPbs (ORCPT ); Tue, 11 Dec 2018 10:31:48 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id wBBFVO7h4042009 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 11 Dec 2018 07:31:24 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id wBBFVOwi4042005; Tue, 11 Dec 2018 07:31:24 -0800 Date: Tue, 11 Dec 2018 07:31:24 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Vincent Guittot Message-ID: Cc: tglx@linutronix.de, mingo@kernel.org, vincent.guittot@linaro.org, linux-kernel@vger.kernel.org, peterz@infradead.org, torvalds@linux-foundation.org, hpa@zytor.com, efault@gmx.de Reply-To: mingo@kernel.org, tglx@linutronix.de, vincent.guittot@linaro.org, hpa@zytor.com, efault@gmx.de, torvalds@linux-foundation.org, peterz@infradead.org, linux-kernel@vger.kernel.org In-Reply-To: <1535548752-4434-4-git-send-email-vincent.guittot@linaro.org> References: <1535548752-4434-4-git-send-email-vincent.guittot@linaro.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] sched/topology: Remove the ::smt_gain field from 'struct sched_domain' Git-Commit-ID: 765d0af19f5f388a34bf4533378f8398b72ded46 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,BAYES_00, FREEMAIL_FORGED_REPLYTO,T_DATE_IN_FUTURE_96_Q autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 765d0af19f5f388a34bf4533378f8398b72ded46 Gitweb: https://git.kernel.org/tip/765d0af19f5f388a34bf4533378f8398b72ded46 Author: Vincent Guittot AuthorDate: Wed, 29 Aug 2018 15:19:11 +0200 Committer: Ingo Molnar CommitDate: Tue, 11 Dec 2018 15:16:57 +0100 sched/topology: Remove the ::smt_gain field from 'struct sched_domain' ::smt_gain is used to compute the capacity of CPUs of a SMT core with the constraint 1 < ::smt_gain < 2 in order to be able to compute number of CPUs per core. The field has_free_capacity of struct numa_stat, which was the last user of this computation of number of CPUs per core, has been removed by: 2d4056fafa19 ("sched/numa: Remove numa_has_capacity()") We can now remove this constraint on core capacity and use the defautl value SCHED_CAPACITY_SCALE for SMT CPUs. With this remove, SCHED_CAPACITY_SCALE becomes the maximum compute capacity of CPUs on every systems. This should help to simplify some code and remove fields like rd->max_cpu_capacity Furthermore, arch_scale_cpu_capacity() is used with a NULL sd in several other places in the code when it wants the capacity of a CPUs to scale some metrics like in pelt, deadline or schedutil. In case on SMT, the value returned is not the capacity of SMT CPUs but default SCHED_CAPACITY_SCALE. So remove it. Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1535548752-4434-4-git-send-email-vincent.guittot@linaro.org Signed-off-by: Ingo Molnar --- include/linux/sched/topology.h | 1 - kernel/sched/sched.h | 3 --- kernel/sched/topology.c | 2 -- 3 files changed, 6 deletions(-) diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h index 6b9976180c1e..7fa0bc17cd8c 100644 --- a/include/linux/sched/topology.h +++ b/include/linux/sched/topology.h @@ -89,7 +89,6 @@ struct sched_domain { unsigned int newidle_idx; unsigned int wake_idx; unsigned int forkexec_idx; - unsigned int smt_gain; int nohz_idle; /* NOHZ IDLE status */ int flags; /* See SD_* */ diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 9bde60a11805..ceb896404869 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1864,9 +1864,6 @@ unsigned long arch_scale_freq_capacity(int cpu) static __always_inline unsigned long arch_scale_cpu_capacity(struct sched_domain *sd, int cpu) { - if (sd && (sd->flags & SD_SHARE_CPUCAPACITY) && (sd->span_weight > 1)) - return sd->smt_gain / sd->span_weight; - return SCHED_CAPACITY_SCALE; } #endif diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 8d7f15ba5916..7364e0b427b7 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -1133,7 +1133,6 @@ sd_init(struct sched_domain_topology_level *tl, .last_balance = jiffies, .balance_interval = sd_weight, - .smt_gain = 0, .max_newidle_lb_cost = 0, .next_decay_max_lb_cost = jiffies, .child = child, @@ -1164,7 +1163,6 @@ sd_init(struct sched_domain_topology_level *tl, if (sd->flags & SD_SHARE_CPUCAPACITY) { sd->imbalance_pct = 110; - sd->smt_gain = 1178; /* ~15% */ } else if (sd->flags & SD_SHARE_PKG_RESOURCES) { sd->imbalance_pct = 117;