From patchwork Wed Aug 29 13:19:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 145427 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp670042ljw; Wed, 29 Aug 2018 06:19:24 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbPetO12ML1wgXUeksBv/ZKUuO64MofAofkfemgiDZ7t4BTuxOX+XMLgNBLqId2lGOI2opR X-Received: by 2002:a62:20f:: with SMTP id 15-v6mr6060067pfc.100.1535548764792; Wed, 29 Aug 2018 06:19:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535548764; cv=none; d=google.com; s=arc-20160816; b=Q7zTmy+js/tq3VbqEoLWa1LSp7RkklpZiqMu8iMJOukD6g2KguPBLOc0RDCcjkO6lv 2mNeUea+ABl3VHlbI5w6SdcQ8sCVZRkNfl5bYTFBEairGhjyAqff8rTVd/rL5tpvnvbV aoiQ4hSGJ7cZFgfqVWfw2kfduDkzXzTtptjQTwtcKNEwFgk77pU4ieDSy3zMVlh3kDNY diqsd/9l9qa2loN4PD97yYPq5ggIddd0rBekMIKhiJcelcqBTouMiGn1AyjagqUrdcod 1b/6tfH8bnDXm3QXXbBhNgW+Zn0meIJHkZriTagP9UNQwtQnAUFqIyZOrGNrJESV7QG4 dNUw== 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=myZ+tXdnhZIQMc2mbqEZMm0G4kQH/y2eGsmXNy1+iJc=; b=tNCsT9wUL91/rmYil2KZy9kv+XIkuJ08SlzNpLhje506zPjnbTEcIyWKD9MAOZDeXe 3ODw4FVVBUM/TUsn3lZJdKh9sG0or0FPg6nRaV+pkAyRhRFXg+yywG/qTY3TcYHwFRWp htT9TX1kI4i7LcFLT16E1EzagB1ifyBBYB3WkJJZP7R/1fwhKtepIOc7sS05cR+NYsnb aPTD6ZTRblOXZ2fzL2nonY41zQEix4xY/LSZxcCekD4k+Rkt4ZtO3H7a3Xv+t0kebM9n D01Y6iDAKKA2pca7MhJTnTpfIKocUIw3EDmMJApo9bwVBM28jJ5qZoTsL6ZXwLGHNrYi ue/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AQfcSDSJ; 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 d22-v6si4009560pgb.444.2018.08.29.06.19.24; Wed, 29 Aug 2018 06:19:24 -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=AQfcSDSJ; 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 S1728660AbeH2RQQ (ORCPT + 32 others); Wed, 29 Aug 2018 13:16:16 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:44388 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727316AbeH2RQQ (ORCPT ); Wed, 29 Aug 2018 13:16:16 -0400 Received: by mail-wr1-f65.google.com with SMTP id v16-v6so4798434wro.11 for ; Wed, 29 Aug 2018 06:19:20 -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=myZ+tXdnhZIQMc2mbqEZMm0G4kQH/y2eGsmXNy1+iJc=; b=AQfcSDSJgJu23/p0HZUDntapwzg9r2cjzvtOHzV9SUYFJz85r6ErAThZjejGTCwKvI tKrBYEsqfXLmG5rf6xxf2r4dLEhYo2Fdot5Yh9j/DQP+vJZwCcbyy1OqUTDlggQmAb0h eb/pZaRpYAAu8BEUpw2tp53pqLs/c1tZP2cdM= 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=myZ+tXdnhZIQMc2mbqEZMm0G4kQH/y2eGsmXNy1+iJc=; b=naHZgRBWzZxpUHB0y+rqpJ9i3NdMccHF3NemXE93INcCCvuV+HPsScMCu1HhI932g8 lG6QrRznLwzmOqSHAiOL6f6BVlWECvbLSWnIkr3n9xYz6Kk8Ddy0hYc0tV2+uf08UHij 3tiEUz6IxEP/ocWCZ+5YoQvuTNSEvCz3x2s3KnGT8jGyWUn3ebXLPGCsMrd17GVt6lzl /GHLbpWsSpGWHexjO0RueQt9G3eO8fj/2XksVpj2IiqiZnJ+p3tmqhjOvHx1G2ltWUmZ bLPsVYGTLfD+we5aeTXhtJVqs7fZp3rCY/hKDupI0NJM7SiJqx210Q7uUwqWAnBQvRQF 7LHA== X-Gm-Message-State: APzg51ABPab4S6f/dPCxQYNMnvf2+++4ZZlQE5P/3s1kmyKb7OOdn9Sd 5qk+zfIZuffR5dy7aXq14Rj68g== X-Received: by 2002:adf:8385:: with SMTP id 5-v6mr4342512wre.13.1535548759793; Wed, 29 Aug 2018 06:19:19 -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.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Aug 2018 06:19:19 -0700 (PDT) From: Vincent Guittot To: peterz@infradead.org, mingo@redhat.com, linux-kernel@vger.kernel.org Cc: Vincent Guittot , Srikar Dronamraju , Rik van Riel Subject: [PATCH 1/4] sched/numa: remove unused code from update_numa_stats() Date: Wed, 29 Aug 2018 15:19:09 +0200 Message-Id: <1535548752-4434-2-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 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 Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Srikar Dronamraju Cc: Rik van Riel Cc: linux-kernel@vger.kernel.org (open list) Signed-off-by: Vincent Guittot --- kernel/sched/fair.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) -- 2.7.4 Reviewed-by: Srikar Dronamraju diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 309c93f..c2b8bf4 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 {