From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.zytor.com (terminus.zytor.com [198.137.202.136]) (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 44C782E03E4 for ; Fri, 19 Jun 2026 04:33:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.136 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781843608; cv=none; b=T9Fbv7gZg8x+qVrPJXH8kbITVMokH+rWLKlS/ohUYY7ZxtRqnXxKrnZSiXOGY9eyEp+oYYn7O+v9nyoXquhYRzzPbb9uEodQf8/1yLI8JGiOaxVbe7d80tNLZFYDLA1hLxUVfvsNu+04RCJTruhdWh+vmPMQBLfItgDbpcofSh0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781843608; c=relaxed/simple; bh=odlK80lEt8nJ7ac7HZrQ/I6WCwYGdm0T9vTY+VledBE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=k13n+5hxzmoe6W2BWBmYcnvN5gLIgpcTTB87poOSMLj/87ZYv8xbe6yv77MQ4vdybRPLXh95BUDNujZvgFdh5WYlKEdX9Kd9x35gh8T9+yiA+ETR8L+Q8rzFYFzlhtCusGX2WKKUiwFEzPhNKr3SFr2CwRGkL1koNs+6XBIAf28= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com; spf=pass smtp.mailfrom=zytor.com; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b=QfO+JcT6; arc=none smtp.client-ip=198.137.202.136 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zytor.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b="QfO+JcT6" Received: from [10.124.222.146] ([192.55.55.46]) (authenticated bits=0) by mail.zytor.com (8.18.1/8.17.1) with ESMTPSA id 65J4W2JK282278 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Thu, 18 Jun 2026 21:32:37 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 65J4W2JK282278 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2026052701; t=1781843558; bh=xHJzJ7LGSFJc/BuOIlluSyV6tEeU0Lu3lgaIJsx/fN4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=QfO+JcT6sFCIRVNHW23/BrEr9BhJrIarXutroTqTNuHRxyvh64OYtsit4XoQJiOIe Gfms68NYsH6hJM8v6Pfrap0xen9HM0rDDIdpFO13zB//hokPJHnPh+NZTVWa1fMlVn yYdlyjw0t2VKqOIlwMrVf+Kgg9s6eupmFjtqC+bIPrTWeQha/bqLOWsmbn6dNaDCW4 Mjl6Q/kFPvX63nD+O9Vu1r3rE7f4yc5FihAVdDFcmE0rJuMT8BZcu0bauf59HbGSbI 2rJQ8xa3WH8cxbPS7oW60Gv5peKyR4QNS4CBCzv0hpv5SL7PXmBJVn+SJndtSbTeuS hLAoZscO3R5bw== Message-ID: <0b6889d3-173b-4143-a4a2-76630482959a@zytor.com> Date: Thu, 18 Jun 2026 21:32:29 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: 8aeb879baf12 - significant system call latency regression, bisected To: Linus Torvalds Cc: Peter Zijlstra , tglx@kernel.org, mingo@redhat.com, bp@alien8.de, Nathan Chancellor , Calvin Owens , Dave Hansen , x86-ML , LKML References: <20260613085919.GF42921@noisy.programming.kicks-ass.net> <203E61B7-290F-4F87-860F-B352D0072703@zytor.com> <20260616082814.GQ48970@noisy.programming.kicks-ass.net> <20260617123718.GM49951@noisy.programming.kicks-ass.net> <9ae04c80-d1e2-44f0-bca2-d0889c61b45f@zytor.com> <13791ee3-f699-444a-ae1b-a18c2c281f67@zytor.com> Content-Language: en-US, sv-SE From: "H. Peter Anvin" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2026-06-18 19:11, Linus Torvalds wrote: > On Thu, 18 Jun 2026 at 19:08, Linus Torvalds > wrote: >> >> Considering that your load should all be hot-cache anyway, maybe the >> problem was never the alignment - which, if the load really is in the >> cache, shouldn't matter that much anyway, and certainly not 90 cycles >> worth. > > Ahh, your numbers said 80 cycles, not 90, I mis-remembered. > > Still - same thing. 80 or 90 cycles is not a "L2 miss". That really > smells like a "front end flush" kind of number where you have started > lots of work and are throwing it all away to restart it. > Well, I'll be darned. It's not system call dispatch that's at fault, at all. It was a complete red herring. I got misled because of how reproducible it was. The patch affected the RCU mechanics inside getppid -> __task_pid_nr_ns. I can't think of any reason that would have happened other than alignment, but that shouldn't be an important code path either way. I have been using getppid() as a standard "trivial system call" for microbenchmarking for so long that it never occurred to question it, but it *does* depend on RCU, and it definitely stood out in the profiles. Switching to __NR__sysctl -> sys_ni_syscall() instead shows that 7.1 is actually slightly better (by a few cycles) than 7.0, which also matches what Tony Luck has seen on IDT. I tested Peter Z's patch as well; it added a few cycles over 7.1 baseline, but I think it can be used as a base for improvements (I spotted a couple of possibilities already, like it calling instrumentation_begin..._end twice.) Either way, I apologize for the false alarm. Now returning to your regularly scheduled kernel hacking... -hpa