On Mon, Mar 11 2024 at 19:10, Pasha Tatashin wrote: > On Mon, Mar 11, 2024 at 6:17 PM Andy Lutomirski <luto@xxxxxxxxxx> wrote: >> Also, I think the whole memory allocation concept in this whole >> series is a bit odd. Fundamentally, we *can't* block on these stack >> faults -- we may be in a context where blocking will deadlock. We >> may be in the page allocator. Panicing due to kernel stack >> allocation would be very unpleasant. > > We never block during handling stack faults. There's a per-CPU page > pool, guaranteeing availability for the faulting thread. The thread > simply takes pages from this per-CPU data structure and refills the > pool when leaving the CPU. The faulting routine is efficient, > requiring a fixed number of loads without any locks, stalling, or even > cmpxchg operations. Is this true for any context including nested exceptions and #NMI? Thanks, tglx