Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp739236lql; Mon, 11 Mar 2024 16:34:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVnjG4vkqWaFxOlqI/4Zddf0EC6rOEFHIizK1XQ2brGHpdOWxgIANukTZeDuwQpPyrDgXRynXu75Sky0X7qz8bfn3RRFgpv7XasqpAY5Q== X-Google-Smtp-Source: AGHT+IGhbWN9dNP3X50bYclBsiTsCwF5UaoCSWTTTXpQysIlMTinaKN1h+6O0nmlc2Ks6cDTc3v2 X-Received: by 2002:a05:6a20:8048:b0:1a1:44bb:da3f with SMTP id f8-20020a056a20804800b001a144bbda3fmr7202880pza.53.1710200049955; Mon, 11 Mar 2024 16:34:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710200049; cv=pass; d=google.com; s=arc-20160816; b=nOxO1/YdSvdFbNy2o0MyAcqtc/bMrPS0nVdO7DifOnglNraezicJopfMH9BgTAYEGI czESP0Ib8vJE12NzwwwagGIT+lcrtD8aQMe6SZg3TgWfiOvX8FIaAkvXRkdQYFmQOlEX qCEDEGZf+VvomlRTeAzalMRF1HOxisBXpLBrykxommJBEARadsauQ0rJQJHvTwSCfQal 39t4buHHeMUlE0BQTYEaKaL1piprpWZwltRrWq6eOYKCOJPI0Zt01Ff2pu4to5W01jX9 EdG+vtHceHyRR8uintb72KS2zgxnzzUsK9zknH/UDFXZvwMAavpjVcvXKwDmmi7RebTw 67Rg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=MIw7l9VNfGqq4sdtjnnvblmtZxj6z+GMUpQZ0ibxA1g=; fh=tx4trP6MxD2MCgRmHS0JBK7AJ3UfkBgX5ar9FUNeNmQ=; b=oRwaFvP5+3MC8yfG9uh4gWoJ8Laav/A+5hj6S2YVi1S2lSJ14MjV7rfNwZSJdzWtxh BhFn5q48cq/0xx0BE1EHNd/k33j+YrsW+HZPpPJswwTGWHpJ7qd+dk0jY4BbacfhO8uP K4khdnkxcZwDd2+CBbT4xZNpcHcGvRofHIC2B0CNhPAvCQKCSatOvSO0yPLt4gUbgocd UQ7G6OYGLm2hYAUxq85Qkrq4eEGiQWmaFwNbK+tRDBE11ww1QKSvTIR+bH6kEM/KW5Bs 48rSryxNXAS7v+aOJfb+zl4+krymXQNtZzPTUmfDloFb77BwgvypBWod6HJSmZ3g8yrL CGGA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=vS+l3KuH; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-99663-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99663-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t186-20020a625fc3000000b006e635eab42fsi5607870pfb.137.2024.03.11.16.34.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 16:34:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-99663-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=vS+l3KuH; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-99663-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99663-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 91BBE2821E3 for ; Mon, 11 Mar 2024 23:34:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A71DC5914A; Mon, 11 Mar 2024 23:34:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="vS+l3KuH"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="0gFjP9gc" 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 570FA58AC0 for ; Mon, 11 Mar 2024 23:34:01 +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=1710200042; cv=none; b=kwcB65mjmRpxTksZROjJr4d19MJ61Jy2AfAh9WrUXMSbc56hAgVlX4yjZXhLBMUUujYTZV3m91btPNPVyvHYqALiyt5nwpPcycsTZwOP6cnBiNIqAdlSouP9Nab4DeVWMvEVkLyeaqTC9J+BpBQXjiCQRXFJvwnIdqKPNc1X+H0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710200042; c=relaxed/simple; bh=hPCi7ihbEkOSNP09ah/2V2E0qHDA6/vPKx1XuJCvf6s=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=KkmU8FFZDwJgk9QhsrS7ZwjOXY2RVTld36wYvf1annlUAPMaoF8vyQXgP8+84BijvdppbNv86+es66AsORj1A/9komxzuxt+GFKxsij26ft2jUVZexo3dLoByxYa27DGDVH/YNOQr1HZRR3DcK/8I2qJa0DBk0Ug+g9qdEuZQ6g= 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=vS+l3KuH; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=0gFjP9gc; 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 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1710200039; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MIw7l9VNfGqq4sdtjnnvblmtZxj6z+GMUpQZ0ibxA1g=; b=vS+l3KuHzoSjIJCPO78146fytSCTpgzxWZpwCYU0EKZZ6BRtn39CDliyzMHbnSwf/0TunE qF4ufjYpyeAgtYiakoJbJE9MnGRMr1rBRzeET/7jyHHt8yOaui6tx5+mykEGQddq5C/ipr OS/E/sTYB2TB7vItXhDJoe4nhNmS/4SIVM3pPTanCpMe2E468a9cVwPw17E+bwuj9P53Os quyrRc4PM7VKgLi/iSdA3FMb5t2JhxHtMlgFlTcAzaW/dpousjiqYmqIj3Act51yRe+InE ynd6WUwN/T7VPLGAqmpSJ8Bm50EWMOrNrb0XnYuybMHVjwH5OsqaiQPY1NI25w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1710200039; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MIw7l9VNfGqq4sdtjnnvblmtZxj6z+GMUpQZ0ibxA1g=; b=0gFjP9gcUjMNAgXkt9mSb0rnWrsmA2k/IePHaBi5pmWDDtFJiK/evfEKL0E61XQ/7bd2js Nk6xXc8jSkwIigDA== To: Pasha Tatashin , Andy Lutomirski Cc: Linux Kernel Mailing List , linux-mm@kvack.org, Andrew Morton , the arch/x86 maintainers , Borislav Petkov , Christian Brauner , bristot@redhat.com, Ben Segall , Dave Hansen , dianders@chromium.org, dietmar.eggemann@arm.com, eric.devolder@oracle.com, hca@linux.ibm.com, "hch@infradead.org" , "H. Peter Anvin" , Jacob Pan , Jason Gunthorpe , jpoimboe@kernel.org, Joerg Roedel , juri.lelli@redhat.com, Kent Overstreet , kinseyho@google.com, "Kirill A. Shutemov" , lstoakes@gmail.com, mgorman@suse.de, mic@digikod.net, michael.christie@oracle.com, Ingo Molnar , mjguzik@gmail.com, "Michael S. Tsirkin" , Nicholas Piggin , "Peter Zijlstra (Intel)" , Petr Mladek , Rick P Edgecombe , Steven Rostedt , Suren Baghdasaryan , Uladzislau Rezki , vincent.guittot@linaro.org, vschneid@redhat.com Subject: Re: [RFC 11/14] x86: add support for Dynamic Kernel Stacks In-Reply-To: References: <20240311164638.2015063-1-pasha.tatashin@soleen.com> <20240311164638.2015063-12-pasha.tatashin@soleen.com> <3e180c07-53db-4acb-a75c-1a33447d81af@app.fastmail.com> Date: Tue, 12 Mar 2024 00:33:58 +0100 Message-ID: <87frwwpcm1.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; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Mon, Mar 11 2024 at 19:10, Pasha Tatashin wrote: > On Mon, Mar 11, 2024 at 6:17=E2=80=AFPM Andy Lutomirski = 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