From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3EB911DF970 for ; Sun, 1 Feb 2026 17:13:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769966000; cv=none; b=AokEQp8eAXWDggzd8Qzo7InNmaQP8kf5H22Wt69IzKDvSUxYI61RWMnDo0To0fc8e7yWU413n7pZYrQkLW1VuophFw7tCEspGoZYfX+0m2v4RbvxXmd85E3K2e1cWBz0jkFCTsEFHQEMfou5fWEQqIFd5CCHCNzt1P/FZmgUbXc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769966000; c=relaxed/simple; bh=g/QXHLk43ga2V8cR8FFKQg0Q49OzMQy4NuQurdbZP2o=; h=From:To:Cc:References:In-Reply-To:Subject:Date:Message-ID: MIME-Version:Content-Type; b=L3iapRkLhVOzhUN4CpDZd3Worf8Ym1MUr7d6YCrGVd1euxGNIFNWVhqDQdmInnOfmiIo2yjow3ARSUkO5PokPgFoDtQ3AMULthbviNYh/2yp7lr/BnHtliEzcMFB6gwlPw7UpCDd2cV+m7Lnjyq0clQRJpObsyvI5gSC5GWsnb0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=telus.net; spf=pass smtp.mailfrom=telus.net; dkim=pass (2048-bit key) header.d=telus.net header.i=@telus.net header.b=VQrIz1yN; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=telus.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=telus.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=telus.net header.i=@telus.net header.b="VQrIz1yN" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-2a77c1d5c3bso16094445ad.0 for ; Sun, 01 Feb 2026 09:13:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telus.net; s=google; t=1769965998; x=1770570798; darn=vger.kernel.org; h=content-language:thread-index:content-transfer-encoding :mime-version:message-id:date:subject:in-reply-to:references:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=OYe9Wl3a/I3/YoKNXBIw91cnWSQYgpewA9rkXhlx/Ks=; b=VQrIz1yNVgcEuro8+Bq/Eih20osnKBWEIJv7WINZDuKYTFyaIBVQqUYqyBITko8An4 Fp5QAlBZKTpA53POAIOA3TCSy21JqmC1q1TO/94BmZ0aKbyuMpIL5LREWekyRMxwZ1bL XW5IY/X8VTDdt8WhScJLyup1UfjrW3pz/uexm8UyjRitW9hRuXWrrFffuWQ65v/FCfkw QugkhO0lhbHb/b1V/TvNn4UuksQHiIczaF7WVYKlVYbDXXDjWLWGaC4A8u9aFjG0DjRP 5Ob8hqe8tWnau3BSJVXwCrEOPuLVABVc6gg/KhXJwkJVu/Jt9Vcj06oOTHKWh9FkQkfL WPHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769965998; x=1770570798; h=content-language:thread-index:content-transfer-encoding :mime-version:message-id:date:subject:in-reply-to:references:cc:to :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OYe9Wl3a/I3/YoKNXBIw91cnWSQYgpewA9rkXhlx/Ks=; b=aDZhEuN+bARJ2GIsHDDGeL2anafhCDQ1nvbdSWdGZ+OmOXeejMCtfdxmjbBp2mYk6K x51c9Y1lpHmHV0Jo5bhI0Bs/itSp2FX1H7/Ljc1FXyEGOWfLf06wc5ClCSYkfxVqQcOY sYQFZEMZW+l1wSIvZswuA6CpniWEaot96kRjGgUjAuFct4xwYNZVlLIILMjBQWV8o4QY cZD+dVmmyicFE93GDOb34IBnMtcI+BQVpjXMxRcU9hEEBllsEPcCez68p9kP1FOCO3Rh liQNTZaGtN5OdMrUaU3sWPbEjhRLTcQEtCGPwqHuXyIrVSdreUtqxcS+5xYvvAvILsZQ q/dg== X-Forwarded-Encrypted: i=1; AJvYcCV24Aso9FNlSrgXfrTHHj/9V8fJ9lnCgoKo9uDG4ZmKDrFwwCbGEoPPrXMiGtwxKDbbt+Q+uuCwW5DS/os=@vger.kernel.org X-Gm-Message-State: AOJu0YzKIYPBMezZwJXhZo3q6fRzWmWW2HYbpV2D804vo3nPwFy4FEPm hkaoP2DOupmw5Mj3HSrw7lPQCtDQGKlWsT4k7TdR+mth4XvXCbZ/eZo5aYsbpMeP1O/Mb7Y3XRz n8TNy X-Gm-Gg: AZuq6aIxP6DGycXLnZFxVIGP3hG1fm9xa/MhqB7uSXNyUufSroQsPnNbKEgn/es2FAX GuATAF/5N4RYDS3AVe3dkcckpn/AQAIhYR/DykHfAKF/VGaq3I9TGdOhKtLWb0myQfboK/199EH y8VU5JC2zpPY+31Smb/DGF8gNgb5LnlWr/rbyeIbRK/rBim+GnQqqLz3dAs0/gk+03D264HpFlw c9V9L/sQnBDe20KllrhD961ZpbAphyNw4MWukp5gCGfw5XGsYEPKgprFKRnXgI29+Jm7FVwW9de EmDFhk2QcDW1TNZaCLxfUSOFQTFI5JrAf3ftnC/jq/kyUg52L8ZaUehxs1Cb+ATLhwrJTrhPj5u GMQVXOGC8JFevmsx/Lwfns9k1Lsl5PoREadaGcldU0YaZEw6wxeUqL3g2ZKdavuGKWAHzGlBfnO uPqby8QVuDaF2fAUzt5mduo+skiKH8oGB21MTRQGMeNXLDYzvfJb621zU= X-Received: by 2002:a17:902:f645:b0:2a0:8f6f:1a12 with SMTP id d9443c01a7336-2a8d96a2885mr94079605ad.17.1769965998495; Sun, 01 Feb 2026 09:13:18 -0800 (PST) Received: from DougS18 (s66-183-142-209.bc.hsia.telus.net. [66.183.142.209]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a88b5d9a7bsm125627035ad.79.2026.02.01.09.13.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Feb 2026 09:13:17 -0800 (PST) From: "Doug Smythies" To: "'Peter Zijlstra'" Cc: , , , , , , , , , , , , "Doug Smythies" , References: <20260130093439.803225718@infradead.org> In-Reply-To: <20260130093439.803225718@infradead.org> Subject: RE: [PATCH 0/4] sched: Various reweight_entity() fixes Date: Sun, 1 Feb 2026 09:13:18 -0800 Message-ID: <000d01dc939e$0fc99fe0$2f5cdfa0$@telus.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-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQK5IwR5loYZhW90rhLC3Nnzvp6wgLO058JQ Content-Language: en-ca Hi Peter, Thank you for including me on this set of emails. I assume I was copied on this patch set because I reported an issue a year ago, and I see patch 4 of 4 reverts the fix from that time. I also note that there is a pending update to patch 4 of 4. I will re-test then. On 2026.01.30 01:35 Peter Zijlstra wrote: > Two issues related to reweight_entity() were raised; poking at all that got me > these patches. > > They're in queue.git/sched/core Thanks. I tried to apply them to kernel 6.19-rc5, but patch 3 of 4 would not apply. It took me awhile to figure out what you meant but got there in the end. > and I spend most of yesterday staring at traces > trying to find anything wrong. So far, so good. > > Please test. Happy to. There were 2 issues raised a year ago: One was extremely long CPU migration times under specific conditions, thousands of times longer than reasonable; The second was similar, but much much less in magnitude. The second issue was hidden by the first but became apparent once the first was fixed. For more background, readers are referred to the long email thread [1]. Testing of this patch set: For those that don't want to read: Summary: all good. The main diagnostic tool used here is turbostat, where the issues are shown via anomalies in the time between samples. The test setup is an otherwise very idle system with a 100.0% load applied. Command used: sudo turbostat --quiet --Summary --show Busy%,Bzy_MHz,IRQ,PkgWatt,PkgTmp,TSC_MHz,Time_Of_Day_Seconds,usec --interval 1 --out /dev/shm/turbo.log The data is post processed and a histogram of the times between samples is created. 1 millisecond per histogram bin. Step 1: Confirm where we left off a year ago: The exact same kernel from a year ago, that we ended up happy with, was used. doug@s19:~/tmp/peterz/6.19/turbo$ cat 613.his Kernel: 6.13.0-stock gov: powersave HWP: enabled 1.000000, 23195 1.001000, 10897 1.002000, 49 1.003000, 23 1.004000, 21 1.005000, 9 Total: 34194 : Total >= 10 mSec: 0 ( 0.00 percent) So, over 9 hours and never a nominal sample time exceeded by over 5 milliseconds. Very good. Step 2: Take a baseline sample before this patch set: Mainline kernel 6.19-rc1 was used: doug@s19:~/tmp/peterz/6.19/turbo$ cat rc1.his Kernel: 6.19.0-rc1-stock gov: powersave HWP: enabled 1.000000, 19509 1.001000, 10430 1.002000, 32 1.003000, 19 1.004000, 24 1.005000, 13 1.006000, 9 1.007000, 4 1.008000, 3 1.009000, 4 1.010000, 6 1.011000, 2 1.012000, 1 1.013000, 4 1.014000, 10 1.015000, 10 1.016000, 7 1.017000, 10 1.018000, 20 1.019000, 12 1.020000, 5 1.021000, 3 1.022000, 1 1.023000, 2 1.024000, 2 <<< Clamped. Actually 26 and 25 milliseconds Total: 30142 : Total >= 10 mSec: 95 ( 0.32 percent) What!!! Over 8 hours. It seems something has regressed over the last year. Our threshold of 10 milliseconds was rather arbitrary. Step 3: This patch set and from Peter's git tree: doug@s19:~/tmp/peterz/6.19/turbo$ cat 02.his kernel: 6.19.0-rc1-pz gov: powersave HWP: enabled 1.000000, 19139 1.001000, 9532 1.002000, 19 1.003000, 17 1.004000, 8 1.005000, 3 1.006000, 2 1.009000, 1 Total: 28721 : Total >= 10 mSec: 0 ( 0.00 percent) Just about 8 hours. Never a time >= our arbitrary threshold of 10 milliseconds. So, good. I will redo this test with the revised patch 4 of 4 when it is available. ... Doug [1] https://lore.kernel.org/lkml/005f01db5a44$3bb698e0$b323caa0$@telus.net/