Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2600681rdb; Wed, 15 Nov 2023 05:43:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IFI2QlwRrZw9sNysiRfbHUUkAgmw8bDFKBqmKzQyk/vwRrYhFx1cMql9hJj31s58m7TjGsS X-Received: by 2002:a05:6a20:e10f:b0:187:3765:1798 with SMTP id kr15-20020a056a20e10f00b0018737651798mr5855841pzb.22.1700055783969; Wed, 15 Nov 2023 05:43:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700055783; cv=none; d=google.com; s=arc-20160816; b=fU7mHHijdIn3lc7pnVmkg+hAT8Wt9f8WaTI5OlsH9JD9x+DPoHDW21E1i4Bh3Qejww JHTN3XmbimXkFBUwfr0Pd6EZ37ywuqRm1fWuCFK0zKPW3yhGJ9sdmIBoO0dJHqutz08Q VnFGOcubgh9/Ssx8UxJChAU2JTpRQTZdfWNrNqbS45Aqg3/VW/WZM5u7p4pUI/uMjcaR cInWFCBpolerHn4MV+ZXfb3lh6HbxpcH3/aENJ35Nr5+ByMre6vVUxz8q0JeZmIHyns2 eH2GoPi4SXcDirLT4FbQRaJBvttRuG5hTs/aybOcYcveuENLOELe4mx3JGISY0uzAJRt qw6A== 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 :content-language:from:references:cc:to:subject:user-agent :mime-version:date:message-id; bh=5qqz7GD4DPhjVJ5wo8RTaG3EcUA2TJHRQUNTTeblUDA=; fh=BP81ARlCW8dFQoBlCq7YpCeU4fZA636m23qD8QLpJhQ=; b=GjsgN+WPHCHlN1W1FIRsnac6VNocPUMW6bjVUsEmQ2zzvT7e93xR4aY9c5D7DLA4Gf DrmqfGbdv+HTl6o6Ysd3g5CZNPBiZf4v/8CwOsZWMAi2xU6sIZNHZ0Wsp8fAn+vMSfTJ CTdRIBnmMvhWe2ZIvGMfD9Hh9Ana3EvPXL67poQYKM7/0QN2MJM8JxkUzVo0xaHSluee UkIMvjmF08qjlBVBrjOwpi8wapQzg8NAqS3/4w+k516EpfbwqsbJO4inEmnLjcXK1yfb QF+YLciF38/zgKMXajFp5oUlz3et1CLo/uOv9TsgDYY3yveAUZM6y1G3MPqXvpg+4dq/ 1IDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id j191-20020a6380c8000000b005b887ff580asi9706570pgd.878.2023.11.15.05.43.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 05:43:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 132D98197E98; Wed, 15 Nov 2023 05:43:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343929AbjKONnA (ORCPT + 99 others); Wed, 15 Nov 2023 08:43:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343698AbjKONnA (ORCPT ); Wed, 15 Nov 2023 08:43:00 -0500 Received: from out30-98.freemail.mail.aliyun.com (out30-98.freemail.mail.aliyun.com [115.124.30.98]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9CE29B for ; Wed, 15 Nov 2023 05:42:56 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R861e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045176;MF=cruzzhao@linux.alibaba.com;NM=1;PH=DS;RN=12;SR=0;TI=SMTPD_---0VwTBm8C_1700055733; Received: from 192.168.1.107(mailfrom:cruzzhao@linux.alibaba.com fp:SMTPD_---0VwTBm8C_1700055733) by smtp.aliyun-inc.com; Wed, 15 Nov 2023 21:42:54 +0800 Message-ID: <246dee1f-5e14-e075-13c7-ce876305cb54@linux.alibaba.com> Date: Wed, 15 Nov 2023 21:42:13 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH 3/4] sched/fair: introduce core_vruntime and core_min_vruntime To: Peter Zijlstra Cc: mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, joel@joelfernandes.org, linux-kernel@vger.kernel.org References: <20231115113341.13261-1-CruzZhao@linux.alibaba.com> <20231115113341.13261-4-CruzZhao@linux.alibaba.com> <20231115122027.GZ8262@noisy.programming.kicks-ass.net> From: cruzzhao Content-Language: en-US In-Reply-To: <20231115122027.GZ8262@noisy.programming.kicks-ass.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 15 Nov 2023 05:43:02 -0800 (PST) 在 2023/11/15 下午8:20, Peter Zijlstra 写道: > On Wed, Nov 15, 2023 at 07:33:40PM +0800, Cruz Zhao wrote: >> To compare the priority of sched_entity from different cpus of a core, >> we introduce core_vruntime to struct sched_entity and core_min_vruntime >> to struct cfs_rq. >> >> cfs_rq->core->core_min_vruntime records the min vruntime of the cfs_rqs >> of the same task_group among the core, and se->core_vruntime is the >> vruntime relative to se->cfs_rq->core->core_min_vruntime. > > But that makes absolutely no sense. vruntime of different RQs can > advance at wildly different rates. Not to mention there's this random > offset between them. > > No, this cannot be. Force idle vruntime snapshot does the same thing, comparing sea->vruntime - cfs_rqa->min_vruntime_fi with seb->vruntime - cfs_rqb->min_vruntime_fi, while sea and seb may have wildly different rates. Actually, cfs_rq->core->core_min_vruntime does the same thing as cfs_rq->min_vruntime_fi, providing a baseline, but cfs_rq->core->core_min_vruntime is more accurate. I've tried to implement a fair enough mechanism of core_vruntime, but it's too complex because of the weight, and it costs a lot. So this is a compromise solution. BTW, is there any other solutions to solve this problem? Best, Cruz Zhao