From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 3E3253D47D4 for ; Wed, 15 Apr 2026 08:52:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776243130; cv=none; b=m9eTG3Pu1F98fuQYVZX79ePpRF+Zxmbp3BNEEGstpj3zy9owdSjyLaLE4/kByEM4K1F+Doe3JEeprVONV46bTZWx2fLVD+Q1nQL8q7M4aIW8KDG7KCxxWQkgCFeZioXKPYDoRVR8TBZIW3beOzaIXmAx8gmYgIkY0HymmlDMc0c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776243130; c=relaxed/simple; bh=1Ab5tm9j3bkies6MeXKwKTkAr90Jigd6jdFwYRCednM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZZkY5mN/JOMQm4yde35ChwTbC5ldaDvc+FAedsosxlqDnl2Mv/VG7uxNojT3ZVapZtFVSfMJwBrIIO/ARfRZOn8yT/pn0y0D/V8DhcsE8oibQNCgeqHHnvC/zr6Kyk4//4+YX7y5xWGT/2cb0lL18FnqZ6BSAY3ZCIfPN3aEtrU= 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=rpRlstrd; arc=none smtp.client-ip=148.163.158.5 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="rpRlstrd" Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63F1v11S1733142; Wed, 15 Apr 2026 08:51:39 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=Sa7WJb81jYCEO12QOjr+tsMyiLWt6m ijA71q6MF1yVY=; b=rpRlstrdxrJf5o8G9B7dn+HyI+Qslsc99yzt9y2nHhwNu7 ZR3j6pQeE8wSNCHMglu/yBJK9LmKpSbVh/PSINXH3OK2L+f1epDaTJEmmuFEypMG 4M5pXBAZ+/d4eJjXyPAb6E16r9o0+WNVuimNnWmQ8LFcIGQpWQrk0P8TAJhesA3Z QVp4ClkxRh9xCINSph7xpmgmMNkLcc0UzELabtv03wmKop1IBwbNTmGEHos+/NZt XiyTtEgjcWEtFUpqVEWqc4lcKL47Po70uQ3Hqx0cVsx6TAoVsBifAZ/uPMow6RBF KV/ID+L5sSVIqwcokmr0e5BT/Dq0OEZWQHNrRvGg== Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4dh89m6qj5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Apr 2026 08:51:39 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 63F7GiTU015164; Wed, 15 Apr 2026 08:51:38 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 4dg0msnjcn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Apr 2026 08:51:38 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 63F8pYB043844062 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Apr 2026 08:51:35 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E56E420043; Wed, 15 Apr 2026 08:51:33 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C0EF52004D; Wed, 15 Apr 2026 08:51:33 +0000 (GMT) Received: from osiris (unknown [9.52.214.206]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTPS; Wed, 15 Apr 2026 08:51:33 +0000 (GMT) Date: Wed, 15 Apr 2026 10:51:31 +0200 From: Heiko Carstens To: Shrikanth Hegde Cc: Peter Zijlstra , linux-kernel@vger.kernel.org, Thomas Gleixner , mathieu.desnoyers@efficios.com, Mark Rutland , cmarinas@kernel.org, maddy@linux.ibm.com, ryan.roberts@arm.com Subject: Re: [RFC] in-kernel rseq Message-ID: <20260415085131.10321Abf-hca@linux.ibm.com> References: <20260223163843.GR1282955@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: X-TM-AS-GCONF: 00 X-Authority-Analysis: v=2.4 cv=I/dVgtgg c=1 sm=1 tr=0 ts=69df519b cx=c_pps a=bLidbwmWQ0KltjZqbj+ezA==:117 a=bLidbwmWQ0KltjZqbj+ezA==:17 a=kj9zAlcOel0A:10 a=A5OVakUREuEA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=V8glGbnc2Ofi9Qvn3v5h:22 a=g-W3yrxr4ZpDywaP1sUA:9 a=CjuIK1q_8ugA:10 X-Proofpoint-GUID: MUpNU09llw51f0cbPIUOsG_OCo3EohmG X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDE1MDA4MCBTYWx0ZWRfXyhQQtHueKtbF sV9OgDFZN6T3lpRA64HbATd8ZPHlb0WvhCw+c7VxGmwEsOAsSk4fV+g92bYpwhqYPzmjcgWqJfS rBbTOonEJCSVGxbGs9oLH6jfHLFXWhNu1yZ8GJ5aHK9Aw7Jzattw8dvvPWtt/iiDMEKGK4OarVt kGKn1Kg/0PPywToTwYhl135BDwztu/ZRMhSKqd9aAbBq79B7QvdYAnwLovMnMx4TpaF0117EVAM BKEbdB9WMiUnHnth7CHtRII9EmRXdpZPLYCx47aFb1z+TcwY0jM91Ax31Ebrw5VBeIZ6Dg1nyMv xSv6Nescrb3B+5rOhnuaXY4TRmkdSiIunrWX/tFQrTKk51h/fKKfBimU7oO4gbG0k1lB5mpEy4/ j9BK9VTDkNPtENq4Y8PS6XccS3LaCDqRKRgLkEUSvbnzVuBHtQISuSmlW/F80bXbHw49z1ZiY1I 2TWrIPga5c3pE2y7/gA== X-Proofpoint-ORIG-GUID: MUpNU09llw51f0cbPIUOsG_OCo3EohmG 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-04-14_04,2026-04-13_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 clxscore=1015 adultscore=0 lowpriorityscore=0 suspectscore=0 impostorscore=0 phishscore=0 spamscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604070000 definitions=main-2604150080 On Fri, Apr 10, 2026 at 11:27:50PM +0530, Shrikanth Hegde wrote: > Hi Peter, > > On 2/23/26 10:08 PM, Peter Zijlstra wrote: > > Hi, > > > > It has come to my attention that various people are struggling with > > preempt_disable()+preempt_enable() costs for various architectures. > > > > Mostly in relation to things like this_cpu_ and or local_. > > > > The below is a very crude (and broken, more on that below) POC. > > > > So the 'main' advantage of this over preempt_disable()/preempt_enable(), > > it on the preempt_enable() side, this elides the whole conditional and > > call schedule() nonsense. > > This might be a very stupid question. > > Why not just call preempt_enable_no_resched instead? > > this_cpu operations would have disabled preemption so the per_cpu > structures are protected from thread migration right? intention > here is likely not to call schedule. No? Doing that would make it unpredictable when the kernel is preempted for cases where TIF_PREEMPT is set while within a code section which has preemption disabled and where preemption is enabled again without checking for TIF_PREEMPT.