From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from terminus.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 DD5FE36CDF3 for ; Sat, 20 Jun 2026 20:02:33 +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=1781985755; cv=none; b=Jk4wvFNCVpgsgLhMavbAErgNBTBUIWFGlQ0IlU4oJ5kl3DKmBV2Qxlmke6mOMUPiSeKrVaxyXqvGe4WOz/YssS3JZwJqTgWQpxC+MzZ3ci2ClUcRGX4hjklO9TTaTN12AeBE6AH3muHkzGGSxNJHxW1NBSyz4brOgsSfPGlpSSU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781985755; c=relaxed/simple; bh=Cu3RGYF8fIEwodGImGquWFb+TEK6qlYmN5hHQf4ahMU=; h=Date:From:To:CC:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type; b=Xt3TQpcvNVyoJ55OOpGnqrayPyi95c60h/lsNsXnBO9T85DpNQRHFXDKVEf595WHNwBkJeL4UVX3IYlD2tyLLQo1vckYKHt/YIXxJ4uJjrA+i4QM9Av1oOT+JFRE7Eug71gsKqeZC1KEGySa+RYijKZskKIcUS49POQ8ygRBeTQ= 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=fail (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b=U+QJTToy reason="signature verification failed"; 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=fail reason="signature verification failed" (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b="U+QJTToy" Received: from ehlo.thunderbird.net (c-76-133-66-138.hsd1.ca.comcast.net [76.133.66.138]) (authenticated bits=0) by mail.zytor.com (8.18.1/8.17.1) with ESMTPSA id 65KJiRpM4043891 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Sat, 20 Jun 2026 12:44:28 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 65KJiRpM4043891 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2026052701; t=1781984669; bh=Eh93y9QYeEKYaxcfZCFWA2VWHbjvj1JFAamA5gqPidc=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=U+QJTToySHC7PwugsabxiEHP3EyjE6Z2LC8IA5sHlAXpdvWENtT7kHZ4D8iJN4ESU fRKFaFAZpAs+U3C8aHpfoFwZzfCFPSf/3sAAVkSAn6W8KsUFVLMjHgxPNyI3aHLOsG a17BAUt3Ixm46XTRSRtAVpOBEQ90PGaPziHCadUaSINjrvZLH8Q93bbZ5oDfN9AMKE hnxE5Lm+v7HZ5oLpVG8Dw1XkZMkQRpMMOcr64EaTeiJv9P4m8b37kHS/R44/fLzrm6 nZk1mJunUSIkVhjwfIAbCpnTFzAlgf0typda9rZFlHkqak5O1TRdMPrD/wGw6nlHlD gqisJ+OeHjJLw== Date: Sat, 20 Jun 2026 12:44:21 -0700 From: "H. Peter Anvin" To: "Zach O'Keefe" , Thomas Gleixner CC: Dave Hansen , David Stevens , Pasha Tatashin , Linus Walleij , Will Deacon , Quentin Perret , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Andy Lutomirski , Xin Li , Peter Zijlstra , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Uladzislau Rezki , Kees Cook , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2 00/13] Dynamic Kernel Stacks User-Agent: K-9 Mail for Android In-Reply-To: References: <20260424191456.2679717-1-stevensd@google.com> <6369e5ce-74e3-4c68-8053-d7d7d21b6955@zytor.com> <87pl1md7h0.ffs@fw13> <87qzm2b39k.ffs@fw13> Message-ID: 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=utf-8 Content-Transfer-Encoding: quoted-printable On June 20, 2026 12:33:35 PM PDT, Zach O'Keefe wrote= : >On Fri, Jun 19, 2026 at 2:59=E2=80=AFPM Thomas Gleixner wrote: > >Thomas, thanks again for taking the time to look into this and help out= =2E > >> Zach! >> >> On Fri, Jun 19 2026 at 12:20, Zach O'Keefe wrote: >> > While it seems common opinion that the IST-based solution is fragile, >> > what of FRED? It seems like this is exactly the kind of support neede= d >> > to avoid some of the aforementioned sw "mess" in various x86 exceptio= n >> > handling paths=2E I agree that it's less-than-ideal that we are force= d >> > to downgrade exception levels in the common #PF case, but is that an >> > unsurmountable problem? Pardon my ignorance=2E >> >> The #PF path is considered perfomance critical=2E But how much the >> downgrade matters needs actual numbers to analyze under various workloa= d >> scenarios=2E > >Ya, that's my concern as well, as I don't have a good intuition for >how perf critical kernel #PF is for real workloads=2E If this is your >primary concern, I'll take that as a _good_ thing ; i=2Ee=2E there's >nothing architecturally stopping us from doing this downgrade safely=2E >We'll still need the analysis, but that can be a later stage -- we're >more than happy to get this data for all=2E > >> I've not seen numbers to that effect anywhere=2E The only numbers provi= ded >> are marketing material about the memory savings on a freshly booted idl= e >> machine=2E There are _zero_ numbers about the actual real world savings= , >> but claims about the PETABYTE savings possible=2E >> >> Seriously? > >This is actually the most understood aspect=2E With O(100B) active tasks >fleetwide at any point, it only takes an average savings of O(10KiB) >per task to get to 1PiB=2E At least for our fleet, we know the % of >tasks that use only 4KiB, 8KiB, or require the full 16KiB, and the >math confirms that we expect O(PiB) aggregate savings=2E The % of stacks >requiring the full 16KiB is minuscule, but it still occurs at a rate >higher than what we can tolerate for SO panics=2E Given the vast >majority of stacks never exceed the first 4KiB, this enables the >significant opportunity=2E > >> > Lastly, I just want to clarify what folks have meant by "extraordinar= y >> > claims" or "evidence"=2E Aside from the above discussion on FRED >> > exception handling, the "only" other part of this is the allocation= =2E >> >> Clearly anything which is explained with "shouldn't happen" and >> "unlikely"=2E At cloud scale nothing is unlikely anymore=2E That's simp= ly the >> reality of statistical math=2E >> >> As I pointed out before the same applies to the unexplained >> upgrade/downgrade game with external interrupts=2E Such issues cannot b= e >> papered over without understanding the root cause as from decades long >> experience they come inevitably back some time down the road=2E Cloud >> scale even guarantees that=2E >> >> > Are people concerned about memory unavailability, deadlocking-type >> > issues, or something else? We have considerable design freedom here t= o >> > avoid certain classes of unreliability, but=E2=80=94barring any cleve= r >> > tricks=E2=80=94I don't know if the allocation can be guaranteed to su= cceed in >> > all conceivable circumstances=2E I want to ensure that reality does n= ot >> > present a hard blocker=2E >> >> First of all the failure scenario has to be clearly defined=2E >> >> Right now, if I'm reading the patches correctly this simply can end up >> killing the wrong tasks/processes just because an OOM situation results >> in a depletion of the per CPU cache and the very wrong task which runs >> into the deep call stack situation ends up in the creek without a paddl= e=2E >> >> Given that you even fail to abort a CPU bringup when the allocation of >> the per CPU stack page cache fails, makes it pretty clear that there ha= s >> been spent exactly zero thoughts about this problem=2E >> >> Why the heck does this cache refill call have to be unconditionally in >> __schedule() where preemption is disabled and therefore GFP_ATOMIC >> is mandatory? I know "Works for me" (most of the time)=2E >> >> And just because I was looking at the patch in question I found this >> other insanity: >> >> > + /* >> > + * Most likely we faulted in the page right next to the last ma= pped >> > + * page in the stack, however, it is possible (but very unlikel= y) that >> > + * the faulted page is actually skips some pages in the stack= =2E Make sure >> > + * we do not create more than one holes in the stack, and map = every >> > + * page between the current fault address and the last page th= at is >> > + * mapped in the stack=2E >> > + */ >> >> Can anyone with a sane mind and the most minimal understanding of the >> kernel's inner working explain to me how the kernel can skip "some >> pages" on the stack? >> >> If the kernel skips a whole page or more then there is a serious bug >> somewhere=2E I might be missing something, but again the "very unlikely= " >> wording which handwaves about it is just disgustingly useless=2E >> >> I disagree with Dave on the RFC status of this series=2E It's not even >> close to RFC, it's at PoC status=2E > >Absolutely understood=2E I'm more interested in constructively working >together (as we can see, we'll need your help) to figure out how the >x86 experts want to approach this vs discussing _this_ series=2E Perhaps >it was my mistake to necro this thread instead of starting a new, >general discussion=2E Appologies=2E > >To that end, how would you like to proceed? You may understand the x86 >complexities better than anyone, so hopefully you can guide this in >the right direction=2E How would you like us to approach this? > >Thanks again for your time, help, and support, >Zach > > >> Thanks, >> >> tglx >> >> >> >> >> >> >> > 1 PiB for a fleet only makes sense in the context of the size of that flee= t=2E=20 But it's more than that=2E=20 You WILL slow down the general case by this stuff, and so how much actual = gain does this imply? What is the mark needed to even get to a break-even p= oint?=20 To be honest, this and the multikernel proposal are the worst motivated ma= ssive changes for no demonstrated value I have seen in a very, very long ti= me=2E