From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1EB7F27FD51 for ; Mon, 23 Feb 2026 14:15:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.92.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771856132; cv=none; b=TJe4IglKNIkm6H4ZaJeEE7VhLlweegkZ9wIgkTK/apSfKXz0dITAreXTPr3/jEHwmt7Wqm29N7QTAE8uR4Yr/ELDcXYphdN3CtjpCginK+6AY0F4JffWyNwc0AMUaiprLoQqdMnd0S3aDxZ4xbis9JImZbn6yu9rX6dyernh1z4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771856132; c=relaxed/simple; bh=CRB63orfEI2A1N2okJZUTlmzpqG6/IS9f1xYR/e8j0g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=j2C8/OPdk2I4bVHUt4L3uth9RZOnmiT7naGTteuAvPC20aEBa15Xj2wiEKP4jt41ms0qqpQSzS7sjVjyo1XWncdiXCmuq8FHDwpqA84p517zGIGqcyyvRZc+fKHua9tDCvK0NLR0GJkPJtbYVIPUJuiClr39Hn6WodiGSTc83LM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=kn/v1GbB; arc=none smtp.client-ip=90.155.92.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="kn/v1GbB" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=IPoo8jcZWrMh/DF5oWN7yUhv2SWK1FVhoZ1sU5UsBtU=; b=kn/v1GbBE9sED2MceqUqRfHpHX i9rGFq9FuTduXbpC2dQvs8AB8X/5s571gRKSQAMbgqZT+w8KrJnQo9sb5jV+YdIMHxcMHEJJgaRb5 1OpZDBTiXUD7Ea3luDO0Wm7Z7JLv3cYEEwJuufCkMcm9G2GpOFWq8ibdrj5txT3xuAptN/6W1Z+Jc 7i9bR7m8rQNOOneqJd/ArdNdOMQ3aFr3xSTqOgQ+QMHFvPjUbfCl9WxIT6+JH3MBlnZiby5f80svA RfdvtCuEWMcOiBprFw6dKSG0+39xsfe1kTFPFBTIz/n5Xd84EJjfJcWMyKusHqLsr4kPkIHptwoHP YQg9msOg==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1vuWiQ-00000005DyR-2aYK; Mon, 23 Feb 2026 14:15:14 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 2A1FB3008D6; Mon, 23 Feb 2026 15:15:13 +0100 (CET) Date: Mon, 23 Feb 2026 15:15:13 +0100 From: Peter Zijlstra To: Dietmar Eggemann Cc: mingo@kernel.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, linux-kernel@vger.kernel.org, wangtao554@huawei.com, quzicheng@huawei.com, kprateek.nayak@amd.com, dsmythies@telus.net, shubhang@os.amperecomputing.com Subject: Re: [PATCH v2 1/7] sched/fair: Fix zero_vruntime tracking Message-ID: <20260223141513.GQ1282955@noisy.programming.kicks-ass.net> References: <20260219075840.162631716@infradead.org> <20260219080624.438854780@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, Feb 23, 2026 at 02:09:52PM +0100, Dietmar Eggemann wrote: > On 19.02.26 08:58, Peter Zijlstra wrote: > > It turns out that zero_vruntime tracking is broken when there is but a single > > task running. Current update paths are through __{en,de}queue_entity(), and > > when there is but a single task, pick_next_task() will always return that one > > task, and put_prev_set_next_task() will end up in neither function. > > Tried hard but I don't get the last clause. When prev==next, then put_prev_set_next_task() bails out and we'll never hit __enqueue_entity()/__dequeue_entity(). > [...] > > > While there, optimize avg_vruntime() by noting that the average of one value is > > rather trivial to compute. > > > > nitpick: > > > Test case: > > # taskset -c -p 1 $$ > > # taskset -c 2 bash -c 'while :; do :; done&' > > # cat /sys/kernel/debug/sched/debug | awk '/^cpu#/ {P=0} /^cpu#2,/ {P=1} {if (P) print $0}' | grep -e zero_vruntime -e "^>" > ^ > | > Works > only w/o this comma for me. Hmm, weird, for me: cat /sys/kernel/debug/sched/debug | grep ^cpu#2 cpu#2, 2500.000 MHz cpu#20, 2500.000 MHz cpu#21, 2500.000 MHz cpu#22, 2500.000 MHz cpu#23, 2500.000 MHz cpu#24, 2500.000 MHz cpu#25, 2500.000 MHz cpu#26, 2500.000 MHz cpu#27, 2500.000 MHz cpu#28, 2500.000 MHz cpu#29, 2500.000 MHz And that ',' was added because otherwise it would match the full 20 range of CPUs too, which was not intended ;-)