Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3469838pxb; Sat, 9 Oct 2021 11:12:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9s1DeoGny1JHKwdKW9frJpBa5WeZbTTzPQLIuEPt4wWt0Je660xLHBfeh5ehY7Idc0j9G X-Received: by 2002:a17:906:a3c4:: with SMTP id ca4mr12964608ejb.529.1633803163929; Sat, 09 Oct 2021 11:12:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633803163; cv=none; d=google.com; s=arc-20160816; b=GGjPsHreoHepEj3ZwOde98a0J4EU+6M18SdOin4iCjUF+CPV6pSz50J7Kb+dC1vFBV PlQm9a52Cf4tYDUoofUXx1ygCfWmDv6cH7B28w2OpaiBT6siGnTtDulr9cLXwmFXw9ZY VnWrxm2NRklmzez8gMO8W6eiAbJfNEAR+PZUiaPlPcpVeZDVAU8usKqXZBo90m+6PNXu Rk4EV4q/InDcnURhzfk51h3X0MxPGA2B76+glNdmc0zNNKPnUehEYWJrbF/kLR7z2nZn dkHDaIOQoqrJ/Y8yXEYxggQx5z6VjEVnh4+MAU5ekgpp1T1kSsX6gz/2OA17/rNdQxTi ya5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ZMVxJqPKaSl4GSNlQsUxh9ySBX4Km3FVjqq+MNWj++o=; b=EHOVsIeHlfAED2YM5f4XdJTnv6wRHUNWTV7cosBgU5bRfjt2ZCkXsjQ7zbRhnfnuVv xS/e/P0dDo4qzJC3a5zAm7qjs/mEbuTaQI/0e7kfa9KZZA0y5UWYzCRZOLYxZj2Cp3Bj 1EB3VP7yhAqXD96bZb+TOwngR9cU7t0Eks27mSqgn9/1MtGOo3gvmCvdrRY0PWW5uZh2 bfZy1dovwuucngKau3xzQbGSAPMj/WybffMawuKc7kK8oeGzAlOr6dtegGOU/JYnrlxf wQQe9SRk9XPN6AARVgmkQz1E/4JEHRypwJ1QTCYiy/JnvlMkP0RVUdvsphC9sFCg28BS SW6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=PO2DzdLY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z37si3734048ede.75.2021.10.09.11.12.20; Sat, 09 Oct 2021 11:12:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=PO2DzdLY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229821AbhJISMe (ORCPT + 99 others); Sat, 9 Oct 2021 14:12:34 -0400 Received: from out1.migadu.com ([91.121.223.63]:14029 "EHLO out1.migadu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229610AbhJISMe (ORCPT ); Sat, 9 Oct 2021 14:12:34 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1633803035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ZMVxJqPKaSl4GSNlQsUxh9ySBX4Km3FVjqq+MNWj++o=; b=PO2DzdLYV6BZOvMai/wKqYUA4Vq9NTxkvOeHLrTiLu0UpflWJ0yKz0/TkYWX2/nItv7RM7 9sxZSCil30pcKM+HpHAmX6o/ppn92c72yI+DzRKebGXAUiDgTh4hxA0CJXkAVxYFP9HHUD D86IEIJzewHxhwUpP1wjo/V0V5v6pY0= From: Tao Zhou To: linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira Cc: Tao Zhou Subject: [PATCH] sched/fair: Use this_sd->weight to calculate span_avg Date: Sun, 10 Oct 2021 02:10:55 +0800 Message-Id: <20211009181055.20512-1-tao.zhou@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: tao.zhou@linux.dev Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org avg_idle, avg_cost got from this_rq and this_sd. I think use this_sd->weight to calculate and estimate the number of loop cpus in the target domain. --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index f6a05d9b5443..7fab7b70814c 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6300,7 +6300,7 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, bool avg_idle = this_rq->wake_avg_idle; avg_cost = this_sd->avg_scan_cost + 1; - span_avg = sd->span_weight * avg_idle; + span_avg = this_sd->span_weight * avg_idle; if (span_avg > 4*avg_cost) nr = div_u64(span_avg, avg_cost); else -- 2.32.0