From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 339901C68F for ; Thu, 12 Feb 2026 17:16:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770916589; cv=none; b=JlKGRbuqSo0QTSA6VkJqEZPEj4NEmCCoDlYDsG5beNjetfpPZaMkZ2WAQl38mawD8NY8wmXR2agIQTcnZm6+gNuK9PVGZX0+dUrPpdSW0iF99IebGnXHcvrNd8Y/DB63vOnzWeI7oveE1lnPgdEmAGKFeAKH3JbJ2Ya5WynRLcI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770916589; c=relaxed/simple; bh=HEGN3RH9/2z9i6JpMmD32vaaLnkE7o/AbN5FrqwiQNI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SFjnnAgqpnbrgJfrTw8Hfv9Fkwck8wBOlDs8v+Z399h3Vnt52UNxOOvAlwNOkqpaQoRrph53fwmvlShTTZU0DWZkldGS85gTRkYJ0nauberzAxRsjvBA72ZTFYLZ3mn0kXuwL5WAb5Fo4xjJpB0dsYyjiH+KeU+0QR40sTC2Ydg= 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=VKg56254; arc=none smtp.client-ip=90.155.50.34 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="VKg56254" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=XTYth3aoe+7o7EngWeyMsJ+WSHYPcKJ0Xf1nsWovuRQ=; b=VKg56254HNwemTKommR9GGjJ6A x6kZ1+fjPrKBxW4YnF6QeJyVKR/yWK+afhV1uB8A06GVffhaprM1k6K9T8mIADBilKp/M5QIXAF7C hENbOJkGi6n7Cxvg0eqynfpwXEJRPlVSwl/FOGHCtVryc8bbWs0VXVnlsS8qXbn/Smx4N/51EtG2f p4T9sTt+CkpXv9k0EHNEHqmLlRzC4xAplI50tz8cBN9ZBTpYWtn9vUizPTD/Dpp/HvgwJ8jK+Tgmz oLQ18B0Zbh2CI+Xb9Y72Z4yL8VI2BC3PqK4/Ek/EpXYA2NQX40QbLDZTR/RPJlnEQ5bBJxigUuZ1o qwvCa6vw==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1vqaIW-0000000EUFO-1hUQ; Thu, 12 Feb 2026 17:16:12 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id A980730075B; Thu, 12 Feb 2026 18:16:11 +0100 (CET) Date: Thu, 12 Feb 2026 18:16:11 +0100 From: Peter Zijlstra To: K Prateek Nayak Cc: Vincent Guittot , Doug Smythies , mingo@kernel.org, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, linux-kernel@vger.kernel.org, wangtao554@huawei.com, quzicheng@huawei.com, wuyun.abel@bytedance.com Subject: Re: [PATCH 0/4] sched: Various reweight_entity() fixes Message-ID: <20260212171611.GL1395416@noisy.programming.kicks-ass.net> References: <20260209154718.GW1282955@noisy.programming.kicks-ass.net> <002501dc9b16$442a7050$cc7f50f0$@telus.net> <20260211090144.GY1282955@noisy.programming.kicks-ass.net> <20260211104833.GH1395416@noisy.programming.kicks-ass.net> <20260211162825.GZ1282955@noisy.programming.kicks-ass.net> <58c6c115-f544-4c51-990c-a3ad2fbf701a@amd.com> <20260212115943.GB1282955@noisy.programming.kicks-ass.net> 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: <20260212115943.GB1282955@noisy.programming.kicks-ass.net> On Thu, Feb 12, 2026 at 12:59:43PM +0100, Peter Zijlstra wrote: > On Thu, Feb 12, 2026 at 01:13:30PM +0530, K Prateek Nayak wrote: > > Enqueue cfs_rq: depth(1) weight(2144337920) nr_queued(2045) sum_w_vruntime(18343811230990336) sum_weight(2144337920) zero_vruntime(18337852274) sum_shift(0) avg_vruntime(18337852274) > > Dequeue cfs_rq: depth(1) weight(2144337920) nr_queued(2045) sum_w_vruntime(1303379968) sum_weight(2143289344) zero_vruntime(18354971669) sum_shift(0) avg_vruntime(18354971669) After staring at waaay too many traces of my own, which confirm what you're seeing, but didn't want to make any sense either... ... I thinks I found it ... Note that sum_weight, that has _just_ flipped bit 31 and thus turned negative *if* it were a 32bit number. Every time, exactly at this point things started to go sideways. So I went looking for where this might be and I found the below. My latest run has passed 0x8000000/(1024*1024) = 2048 tasks and is still running. Numbers are still sane, fingers crossed. --- diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 5b1a2abb727e..de155be02411 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -797,7 +797,11 @@ u64 avg_vruntime(struct cfs_rq *cfs_rq) if (runtime < 0) runtime -= (weight - 1); +#ifndef CONFIG_64BIT delta = div_s64(runtime, weight); +#else + delta = runtime / weight; +#endif } else if (curr) { /* * When there is but one element, it is the average.