Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2574644imm; Mon, 10 Sep 2018 03:21:45 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYiVBzlgJcAnlOYKasxaCYAXD8oOGwgYK2IcWPtOxqjlYyE5bu/omqllbh6RYhOnqSMnmkS X-Received: by 2002:a63:e255:: with SMTP id y21-v6mr21868104pgj.160.1536574905652; Mon, 10 Sep 2018 03:21:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536574905; cv=none; d=google.com; s=arc-20160816; b=thoJ5FmjZIL7+lJR2GlXIr/PCjI76oUFMK5Q7Va1bxoMMXqVj73HNKPBp9R/bhYNhL oYkoQ+ITZqK+5AIuk1G+rjcvcwOZpsQH1U2Ajw0tRvB/Y5mXlUdUQ7PIFRbYSvTtka6E KKdMdBVN+1ho/eJAioHEwWIIDrILd8abWh9RmrX7C8vEmfc3OgWmX+VuKGH/lWgzQcUd VQHwz3lgaw+Ly7fIuJwWEMdXy+SXxVNKk6U/amrAHexIB2cJKxYT0oqFT/gd+fiKNyGI yUMKqwQN+wD22/p8db6GLueQ4fL3N9F0zkJ2TYOgpi0jZMNOB/20EZHK3GK7cH/3NvWt teVw== 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=31UvMdagQ7uUzj/zQ/OW+2Yc6m+SN6ns/kNCn+4SSZ0=; b=phw51ePx1IixH94jw8CorCuYohKCOyuzjKGSc5oCzIBmNX0gRzeoCueqcjQ2DjTFkc 1uIRKxAtt0BYoArtzTXNGKGMdflGvYQnFd4PNQ2clrVZms1tKpdWLWWClioEe8F1i1Tp CsULBaR7iDppZ3vEad7r8zQsJhXewUEhLZ+2vAEpdhMf76RbJu73ofULMVZZXUHhlT3Z 8rBAVRbI+SAOUmUQhOX/SIJzdlV/+ep3cAUMmiFqkOSPAHvJKalDjYr0zQ8rSfHti/AU tj+SyjUzLZsvcue9S5AgFa5l4VL1zyMUcYVKta3k/5HlzHFYO2ImjGFr+H6yoIU7SFmT bvlw== 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 b10-v6si17113265pgi.416.2018.09.10.03.21.29; Mon, 10 Sep 2018 03:21:45 -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; 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 S1728087AbeIJPNk (ORCPT + 99 others); Mon, 10 Sep 2018 11:13:40 -0400 Received: from terminus.zytor.com ([198.137.202.136]:44891 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726738AbeIJPNk (ORCPT ); Mon, 10 Sep 2018 11:13:40 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w8AAJqnl1808763 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 10 Sep 2018 03:19:52 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w8AAJqlQ1808760; Mon, 10 Sep 2018 03:19:52 -0700 Date: Mon, 10 Sep 2018 03:19:52 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Vincent Guittot Message-ID: Cc: hpa@zytor.com, linux-kernel@vger.kernel.org, mingo@kernel.org, mgorman@techsingularity.net, peterz@infradead.org, riel@surriel.com, tglx@linutronix.de, srikar@linux.vnet.ibm.com, torvalds@linux-foundation.org, vincent.guittot@linaro.org Reply-To: hpa@zytor.com, linux-kernel@vger.kernel.org, peterz@infradead.org, riel@surriel.com, mingo@kernel.org, mgorman@techsingularity.net, srikar@linux.vnet.ibm.com, tglx@linutronix.de, torvalds@linux-foundation.org, vincent.guittot@linaro.org In-Reply-To: <1535548752-4434-2-git-send-email-vincent.guittot@linaro.org> References: <1535548752-4434-2-git-send-email-vincent.guittot@linaro.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] sched/numa: Remove unused code from update_numa_stats() Git-Commit-ID: d90707ebebe03596e19de3abbf79b766e72a3465 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=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) 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: d90707ebebe03596e19de3abbf79b766e72a3465 Gitweb: https://git.kernel.org/tip/d90707ebebe03596e19de3abbf79b766e72a3465 Author: Vincent Guittot AuthorDate: Wed, 29 Aug 2018 15:19:09 +0200 Committer: Ingo Molnar CommitDate: Mon, 10 Sep 2018 11:05:55 +0200 sched/numa: Remove unused code from update_numa_stats() With: commit 2d4056fafa19 ("sched/numa: Remove numa_has_capacity()") the local variables 'smt', 'cpus' and 'capacity' and their results are not used anymore in numa_has_capacity() Remove this unused code. Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Srikar Dronamraju Acked-by: Mel Gorman Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1535548752-4434-2-git-send-email-vincent.guittot@linaro.org Signed-off-by: Ingo Molnar --- kernel/sched/fair.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 06ff75f4ac7b..b65596fae06b 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -1463,8 +1463,7 @@ struct numa_stats { */ static void update_numa_stats(struct numa_stats *ns, int nid) { - int smt, cpu, cpus = 0; - unsigned long capacity; + int cpu; memset(ns, 0, sizeof(*ns)); for_each_cpu(cpu, cpumask_of_node(nid)) { @@ -1473,26 +1472,8 @@ static void update_numa_stats(struct numa_stats *ns, int nid) ns->nr_running += rq->nr_running; ns->load += weighted_cpuload(rq); ns->compute_capacity += capacity_of(cpu); - - cpus++; } - /* - * If we raced with hotplug and there are no CPUs left in our mask - * the @ns structure is NULL'ed and task_numa_compare() will - * not find this node attractive. - * - * We'll detect a huge imbalance and bail there. - */ - if (!cpus) - return; - - /* smt := ceil(cpus / capacity), assumes: 1 < smt_power < 2 */ - smt = DIV_ROUND_UP(SCHED_CAPACITY_SCALE * cpus, ns->compute_capacity); - capacity = cpus / smt; /* cores */ - - capacity = min_t(unsigned, capacity, - DIV_ROUND_CLOSEST(ns->compute_capacity, SCHED_CAPACITY_SCALE)); } struct task_numa_env {