From patchwork Wed Aug 29 13:19:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 145429 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp670096ljw; Wed, 29 Aug 2018 06:19:28 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbk3Pn2ACdm+A6Ra7kdzSKZdTSgBPXfEYWII0q1TFuZrAvrzSpYM47G9eOOoSr8HPctGfup X-Received: by 2002:a63:de4c:: with SMTP id y12-v6mr5699061pgi.435.1535548767877; Wed, 29 Aug 2018 06:19:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535548767; cv=none; d=google.com; s=arc-20160816; b=GrMOMyWS26ddl600ux+4BbYc0lerwyfaU2LEov1BYkc7EUVCUWoDY0Awd/3BieXocd v4fe5pDD/hfeF8p3zo2yuwcHeyTuKYMUNAJqoDknn6E9b0fnrSzWo//a1B1FuCPHiJN6 bCa49NT/h8UYm3voIxbX/Kwi9dYEti/fvhL+Yc4PwEoIWgCh7sFjRBtYYl4ghVjWAEUt fKVfUSefoolS685fIC1WeAc64Y0MblQ0vYtW6JcbHPcoR82CtOdK1UOXrKuo6W7RB/h6 CvfBOd/EzHFEu/ePdiJmBs8uOy3f8qsr9sUbvL4ZQsed/6I8noPVrva1PksjF5GMxHoP Gm6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=TO1pU8JCMBu+caKwSvxQuWK2iY1ODZK5b9aWTRPwaCg=; b=nlzvomj/PDiGkj2biMmk5NV7s8VDg+/WuUWSNIgeuhtE9AJKeW1V/k2BIFKUWfScE0 ui9NDufZUm10tJdTgZGk1opTd0azyaplKKd+7BSRYDV0VxR4T3HseBPxHGejjBpiEb// l24ApsoK8UsG143jzSiDJvTCLN+Nflz8Z05YA8jUzHR5M8md5O25llwHXLRplCzafL8K k4AeL9kEqpG5JKtBZ3lhrR4hYs30W4ppmqI91z/vFeuLwiEt/Bb2ozqnWIh5gLSOlDRx bM80DsfSH8uDVplevAss8vF5kYL988VapWs7QtAeFXD/5Cy27/hBguMR9CVF+tCqyiSJ 6Fgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="P/Ql1Ewq"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t16-v6si3603858pgj.234.2018.08.29.06.19.27; Wed, 29 Aug 2018 06:19:27 -0700 (PDT) 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=pass header.i=@linaro.org header.s=google header.b="P/Ql1Ewq"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728725AbeH2RQU (ORCPT + 32 others); Wed, 29 Aug 2018 13:16:20 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:41237 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727316AbeH2RQT (ORCPT ); Wed, 29 Aug 2018 13:16:19 -0400 Received: by mail-wr1-f65.google.com with SMTP id z96-v6so4808310wrb.8 for ; Wed, 29 Aug 2018 06:19:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TO1pU8JCMBu+caKwSvxQuWK2iY1ODZK5b9aWTRPwaCg=; b=P/Ql1EwqHhseHyku5t1Dgwfe7jPgYorqfQ5b7LVFE80A3XWZ5nDQe3LcScSJlUTD2S MjAif9mZViQo/CgmYFM5L1wP6iLV3+Oj0Edzti4ex/T5ZDopjukqWI1LDAI+NkzZsdd0 RB1Udj2qHfXbBa4mqCzypTMVxdhKed7YlMP/I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=TO1pU8JCMBu+caKwSvxQuWK2iY1ODZK5b9aWTRPwaCg=; b=RmlnU5zv6sxJ0JjqSDjqlyGPHqfK1SdriOx39QduGrTgRsTP7mGoCO5mXQ9yQ6g8xB xUoc71mo2tnUirun4iRlODTUmi20H58aNtyZ/yDP9GU6829i2aEqxnaja5CArgL8moZH sWOOB4vkSoE/BdbfpzAaPaHWoqJ42jEwedpSiB3pdDslZR3q7pTgAPpBktE25Cp8iIUW 4qGlEX70bFVYSSkH2WKrKN096ugtoWZna4zO6SBSeFd3qE54VN8rYSyZLAH2NoFN+VSe DY7LugOetBxlUMCT20YFdEGJI8X6j1/bPoCdwz6pzwiJLHHqvcltlge0Ss89fWVt44go b/Ig== X-Gm-Message-State: APzg51ANKuSsb49e1iNBrnNq9BF28MzroDH0Kt3Dem5fjFwRK6+18Nkr pIiDdbv0tRuzY1lT1mki6BAMFA== X-Received: by 2002:a5d:6984:: with SMTP id g4-v6mr4191595wru.232.1535548762085; Wed, 29 Aug 2018 06:19:22 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:f:6020:4c23:4749:7ea6:c5af]) by smtp.gmail.com with ESMTPSA id a37-v6sm9532723wrc.21.2018.08.29.06.19.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Aug 2018 06:19:21 -0700 (PDT) From: Vincent Guittot To: peterz@infradead.org, mingo@redhat.com, linux-kernel@vger.kernel.org Cc: Vincent Guittot Subject: [RFC PATCH 3/4] sched/topology: remove smt_gain Date: Wed, 29 Aug 2018 15:19:11 +0200 Message-Id: <1535548752-4434-4-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535548752-4434-1-git-send-email-vincent.guittot@linaro.org> References: <1535548752-4434-1-git-send-email-vincent.guittot@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 : commit 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. Remove the smt_gain field from sched_domain struct Cc: Peter Zijlstra Cc: Ingo Molnar Cc: linux-kernel@vger.kernel.org (open list) Signed-off-by: Vincent Guittot --- include/linux/sched/topology.h | 1 - kernel/sched/sched.h | 3 --- kernel/sched/topology.c | 2 -- 3 files changed, 6 deletions(-) -- 2.7.4 Reported-by: Srikar Dronamraju Signed-off-by: Vincent Guittot Reviewed-by: Srikar Dronamraju diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h index 2634774..212792b 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 4a2e8ca..b1715b8 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1758,9 +1758,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 56a0fed..069c924 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -1129,7 +1129,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, @@ -1155,7 +1154,6 @@ sd_init(struct sched_domain_topology_level *tl, if (sd->flags & SD_SHARE_CPUCAPACITY) { sd->flags |= SD_PREFER_SIBLING; sd->imbalance_pct = 110; - sd->smt_gain = 1178; /* ~15% */ } else if (sd->flags & SD_SHARE_PKG_RESOURCES) { sd->flags |= SD_PREFER_SIBLING;