Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2017738rwi; Thu, 20 Oct 2022 21:40:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7mW7+yM2on4t1S018uZCorTptZUi0LmyFpJLSKC7Sw4iPQgejpQGhFDzBWtws2+Pu2JxTI X-Received: by 2002:a17:90a:c306:b0:211:8e5e:9a66 with SMTP id g6-20020a17090ac30600b002118e5e9a66mr8885818pjt.152.1666327217042; Thu, 20 Oct 2022 21:40:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666327217; cv=none; d=google.com; s=arc-20160816; b=zGJG4MyJ9G9mhBxJ679+yK/g3GjlmcomaN5KYcIXEZ2LdpUCc/zPkoqM52o4An3uhs gyKhUgEb1yAF317oa07Qz1958rdaK2/x7X0WQY/EFbDzNRrDyPyHZy0HEi9kQX5eAlgl HZ6HazIWrw02fN6uooWgVse531PPa8zUzK9e4KCV1bb0tkuY72cm01owlk/+x2Wefu6D tP9QLwtpgANHC9IhJxX+FK8OSQRoOKv2CpIz2/2pSXaHIpzBSuMOI4vg+QKLCRmbGHa+ OHGjs+7VWoqVDnMt8FWYD1kc7YCIpi0mpdPwSdf+K70zHLjR6Lv92c0R9M0qaWMZWjc3 8PpQ== 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=Aiaq2XXhqSug2oabs8xD6Cj6jtpafQvARSUtLlaA63k=; b=0e5A3YNyrKAwzS0hbesW1sJtzlqKp83NAP4EXXneUTCN+o6lqPUkgUvTO0YEb+LXZZ Nq57nXsXgcf6D0JPqD6qEIFKN4ICgKwftrpRjR50xrGMpk1iR6PNwSsuA9JEvhKLbDWw nSYZezfO/lOYWYA3yvFuitxtOKX9sLI7PFCpfZa9JiC+NVHLrExTV3irHlksUY56KiKd kTR5h157BBAfoTB1ZcaPX0/nL5vH7+RQxWNslyBpSzUy5m0alesl7RMPjplruC42Tk4A SWU+aeOcIn7hPl9B3ESgH9zMtD5WLlNmZrnZy0quUEU1c9zSnjuhq9nrACG0R2RmFttK i75A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=DXZbVsDS; 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 i3-20020a63cd03000000b0042b6e87d126si22165468pgg.198.2022.10.20.21.40.01; Thu, 20 Oct 2022 21:40:17 -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=DXZbVsDS; 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 S229746AbiJUEbL (ORCPT + 99 others); Fri, 21 Oct 2022 00:31:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbiJUEbH (ORCPT ); Fri, 21 Oct 2022 00:31:07 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D2C2FE930 for ; Thu, 20 Oct 2022 21:31:05 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id l6so1494739pgu.7 for ; Thu, 20 Oct 2022 21:31:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Aiaq2XXhqSug2oabs8xD6Cj6jtpafQvARSUtLlaA63k=; b=DXZbVsDSiu53QBMA7EYpVxIWuu2X9B/gvg7TwbMsNDP7IAc5SQlYsB3dCqgfy/OaF8 Uk/h1hoY2LHTrHVLmEwh2T03uc2OSzzJ0GAwYoOyfqXGhNtkqiDp9e21rReZE3EETt4f VzmMJywFxK5Elp0VgiIqy3Vzd7X9BWzU6nxL02Qncmfy1BA7dVAa1O3pzxAYGTeULm+p VVC3Mjf/rg7BRvytfx1HioYm6UA8uaYqdJc4CDLd2sy1yKg3eH0p1YRBWxzO9ymYw0Wm a/kxhzdE34QFxtLLoLvOWuztbZ/aS6+bdhvVCod7mIaDTdpgUnL8yInY3Dv1ZrtpjUoC k/gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Aiaq2XXhqSug2oabs8xD6Cj6jtpafQvARSUtLlaA63k=; b=ZZBc+SXPy6yLkiGsVLdqTEi/pxnPTeobD198xQTK94iAeIPSd5OQQYIOyzkcJYcmyk MeZDCYSgPtItQoMy2JSEta46JbkB1KGJDXyZpi1SLkQl54TB3Uup6VdGFtKBChIceIZe tTgS9sutq5gzg1ul1g8JmT4ATYP1bkEMgImcJFQao0i4KbGmvUwHdwVUfgCpIIf3EVoR ckitfF4r82T5L+kJYw8Exnk8y3VOYiDPDYRdsX96Nx4Pl7BITaGkP3wS+KCO8vXLXvag tSEoTZLn3v4A8kqVJ5VN/KHLN+mwvE+w4e1vd8w5BtBhBJZdihrS849mZFw+RBtOsPeK owhw== X-Gm-Message-State: ACrzQf3PDxFIMjTltTlgvnXjjYa/olYBexmY9qkMwmOYS6TQoArla2/s fpAuIde4hVlH/wc2P3CmYENGKQ== X-Received: by 2002:a63:f305:0:b0:43f:6af:7553 with SMTP id l5-20020a63f305000000b0043f06af7553mr14787614pgh.570.1666326665065; Thu, 20 Oct 2022 21:31:05 -0700 (PDT) Received: from [10.255.20.103] ([139.177.225.253]) by smtp.gmail.com with ESMTPSA id n17-20020a170902e55100b00174c1855cd9sm13954056plf.267.2022.10.20.21.30.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Oct 2022 21:31:04 -0700 (PDT) Message-ID: <9ec8a474-d923-953c-0b73-02ba2fd6ea82@bytedance.com> Date: Fri, 21 Oct 2022 12:30:56 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH v6 3/4] sched/fair: Introduce SIS_CORE Content-Language: en-US To: Chen Yu Cc: Peter Zijlstra , Ingo Molnar , Mel Gorman , Vincent Guittot , Dietmar Eggemann , Valentin Schneider , Josh Don , Tim Chen , K Prateek Nayak , "Gautham R . Shenoy" , Aubrey Li , Qais Yousef , Juri Lelli , Rik van Riel , Yicong Yang , Barry Song <21cnbao@gmail.com>, linux-kernel@vger.kernel.org References: <20221019122859.18399-1-wuyun.abel@bytedance.com> <20221019122859.18399-4-wuyun.abel@bytedance.com> From: Abel Wu In-Reply-To: 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 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 Hi Chen, thanks for your reviewing! On 10/21/22 12:03 PM, Chen Yu wrote: > On 2022-10-19 at 20:28:58 +0800, Abel Wu wrote: > [cut] >> A major concern is the accuracy of the idle cpumask. A cpu present >> in the mask might not be idle any more, which is called the false >> positive cpu. Such cpus will negate lots of benefit this feature >> brings. The strategy against the false positives will be introduced >> in next patch. >> > I was thinking that, if patch[3/4] needs [4/4] to fix the false positives, > maybe SIS_CORE could be disabled by default in 3/4 but enabled > in 4/4? So this might facilicate git bisect in case of any regression > check? Agreed. Will fix in next version. > [cut] >> + * To honor the rule of CORE granule update, set this cpu to the LLC idle >> + * cpumask only if there is no cpu of this core showed up in the cpumask. >> + */ >> +static void update_idle_cpu(int cpu) >> +{ >> + struct sched_domain_shared *sds; >> + >> + if (!sched_feat(SIS_CORE)) >> + return; >> + >> + sds = rcu_dereference(per_cpu(sd_llc_shared, cpu)); >> + if (sds) { >> + struct cpumask *icpus = to_cpumask(sds->icpus); >> + >> + /* >> + * This is racy against clearing in select_idle_cpu(), >> + * and can lead to idle cpus miss the chance to be set to >> + * the idle cpumask, thus the idle cpus are temporarily >> + * out of reach in SIS domain scan. But it should be rare >> + * and we still have ILB to kick them working. >> + */ >> + if (!cpumask_intersects(cpu_smt_mask(cpu), icpus)) >> + cpumask_set_cpu(cpu, icpus); > Maybe I miss something, here we only set one CPU in the icpus, but > when we reach update_idle_cpu(), all SMT siblings of 'cpu' are idle, > is this intended for 'CORE granule update'? The __update_idle_core() is called by all the cpus that need to go idle to update has_idle_core if necessary, and update_idle_cpu() is called before that check. Thanks, Abel