Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp234807imw; Thu, 14 Jul 2022 00:10:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vWax3sTgGjzAzz2BcVan0bbmDwjCnUM1OMM6oEvd9yN798YpIgUK3ZLRhqTvV7L8CGnjbc X-Received: by 2002:a17:907:6e13:b0:72b:509e:bd6b with SMTP id sd19-20020a1709076e1300b0072b509ebd6bmr7446836ejc.202.1657782613466; Thu, 14 Jul 2022 00:10:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657782613; cv=none; d=google.com; s=arc-20160816; b=nLZIx234xxfo6402ajdeR4lC27su8tlHNa6nNOZbu2w7gUKP6GkPZN7qf1iWXVRHZO nAOvgDppx9rZJ3eEBwIwK2dcjUKVgKC1ZGwDTyUBVdlXtVWSMgRfSU0R8JEAw7tdALt7 wqYxhsrD/e1iZfNQEYS+54gT5or1+SSCJpZcUnnRiIlB0jVM9SGOWUBYLeBNzGGDAmwk 1c+xZHfOIfTvV+9XGTLIODvX+qA2nnVMpbCRVVaT2dgFEbTG/X9WhxBx7/+uYcl8WrbV uhGIZo7nUKcCPq80s9ywW7qg1G2oU5LMpygtFH3dXmnO4mCUnVpVqX2ADMjGsrpGGOFZ svXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Ow4XbAB1kGJrqkjsozYWdg/Tqr2cl2cAwtPRj5iANg0=; b=A+w9vvwis7dVrXeyQJJKuL1LiwVNNTMD+J1Hv/L3bMxvW2+vP2/XZp2WgYOFP6yVlx U5l6vRY1IkGP5K5cjy8kKblhVMOOf8IF87tcUTdTpMkLj97JfHMOsA96j8eRPCRoI3PW BYH7jMX97V/XL9lzw+nMHjon8Nwsw9ofpGB2LsQR5VO5vSdzlEPHtU66Xwbnlxu5rd+F W9nw1Xqia2ndaq1zcuezI/ksyxQDQaELkTvQ0+JS6qCOoyoxcRiTDkcIPTwuYvdEfmQm Dfjj9aGypT26mUSlOCPcLIPHy4WNLnbxipKR5UmBSmSpNdIzsI1pj4cWVfTYr6QUB2yf Kclg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b="e49Dx/Fg"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z10-20020a05640240ca00b0043adf786ef6si1577253edb.369.2022.07.14.00.09.47; Thu, 14 Jul 2022 00:10:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b="e49Dx/Fg"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235549AbiGNG70 (ORCPT + 99 others); Thu, 14 Jul 2022 02:59:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229686AbiGNG7K (ORCPT ); Thu, 14 Jul 2022 02:59:10 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4EB32B18E for ; Wed, 13 Jul 2022 23:59:05 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id p9so1789509pjd.3 for ; Wed, 13 Jul 2022 23:59:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=Ow4XbAB1kGJrqkjsozYWdg/Tqr2cl2cAwtPRj5iANg0=; b=e49Dx/FgmmC+u0cLfWEccN+STzae4HNxpR12zfpRrKatQl+teVi5WpoTNVO21UMmGH xHRWi9659SKfCisk8E6rbyvNAHcdP5Xslm+djwK7ibmtNwO1NIKU5eF20IwueieZ9D0T M/Jn0KkrcRWUb9b29bS+UEe5JJjVwmnYymKoQM3Ytt6QiFxyrlbaWIMTuSUk7ppYAPcC bMtXZUMtAg3yKpHZaAW43CXWLShmAmsLwe9KC6QSgyHl0crTRhaRiucm2UJbd5NWXFUS si1uopG+eL1Mj8J8a6/Vt+rG5LSLCzw+lVrC/tyNkZVpXgGyLPQs3C00Tnfs91/3L3xH OaLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=Ow4XbAB1kGJrqkjsozYWdg/Tqr2cl2cAwtPRj5iANg0=; b=e9zSvoqnpJrYICLMA3RL256XFw6FUPXKppKdnGazu3bdZCPbBS+nBLIZV7iYGyb4Vr dTfSYdbNEf2Poxj4Ni/MvZZAEdWB7Sx19lh1ecyRMklMdGK6tE5H0wQ9y+JRXAp0hCJf O3gcvN95bcArH+uNsOEkN95wYHr97XuEEUQqYQZ4dpsr+8mB1OccOtlIa1yO9LX5oQvm KT0HY0IWZaP1mc0RV+isVQbNPe2/a4a7Xj59LGBCPLtdoQp4HLdLwuv40b/jqK20QPri i9kkshv4vQwSdP9ly4IPkcViop5ZQQ25twMJou7aAAkZJvMHyU9uHfHyi340Nx9ht3Vh SPrA== X-Gm-Message-State: AJIora889cZWBJfW91tUcT20HbvO+bn0lVdW3lvyr5QHqv50obdy6HDs YLeG+24iOxh1Dzkti8YZCGe4iw== X-Received: by 2002:a17:90a:bc95:b0:1ef:8b48:fa0b with SMTP id x21-20020a17090abc9500b001ef8b48fa0bmr14273066pjr.189.1657781945443; Wed, 13 Jul 2022 23:59:05 -0700 (PDT) Received: from [10.94.58.189] ([139.177.225.238]) by smtp.gmail.com with ESMTPSA id h19-20020a631213000000b003fcf1279c84sm522567pgl.33.2022.07.13.23.59.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 Jul 2022 23:59:05 -0700 (PDT) Message-ID: <4dde05be-8470-5984-0a30-ba077b9fe6bd@bytedance.com> Date: Thu, 14 Jul 2022 14:58:59 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH 1/5] sched/fair: ignore SIS_UTIL when has idle core Content-Language: en-US To: Yicong Yang , Peter Zijlstra , Mel Gorman , Vincent Guittot Cc: yangyicong@hisilicon.com, Josh Don , Chen Yu , linux-kernel@vger.kernel.org References: <20220712082036.5130-1-wuyun.abel@bytedance.com> <20220712082036.5130-2-wuyun.abel@bytedance.com> <8e7d75d4-613e-f35e-e932-323789666fb1@huawei.com> From: Abel Wu In-Reply-To: <8e7d75d4-613e-f35e-e932-323789666fb1@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/14/22 2:19 PM, Yicong Yang Wrote: > On 2022/7/12 16:20, Abel Wu wrote: >> When SIS_UTIL is enabled, SIS domain scan will be skipped if >> the LLC is overloaded. Since the overloaded status is checked >> in the load balancing at LLC level, the interval is llc_size >> miliseconds. The duration might be long enough to affect the >> overall system throughput if idle cores are out of reach in >> SIS domain scan. >> >> Signed-off-by: Abel Wu >> --- >> kernel/sched/fair.c | 15 +++++++++------ >> 1 file changed, 9 insertions(+), 6 deletions(-) >> >> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c >> index a78d2e3b9d49..cd758b3616bd 100644 >> --- a/kernel/sched/fair.c >> +++ b/kernel/sched/fair.c >> @@ -6392,16 +6392,19 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, bool >> struct sched_domain *this_sd; >> u64 time = 0; >> >> - this_sd = rcu_dereference(*this_cpu_ptr(&sd_llc)); >> - if (!this_sd) >> - return -1; >> - >> cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr); >> >> - if (sched_feat(SIS_PROP) && !has_idle_core) { >> + if (has_idle_core) >> + goto scan; >> + >> + if (sched_feat(SIS_PROP)) { >> u64 avg_cost, avg_idle, span_avg; >> unsigned long now = jiffies; >> >> + this_sd = rcu_dereference(*this_cpu_ptr(&sd_llc)); >> + if (!this_sd) >> + return -1; >> + > > I don't follow the change here. True that this_sd is used only in SIS_PROP, but it seems irrelevant with your > commit. Does the position of this make any performance difference? No, this change doesn't make much difference to performance. Are you suggesting that I should make this a separate patch? Thanks, Abel > > Thanks. > >> /* >> * If we're busy, the assumption that the last idle period >> * predicts the future is flawed; age away the remaining >> @@ -6436,7 +6439,7 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, bool >> return -1; >> } >> } >> - >> +scan: >> for_each_cpu_wrap(cpu, cpus, target + 1) { >> if (has_idle_core) { >> i = select_idle_core(p, cpu, cpus, &idle_cpu); >>