From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 2293C21FF44 for ; Thu, 4 Sep 2025 21:31:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757021502; cv=none; b=ElITA0UAWl0w5bh1t1sFVDw5qV6bD/GivSvCLmdL7kw+NcD6juAgeUCYCLIvKJ3mJc3P9El1hSUa0IUjsHdNgoXPsIUxa9O+LqFVN2SerKk2XTzu+WvOMgCkL1iW5MjHVcSA80PctqJpzbDTNoxAp+ph1cQ2CIH84RPMarpHfxE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757021502; c=relaxed/simple; bh=X6LW2z4rIHXnyHPqJYA2fPIy/IMEEZxyfyveG1alPvw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=UW9fEUimzxJT3IOvoX3fvxCu+cHS/mJj7FTFw9uCpz/CeNgrjsReWCvuGZ/itb0GPHz7FvbrTyi5jCs++wYfwcYJvvOGfCIjZTQVjR/wyd7ykdlufKsgaVAiNkIMfDr3+ukrGeMT5MyZHFte3GUA9XyL4SsC5l4EMBrC9Z/KIIo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=mxrBSiCf; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ScDE3p/Z; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="mxrBSiCf"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ScDE3p/Z" From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1757021497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PkPLqHlNHIOzdPNXBNA5/AITal0+0nC6rlhB7IKQDeE=; b=mxrBSiCf5SeteuQifmQvJthwM/s9uzXKgV+kls4Prk6ViCMmSlBgcSe84aWaBWeQGVEh1E q7sepVWTIboT1ylqqeamt4AQSRDARWe9b2TLsJBD3Js4SQF9fbIuxI/mX9sEUseqPqjvcn ztES9WkKHVGlssILnaws1Nhkng2okJAZoiQKDvT0fK7RdDsvSiB0cVn0dfu+kuSZMfPR5g JRHhzhGMNzI0ycpcJW4AWY8+NUKDW5Yp/redQa/OY2fxn7YsxqiIJ+6NnUTuxfeYRQB2S9 6K1j668scvVippRQYZPJ9CFFl9shBWKTNLfLxGEP36L8RSsdCqq6NyUuMwRK4w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1757021497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PkPLqHlNHIOzdPNXBNA5/AITal0+0nC6rlhB7IKQDeE=; b=ScDE3p/ZGl54jyocd1pfbD3GwmU9jdDjc64eRPIAMdm1mwcwxeAICGWnZSLyhKHCUbgQpK 597ECWZD3/5n6rDg== To: Mathieu Desnoyers , LKML Cc: Jens Axboe , Peter Zijlstra , "Paul E. McKenney" , Boqun Feng , Paolo Bonzini , Sean Christopherson , Wei Liu , Dexuan Cui , x86@kernel.org, Arnd Bergmann , Heiko Carstens , Christian Borntraeger , Sven Schnelle , Huacai Chen , Paul Walmsley , Palmer Dabbelt Subject: Re: [patch V2 28/37] rseq: Switch to fast path processing on exit to user In-Reply-To: References: <20250823161326.635281786@linutronix.de> <20250823161655.063205235@linutronix.de> <02e74cef-f2fe-4590-8921-ef4df2b24786@efficios.com> <87iki0zooo.ffs@tglx> Date: Thu, 04 Sep 2025 23:31:36 +0200 Message-ID: <877bydykef.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Thu, Sep 04 2025 at 13:54, Mathieu Desnoyers wrote: > On 2025-09-02 14:36, Thomas Gleixner wrote: > > All that being said, I'm perfectly fine with your improvements, but > I just want to clarify what should be considered as relevant metrics > that justify future optimization efforts and orient future optimization > vs code complexity trade offs. I understand that. Though my main objective was to optimize for the 'nothing to see here' case, which is hit both in a kernel compile and also in the stress test suite as the numbers show. I definitely was not optizing for the actual handling of critical sections in the first place. That this turned out to be slightly more efficient is mostly a byproduct of the main goal as I just integrated stuff more tightly. So the actual benchmark code which will only rarely hit that path is not that interesting. I ran the benchmark script out of curiosity nevertheless. Here you go: Before: 27.883787661 seconds time elapsed 2983.093796000 seconds user 4.227902000 seconds sys After: 27.908213568 seconds time elapsed 2994.785114000 seconds user 2.555690000 seconds sys The times have quite some variance across multiple runs on both kernels, but the trend of spending significantly less kernel cycles is very consistent. Thanks, tglx