From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 33CB63D75CE for ; Mon, 4 May 2026 13:16:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777900616; cv=none; b=jmfU1ahsTATGsD+J9OaL82keYdtqsBKGGo1UP4NUq8n27c/cGZOCdhfRYo1EjVhtSVwK/ePLexvuugDa2U384+iKYkdZQrRJKrbe2KbDLvTzZBqT8YScdaRf+14IEnf9aJBgEh2FXvvSDHfyxbeORmkUz+13UQ6nLeSXzijEjtU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777900616; c=relaxed/simple; bh=YehdXBIlEUF0AbBFTqx594oqr3EKIo/VjN2nAwur/rk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iKUp42iojU+I6fN6h4o7hZPYQOklYxYA5NgFbYJEu/ZLGx5cHDl4XvV5d/PaRaUZx+ZAPG9wRNlooGLFqMFk/3P89njGmVPMVsrF4aMG64gxkmjh17NDCDZCAwbZDV4NS6K8f6JM2GPGFZUswDJXhtLiILevxvclP1qUdgtmL4U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=hTrVUos9; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="hTrVUos9" Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 643NKnmD2735981; Mon, 4 May 2026 13:16:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=pp1; bh=kZinLeeEhL9KCMNi4oA2aGMsvHzpRD YlFWlmkwZHVRg=; b=hTrVUos95VSK1KAH1i+UjlAM/d4aPmqR5mXf/+xXfcOwzK IZE9/EuVTi0JaGuq2QY8WetHLwiiCZUKESk+W7vSanknHfsY5jdfrcS0jrfI0sLn FwIjv4BsEjSBbh1apub0m8eIdOWwPCRPpwTmMduda+i+peHUebOCA0/Tld+8Imw7 dJrdSdE8+LuDYG4I2zJc7o2m3f8Lvwqlgvjs8myOGypHa6yUrdVTEPONsGH3mcr5 S9uGYyRn5v6H39hSX4I2l5W9GNSSCJtXcFOxTIgBp24kSUgYqpdkDyItrmzZsVIz CFuy8kK7LcUKVS6DvnkOtN+pcHH7dqwXZ7cj44IQ== Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4dw9y173pv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 04 May 2026 13:16:17 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 644D9TPM026385; Mon, 4 May 2026 13:16:16 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4dwuyvwbc5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 04 May 2026 13:16:16 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 644DGBYc46334374 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 4 May 2026 13:16:11 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CB2ED20043; Mon, 4 May 2026 13:16:11 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C915F20040; Mon, 4 May 2026 13:16:10 +0000 (GMT) Received: from osiris (unknown [9.111.26.32]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTPS; Mon, 4 May 2026 13:16:10 +0000 (GMT) Date: Mon, 4 May 2026 15:16:09 +0200 From: Heiko Carstens To: Peter Zijlstra Cc: K Prateek Nayak , Zhan Xusheng , Ingo Molnar , Vincent Guittot , Juri Lelli , linux-kernel@vger.kernel.org, Zhan Xusheng , Dietmar Eggemann , Valentin Schneider , Ben Segall , Steven Rostedt , Mel Gorman , gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, maddy@linux.ibm.com, mpe@ellerman.id.au, chleroy@kernel.org, Stefan Schulze Frielinghaus , Juergen Christ Subject: Re: [PATCH RESEND] sched/fair: Fix overflow in vruntime_eligible() Message-ID: <20260504131609.132896A0b-hca@linux.ibm.com> References: <20260415145742.10359-1-zhanxusheng@xiaomi.com> <20260428144951.121765-1-zhanxusheng@xiaomi.com> <57e94d7e-b8fb-49bc-a914-8a7401e43af3@amd.com> <20260428173521.GK3126523@noisy.programming.kicks-ass.net> <4870ea19-78d4-44b2-9f18-14c3f8782726@amd.com> <20260501104006.GA3102624@noisy.programming.kicks-ass.net> <20260504112239.GA1174357@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: <20260504112239.GA1174357@noisy.programming.kicks-ass.net> X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Proofpoint-ORIG-GUID: LYJbCvm0qiy685wgUra9hxyc7WoFhFzd X-Proofpoint-GUID: ylY6YP2opt2TDzkrm7b8PoQBCukf4qNu X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTA0MDEzOSBTYWx0ZWRfX+R9/UGl6hXw0 l3uZ0m6wdx0+vrGLmB1mJtM5PTBCUGopdoPUTeZjaXr9XuuYhd4JiekaimP+aomvR7Rr0zmCoUz f2NTgyqFyBLjBt4nLymSwlvzinvM4FdomZ1Xi50Y4j0EJGbwGYuQar4i8LYgwuexwujSqfAmRqb 0hsEsuPsXOFAeBiKTE10o7PZOCed6VGVezdEh0BvS4jyCw5pCWqsNyOYhg1kep6RnSgBWXFqNil fNkiSbX8CYucjkOavoTLgGYxrESiVFL+8aBsJ8G40zE10TjUMDsG2WV7dTiYWQM95YM/vfKtn+j c42scQxhT/2nk/835iBM0MtclmWKTv/d9AdkQFDXJwOOvssCYXih30TmumOvcIg70YpeJVFrfCw WywSOMynemYXGjNs3n7TmC05LWSM0uOt9mP8W/w879s98jNWY/dU6nSJ09K0yW+R0JDbjaGiyRJ QVTE6QPu0WlzqzuHO+g== X-Authority-Analysis: v=2.4 cv=UbFhjqSN c=1 sm=1 tr=0 ts=69f89c22 cx=c_pps a=5BHTudwdYE3Te8bg5FgnPg==:117 a=5BHTudwdYE3Te8bg5FgnPg==:17 a=kj9zAlcOel0A:10 a=NGcC8JguVDcA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=U7nrCbtTmkRpXpFmAIza:22 a=lU43AcLytWLOjv-zRboA:9 a=CjuIK1q_8ugA:10 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-04_04,2026-04-30_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 spamscore=0 lowpriorityscore=0 malwarescore=0 suspectscore=0 adultscore=0 priorityscore=1501 bulkscore=0 phishscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2605040139 On Mon, May 04, 2026 at 01:22:39PM +0200, Peter Zijlstra wrote: > On Fri, May 01, 2026 at 12:40:06PM +0200, Peter Zijlstra wrote: > > > Anyway, I had a poke around with godbolt, and the below seems to > > generate the best code for things like x86_64 and arm64. > > > > Specifically, the __builtin_mul_overflow() already has to compute the > > 128 bit product anyway for most architectures, so using that directly > > then leads to saner asm and easier to understand code. > > > > AFAICT HPPA64 is the only 64bit architecture that doesn't implement > > __int128 and will thus be demoted to doing what we do on 32bit. > > I forgot we had ARCH_SUPPORTS_INT128, and I suppose this had better > check that. Now, s390 is a bit weird and excludes GCC even though that > definitely supports __int128. Supposedly there was a issue, but perhaps > modern GCC has this fixed? The reason was not a bug (in terms of incorrect code), but gcc generated a larger than 6kb stack frame for one of the crypto functions - see commit fbac266f095d ("s390: select ARCH_SUPPORTS_INT128"). That's just too large to be acceptable. If I remember correctly gcc generated code which did not reuse known to be unused stack slots, but created for every variable a new stack slot, for whatever reason. Which then resulted in such a huge stack frame. With clang the stack frame size was only 1,5kb. I just checked: with gcc 15.2.0 we are down to 4.5kb. Still too large :) Adding s390 compiler folks; but I seem to remember I discussed that back then with them.