Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1874524ybv; Thu, 6 Feb 2020 11:22:53 -0800 (PST) X-Google-Smtp-Source: APXvYqzFJZRKF1yH2lWPWft5hNOMCkJIyNP2NgeOyRO/Zd+Hm8jokGohec2Kv/tG6vLydTYcJK4X X-Received: by 2002:a9d:831:: with SMTP id 46mr32531535oty.295.1581016973167; Thu, 06 Feb 2020 11:22:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581016973; cv=none; d=google.com; s=arc-20160816; b=ciopLrXFpCPedoQydqgnBtQ++IqgMT2lLCy4j2KnOC8wPISKW4V1EzVVPModf3VdoM 9Tlzh+doQei4rhrj8n81vKoimNumsAYSdCDwIerKa3xKw47ckaz/Ix5+owFYcG233+v2 R0KZNd/+kP4MyAvNdWr8cootjIOseV+MkKaTzCwu8HghGGl0Es+2OvQSXFNaDC+PzPsM lelZFc2KvCemb8H9fKzRQXUJP01PDRAyMxzcbaQLBXW+c70wYONaU5ddVlEpI17KYaz7 HasjEqqnbTDr1PAOpphwMkGMuuF3YyJAuW+KG496+HanFOm9XUUe7hPIrjTIePxbRkR5 V6rQ== 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:date:subject:cc:to:from; bh=dyxLtm1Bjmt5T/t9AN7bOpxGBVA1ai9Twxm92CCw8sk=; b=LDWpJd5OFu2I2IOjA772GQMS1R3eGH9j9SK4DZPztdcM6A72v6VZGDD9gesL7nUDHZ Gb/5TchUXu4JU17xmfDvsGHzG9DzekrPps/8wQVS2L3MJkwkHnYOk/vVSlnWgDTahyca Qcd1MqnY+Vshh24QR1Wi/LHTAaINpWDyWeDYLczEQxRuUfk5YO6CbhpNVVv8Dc1G2Fng UaJal6FcCOs/tXRVuGT7MqBAE11ymO1NW6/ksevahmJwEx7bGiE6kPJKP1o/pMuni5jI ObQ+2diXfOzRsJv5ybrIWwj2YsQE3gj14E+itP2bK5NFser/C9559HIlYEw5rUctQ9Lj xJBg== 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 x26si266196otk.325.2020.02.06.11.22.34; Thu, 06 Feb 2020 11:22:53 -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 S1728056AbgBFTUX (ORCPT + 99 others); Thu, 6 Feb 2020 14:20:23 -0500 Received: from foss.arm.com ([217.140.110.172]:33700 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727946AbgBFTUS (ORCPT ); Thu, 6 Feb 2020 14:20:18 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2AF801063; Thu, 6 Feb 2020 11:20:18 -0800 (PST) Received: from e113632-lin.cambridge.arm.com (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id CFE1D3F52E; Thu, 6 Feb 2020 11:20:16 -0800 (PST) From: Valentin Schneider To: linux-kernel@vger.kernel.org Cc: mingo@redhat.com, peterz@infradead.org, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, morten.rasmussen@arm.com, qperret@google.com, adharmap@codeaurora.org, pkondeti@codeaurora.org Subject: [PATCH v4 4/4] sched/fair: Kill wake_cap() Date: Thu, 6 Feb 2020 19:19:57 +0000 Message-Id: <20200206191957.12325-5-valentin.schneider@arm.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200206191957.12325-1-valentin.schneider@arm.com> References: <20200206191957.12325-1-valentin.schneider@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Morten Rasmussen Capacity-awareness in the wake-up path previously involved disabling wake_affine in certain scenarios. We have just made select_idle_sibling() capacity-aware, so this isn't needed anymore. Remove wake_cap() entirely. Signed-off-by: Morten Rasmussen [Changelog tweaks] Signed-off-by: Valentin Schneider --- kernel/sched/fair.c | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 9a5a6e9d2375e..9eedf1d6de3a1 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6143,33 +6143,6 @@ static unsigned long cpu_util_without(int cpu, struct task_struct *p) return min_t(unsigned long, util, capacity_orig_of(cpu)); } -/* - * Disable WAKE_AFFINE in the case where task @p doesn't fit in the - * capacity of either the waking CPU @cpu or the previous CPU @prev_cpu. - * - * In that case WAKE_AFFINE doesn't make sense and we'll let - * BALANCE_WAKE sort things out. - */ -static int wake_cap(struct task_struct *p, int cpu, int prev_cpu) -{ - long min_cap, max_cap; - - if (!static_branch_unlikely(&sched_asym_cpucapacity)) - return 0; - - min_cap = min(capacity_orig_of(prev_cpu), capacity_orig_of(cpu)); - max_cap = cpu_rq(cpu)->rd->max_cpu_capacity; - - /* Minimum capacity is close to max, no need to abort wake_affine */ - if (max_cap - min_cap < max_cap >> 3) - return 0; - - /* Bring task utilization in sync with prev_cpu */ - sync_entity_load_avg(&p->se); - - return !task_fits_capacity(p, min_cap); -} - /* * Predicts what cpu_util(@cpu) would return if @p was migrated (and enqueued) * to @dst_cpu. @@ -6434,8 +6407,7 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f new_cpu = prev_cpu; } - want_affine = !wake_wide(p) && !wake_cap(p, cpu, prev_cpu) && - cpumask_test_cpu(cpu, p->cpus_ptr); + want_affine = !wake_wide(p) && cpumask_test_cpu(cpu, p->cpus_ptr); } rcu_read_lock(); -- 2.24.0