Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2410969rwi; Fri, 21 Oct 2022 03:39:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7UDfJl0JZ6qFKlP8/XfDnrcNMEcOFcTTZo1d9giGvGE2wwfOPclYRVDuEefhzGl/G0K+mj X-Received: by 2002:a17:903:40cf:b0:17f:7d7e:95b0 with SMTP id t15-20020a17090340cf00b0017f7d7e95b0mr18391710pld.78.1666348744133; Fri, 21 Oct 2022 03:39:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666348744; cv=none; d=google.com; s=arc-20160816; b=c2ogNaIQ9LIZoeVFyehkejq1dHGpdAcg7Mo+s1s2FFqiyszjYbpyPI4dRarXfT/S7o tIHYFemhV1zUuzrBFmtJEwHrKd8SQFClGKAhz/qMf7kYavujE9icsAT8EL6Zz523wUnz QtjPQi9wh07KGRtO+/K8fpv8203tLLOW3jrEVgMgotwXfh91xZGVzc4wzEWRwEnn+OMy yiQq33KqKLbhuRl47RbHB/6OPu2JKkoAFTU6r4goqAwAHaJJPv2iEZ2Zg756N9AmWkg0 tUehQZSioHV24Fc7v5ANMIoTpFKbUX+Z999il2HbfJAnm86MGUKlpZg9y+q2o2jbtUem xXdA== 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=n5keT/+VSiNfRqOdCNBuwui1oti79FRunGV9Eaf99lw=; b=EKEmY8b4F+8xQsO/h8qcileVYlZOPGvNaY6Tn2Tzsk91M7iJ4w7dUDHhT0ljtih7ns O27HdlXR/X/TVpSdqzHTZ759B29X7DQl5nqfd3c75mnusfXxVcYcR3CYZ1tbkZDKuz9P n5oxImrUELqFMaYkFQKSojn88fR5bBRY66ium/TDCbXBXu0e4n9W3yrJ1d7y3gIV9KWs XZVKrA5F3b+7K3mRmkS2KGVUMAlcMiwHeoR+jTOfNmjfjHQmbqGLenb3abbnI5xKZeKM rPfzIqj1Fg8qU0MDa8TMOXGhCu/JlguOOtNhpAjl+1pE7YVbQg9I3wNprJNWjFsFMD2+ 9nyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=cOfcKBEJ; 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 cp8-20020a056a00348800b0054096da12b1si21812006pfb.39.2022.10.21.03.38.51; Fri, 21 Oct 2022 03:39:04 -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=cOfcKBEJ; 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 S229585AbiJUJfl (ORCPT + 99 others); Fri, 21 Oct 2022 05:35:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229965AbiJUJfa (ORCPT ); Fri, 21 Oct 2022 05:35:30 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80F6F187DDD for ; Fri, 21 Oct 2022 02:35:25 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id c24so1836539pls.9 for ; Fri, 21 Oct 2022 02:35:25 -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=n5keT/+VSiNfRqOdCNBuwui1oti79FRunGV9Eaf99lw=; b=cOfcKBEJKb5ogsRTf/BkHS5EHuhfPLGWFXlln1pIK7Pv9ngy/r1YbFea9C+FCChzVh DsJztj2aK5CG+PuIocS6IdWBwQqflYGNiJn+ZWYEG/6tAHTtwc+UW3o50/olwHFVmvdA M/QNkgmHLKxLe1dL7MyxtR34OvkDRhh0eBtyoE66td+s0GcQgBSv0QYJYhL7m3wXJ6RX ofY8z2RNGJpf/xu0vFl9cR8YPraD0MxvwmdIYCLEEZkOW0ayRGQnK051Rh90yQhnRzSr kjqfTaElibgmrErcKYhfHQ0VfJuz5Q9Tv+t3CaSKUgKqcLtygnkgMEZP9q0Hv8+raZYC zndw== 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=n5keT/+VSiNfRqOdCNBuwui1oti79FRunGV9Eaf99lw=; b=favpVt1IGIB+7To3s7pMbTE/6qMZANrA7Sk7PHFGMBjtYbX8dzJoTKwfzgtdYnntSl KoOILA7g7GJbUYwMhFVUp0TpRQuizWNyc/D7++9hsqRFmbRxUhmrn8+RUjd9jKWvGLeM 3d7mhAKvoM5wqPwig9f4kYQs0a4kCDs+0N0cFTpajHgfqzREUDjN5lMsrcSVaZv7xN4f t2baELNwUGzuOzZa9WTtq150AaEoL3cWgloPuaivhlrW6FlERvM8TcnVqQUN/QAqHzYn VbTNiNJU0WEeOdJr+HRKcWzkO2cElm9cfFc6t5wrT63R5eAXuJyrhbw3OIe+61ARSavT Ju5w== X-Gm-Message-State: ACrzQf0iaOd0E4+k5WtWuXlA89ZFtaewU5ccFDGR2vn7v8zvckd5YbEA 1784EjctLRFN8yupRYj/0OHMIpmsrLnp8Q== X-Received: by 2002:a17:902:e841:b0:180:49a2:8e6c with SMTP id t1-20020a170902e84100b0018049a28e6cmr18296388plg.143.1666344914036; Fri, 21 Oct 2022 02:35:14 -0700 (PDT) Received: from [10.255.20.103] ([139.177.225.253]) by smtp.gmail.com with ESMTPSA id u2-20020a170902e80200b001785dddc703sm14606696plg.120.2022.10.21.02.35.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Oct 2022 02:35:13 -0700 (PDT) Message-ID: <03be9c79-bc59-cd4a-869b-ed4c85c61224@bytedance.com> Date: Fri, 21 Oct 2022 17:35:06 +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> <9ec8a474-d923-953c-0b73-02ba2fd6ea82@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 On 10/21/22 12:34 PM, Chen Yu wrote: > On 2022-10-21 at 12:30:56 +0800, Abel Wu wrote: >> 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. >> > I see. > > Since __update_idle_core() has checked all SMT siblings of 'cpu' if > they are idle, can that information also be updated to icpus? I think this will simply fallback to the original per-cpu proposal and lose the opportunity to spread tasks to different cores.