Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.200 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795481265; b=paPwRcjmEytUVYF7KQPwjARYYjThb4iLl4eOBC8YhfTJkoHKxs69w8gELXgHq6ctbpps NCRfqp4xaJhtlMD13ZBU6PAL7NP5yPrkfruEIW9rmA4w+y+mX9jWwCpc72vDplip9Qmow rN3G50bK9+6zpboT5+P8wiWzjnz23RvVsX3Xziv0pi8B7Kkx+VaJuC7zwIteRT2x+dDm4 xVQ2fl6SMGIYScY44/H+I65jKrluhFLH97GDMdvR/EMAc0BgAngZ0FSj1MJnOPrjf42J+ ADw768hNk4KM1tYyVldDROwUqXHoKyMHeRcSGwHNvus9JvY/l20o2yOamlHXP2L8BEQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795481265; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:In-Reply-To: Mime-Version:References:X-Mailer:Message-ID:Subject:From:To:Cc: Content-Type; bh=tDMwizw/fxrX9EdkfSy3P0m+iIcym6dxr577RysOy0w=; b=zRrHpd/JE51rZYQk3nmSttf6Yer9idilVvC+2R3SwwC2F+AVYAskhfsowQb+lFvhx0M5 3/LIJwDa82OJbJV/1tGxnSOr4ggn02bksdtT010i3G98UzYdLgxgmFtEANoSrC4rU9fL0 03iDBoodpb6tWmggfjZtdWzCXIutueHkjNg6e9A3NzR32cnywBDVVz96htjKmWRYCfdRr Qwv2tk+xbktk3RLjSaaLyzr+U18SQIcHXhiPEFRYNizY5pzwMZiKtpWrs2od4gq7straN 2zDqB58qlh39a0JX5ZTGIsCOoj6qaMJTLsacJEvF988DBlIAPOuV47EPO6+X4PPNFNg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--penghuang.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=OsGOJYRU; arc=none smtp.remote-ip=74.125.82.200 Received: from mail-dy1-f200.google.com (mail-dy1-f200.google.com [74.125.82.200]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A51EB606A31E for ; Tue, 24 Nov 2026 00:47:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A51EB606A31E Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--penghuang.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=OsGOJYRU Received: by mail-dy1-f200.google.com with SMTP id 5a478bee46e88-386a65fca25so2585340eec.0 for ; Mon, 23 Nov 2026 16:47:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1795481264; x=1796086064; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=tDMwizw/fxrX9EdkfSy3P0m+iIcym6dxr577RysOy0w=; b=OsGOJYRUqVqvOsCYltNyjiIiNYG1UOsKPnxnIX3m/SqeQGY+o95ng7enZMqus1W6u+ 3Yc/xJsOzOV1WbHGdHUCvvHXRaqNeye+tzqwa94IEp7Ra+n9OANUgkvt2NXoZBDwyzlu sO8zw+w9tKSXMgZHvI37iz7jvzQujLBvAb658wWtQ+Mh5UYA/xMtX0rrUzg6SqUbyBC3 ZWhWNGeWNAjSpi+RA4kmbt/8ASg1mDwXHJhdD2G5w+8rH5E3xwCqxyw8eslKA7MXgzau tI7exSrdOLkHpAruRIriwhQHg8etbcYdhGit+94vetyiFTuj9iuo1QIY+tMJLKgq/LNf W0KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795481264; x=1796086064; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=tDMwizw/fxrX9EdkfSy3P0m+iIcym6dxr577RysOy0w=; b=zz1hyxx4YbEvkGwBSqWjpJuMtK0MmynbHBh7VYi5cKzAyO+N1j7AL1sj7l4xseN4ZX +/Xu+Ul+6j613MngY4WchsXepsEKXtZsxFtL/Ug7TeR2nuz95XGfl6jQtS8LMApiHm0w vPC9LW650YS/tmNuIMWSqXQs5OqXgi1NJE/ACivqpfTeTy+0wpMygXgyfdad6ZTbzDRu MMRCiQJw13Bphnkj/qg6YMpojYLYkwgGewxQAzCby3WJ9dE1SPQXiTUgqArPoH/8QWf2 hDXoImwRrABmrm7SA8qxdaHOFKHSmU2jur3KwQGSvz2RklgjhPfnDyY0+sCO3c1tnEY3 xZ3Q== X-Forwarded-Encrypted: i=1; AL+hErHahD0pAjAIJ3ed7BuhaGd7fOT5Xg6NaYlasB0bapgmo9y72o73GyHlDV5kW0EVaMu9Lo/kRxXBa2mCB3A=@vger.kernel.org X-Gm-Message-State: APuU4Z9kSOBnp3Kdi0ZQVkQvbxWvJn0uSA+A7yzjR0Szvm0NzXwOSAhN nmuD/ExczoJyCbJZ+65ai7iH5U8P7KRpHeYPJdWgKc6ZzomS2bGfdzmBWz27QwLcBTIHyNlzPSO KuPBEC9QiH/KWlj+tBQ== X-Received: from dycnb22.prod.google.com ([2002:a05:7301:b16:b0:386:af9c:96b6]) (user=penghuang job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7301:2108:b0:386:b99:8ff9 with SMTP id 5a478bee46e88-3860b999354mr11840342eec.40.1795481263233; Mon, 23 Nov 2026 16:47:43 -0800 (PST) Date: Mon, 23 Nov 2026 16:47:42 -0800 In-Reply-To: <861e8b931f99acf9c44cff722d5e94e7@kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 References: <20261122015729.2512645-1-penghuang@google.com> <20261123160934.2289260-1-penghuang@google.com> <861e8b931f99acf9c44cff722d5e94e7@kernel.org> X-Mailer: git-send-email 2.56.1.831.g720f3f5937-goog Message-ID: <20261124004742.1248371-1-penghuang@google.com> Subject: Re: [PATCH] sched/pelt: Skip dormant cfs util_sum under scx_switched_all From: Peng Huang To: Tejun Heo Cc: Peng Huang , Vincent Guittot , Ingo Molnar , Peter Zijlstra , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , K Prateek Nayak , David Vernet , Andrea Righi , Changwoo Min , linux-kernel@vger.kernel.org, sched-ext@lists.linux.dev, stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Hi Tejun, On Mon, Nov 23, 2026 at 01:48:44PM -1000, Tejun Heo wrote: > I'm not familiar with this code, so I may be missing something, but > doesn't __update_blocked_fair() already do most of this? It walks > leaf_cfs_rq_list bottom-up, flushes cfs_rq->removed and propagates the > result to the parent. It just stops running once scx_switched_all() is > set. Maybe the helper can run the blocked load update once on each rq > from that loop instead of open-coding the clearing? If I'm reading it > right, one pass after all the tasks have switched would take care of #1. Yes, Vincent suggested the same thing, and I sent v2 earlier today doing that one-pass drain via __sched_balance_update_blocked_averages(rq) in scx_enable(): https://lore.kernel.org/r/cover.1795462673.git.penghuang@google.com > As for #2, are the leftover sums big enough to matter for > update_idle_rq_clock_pelt()? It looks like fair can leave similar > leftovers behind once the avgs reach zero. You're right -- for update_idle_rq_clock_pelt(), #2 on its own is tiny (< divider, i.e. < 1/1024 capacity per recently-decayed group) and is not nearly enough to cause an issue once #1 is drained. #1 was the real culprit in our reproduction. I only split #2 out as patch 1/2 in v2 per Vincent's suggestion to clean up the util_sum != 0 residual in update_tg_cfs_*() when _avg == 0 (which otherwise keeps cfs_rq_is_decayed() false and leaves empty parent cfs_rqs on leaf_cfs_rq_list in fair). Patch 2/2 alone already resolves the sched_ext issue. Thanks, Peng