Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp399889lqt; Mon, 18 Mar 2024 10:58:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXn4jJXZAzYWL/8ELnSc6Q30Jt7GjnzoJf+Ni/2ZmDTdpYM5bcQtegdrKGgTjTnFL01PkcdVL0ZYNfCnydLC1oF5yyBXRLOF33ivKhLWw== X-Google-Smtp-Source: AGHT+IHuEpybse6Va1X+JqWqyiJ0NY5yUg6f1SfryGl3W7HS6zNTf6IKP2v4PsxjqU9ZV7txpO3l X-Received: by 2002:a05:6a20:7da2:b0:1a3:63fa:f760 with SMTP id v34-20020a056a207da200b001a363faf760mr3585416pzj.14.1710784708578; Mon, 18 Mar 2024 10:58:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710784708; cv=pass; d=google.com; s=arc-20160816; b=T50h7yVGxsBCu2DPSJSM6sqMImI5jtGcQsl5HIuMFiXk/cXs+SamE3ru4TvIuoGmEz /ac75QLlDrQ7ZQgf7WBWYzqa/tpQndmBaoUuP09EN8/c3VyIX9VKOK0eOvKyklVAF49s jvR8EriTB8gF8p4qr9beJ55kpdw0neYfkKeWkctsW/oNollT7kL5h5wEoC/bvKVywWb9 CZtFG006wLd+jDM1+eRS10DQonC4sSLTasVv31QCxj2gF9Les9l4+/QIUR8MdkIGvxyQ 5/bnnSg2mx7mMBLjxCsMFOe9558EtkXcLuaUfhxM8yd6UTA/H8E/W1hugmc8F0dMfIPy vhzw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=tQ/GoT+qLpaPN7pTPDFxNZKaxLFNg4IP20IBxyg9WHU=; fh=eNE1tDdhF5AzsB+WPppY2FeiERGAI17IJHR/GgxiESA=; b=FpQ61xYjPC816gso/iG8Xf6alUugNfg5+79TDWfqH/0inld+pM3utiRRIHJtVJhp2m TQ3RgCLzsfj3EGiGqroJoT+883PE2V2S64wSNtNAzGbSpXulr/HK/0E+PxKL/2YIzn+Q ZPoIc7G4BhCRVnKhMWJZqVWv/MQG00yi8P9vFTdvTeh5a0KfMJ1HClkV/iCzHC0jed3Z vRVQ7mbvTtsIJXHhkwRdVEK+HFrkW3PCi0gRZuIP6Mc6yKILQxO7PezHh7zfwkXVHyyH RYU/uh24+HUb5KGMhIw6leKY2fAgpJkVn+5AOWBqy1sz9ftuEn0d79mPCLYgS+E8rTbi rWfA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@soleen-com.20230601.gappssmtp.com header.s=20230601 header.b=VAyHdp2V; arc=pass (i=1 spf=pass spfdomain=soleen.com dkim=pass dkdomain=soleen-com.20230601.gappssmtp.com dmarc=pass fromdomain=soleen.com); spf=pass (google.com: domain of linux-kernel+bounces-106468-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-106468-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=soleen.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id h12-20020a63530c000000b005dc8372021bsi8702380pgb.464.2024.03.18.10.58.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 10:58:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-106468-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=@soleen-com.20230601.gappssmtp.com header.s=20230601 header.b=VAyHdp2V; arc=pass (i=1 spf=pass spfdomain=soleen.com dkim=pass dkdomain=soleen-com.20230601.gappssmtp.com dmarc=pass fromdomain=soleen.com); spf=pass (google.com: domain of linux-kernel+bounces-106468-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-106468-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=soleen.com 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 A54ED2844A8 for ; Mon, 18 Mar 2024 17:38:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 22A7E55780; Mon, 18 Mar 2024 17:38:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=soleen-com.20230601.gappssmtp.com header.i=@soleen-com.20230601.gappssmtp.com header.b="VAyHdp2V" Received: from mail-yw1-f169.google.com (mail-yw1-f169.google.com [209.85.128.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B495D374CB for ; Mon, 18 Mar 2024 17:38:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710783490; cv=none; b=eAgCD7zeNLVU5MsHIISRAWuamsgsJpc5xCcY3Vh55V4snaRHiD1WmlR/bnJlEZu6h+EAZOgkhX1IFvA1asMjYZn82fgpNGG8aCjwzHHcWZipbNxZOaXZCuJ+gydlfv9GaucrPR8rxRwXGQNFMYwDDmKzuDQ2tkwjWdRU3Lwpa7Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710783490; c=relaxed/simple; bh=hPFv+RGaYMSlxCJMkHIePzAsGOaNOQVxwte45Qtempg=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=McNPb1Y9eMt3AqV0Zpupayzzw5NF+Uwgj6jPQP5/sbpi1CvY9+uYdxY8uyLKrvNyye53QB6zBI15+NcKW7O9cUNHGpjqHHt44wyrVM5jQJqYNu9BwtM6W8KbSfNO+TTov5IdGIb4DTYBVMkc4EMBbKnjo+heXUAR2XZHB64XR0U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=soleen.com; spf=pass smtp.mailfrom=soleen.com; dkim=pass (2048-bit key) header.d=soleen-com.20230601.gappssmtp.com header.i=@soleen-com.20230601.gappssmtp.com header.b=VAyHdp2V; arc=none smtp.client-ip=209.85.128.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=soleen.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=soleen.com Received: by mail-yw1-f169.google.com with SMTP id 00721157ae682-609ff069a40so54429177b3.1 for ; Mon, 18 Mar 2024 10:38:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen-com.20230601.gappssmtp.com; s=20230601; t=1710783488; x=1711388288; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=tQ/GoT+qLpaPN7pTPDFxNZKaxLFNg4IP20IBxyg9WHU=; b=VAyHdp2VaF4yf6YsGlGPTMIhc5iQOdxsEFoYGKENk6ibV75ScuZ+mRrwL4LATYT+BP cACQ4mGODNSVLmMOJGSKMfeIfJQNrR8Sv1+Q/5z8s8c2cvJ7bm2pOwMqfAYDHuROdH2n VhkdN5LRY+lksHDN1OlsrebvI3VsuO0kBXKSvRTpWkrAN6829YsvrmxbM5kV7blc+3Rm /cRlylE9BGC/qo9zmbrLbJ7SRf1RuF9LPGUfiy0yIfFaG6vT+s6gwo4niphsmRz0vIqg o0h+1uFXH2snVoLT8erEb50cTmBRd14TXMBoWBOTqVWDbjbaMvzVeAKx55NzG4r0EB8I J7eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710783488; x=1711388288; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tQ/GoT+qLpaPN7pTPDFxNZKaxLFNg4IP20IBxyg9WHU=; b=pIaX+OFa9nuMXhvdA28XOywf1gXfeCRFBn58IbUEKKMH6C4DJ8LoylEFckB/sincEe PusBpSoVySOzFYJv9BwqfLiQupxFuJ1yvwBv5GKmfw8SpznSgjlGKu9F6gJnuW45LcP5 LyUiK7KUNf0pk6mcGwqSgBY8tySTS6VbuGt1Dz5jUZAhB7I+29K3i4MJ2TRvG+BOtvNJ BX3fgIoocPCr32BGyCLBBU/nEw9fsTEOTxjtB/dTYAseT7a6YWocl5KVYbv5UXe7RnfZ OllZx9lhXxbvpPVQhPbAAVTWMKDGtgfHYd6NZpDwaASM1EMOBfiO/LlmkarZg1eNa+w7 pwJg== X-Forwarded-Encrypted: i=1; AJvYcCVuiXanrNyEcrihudXefcR59zXcXS3DOkXSg/1ek8R+z1b57853y1X2motPCt7YobzaiMxvL+MuPWYC7krdftasBaiWUkxyVo0ikppq X-Gm-Message-State: AOJu0Yw0UGfNzL9wCGHpRxjaF9FKEVZ04iFFVY7NNGKnS0XoMlJyc+wI 06Paw8DIYKwriDjRZTmC5s4Rq2F/K0xmTNxVR2W0knoOSBJnF4KTnNzfswDnbj2dNoYLU/QBgFn PfkoyG4ELz7kC7CTOgZ7/ygRPp/5MpPcS1NQwMQ== X-Received: by 2002:a05:6902:389:b0:dc7:4b43:db3f with SMTP id f9-20020a056902038900b00dc74b43db3fmr7681050ybs.21.1710783487828; Mon, 18 Mar 2024 10:38:07 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240311164638.2015063-1-pasha.tatashin@soleen.com> <2cb8f02d-f21e-45d2-afe2-d1c6225240f3@zytor.com> <2qp4uegb4kqkryihqyo6v3fzoc2nysuhltc535kxnh6ozpo5ni@isilzw7nth42> <39F17EC4-7844-4111-BF7D-FFC97B05D9FA@zytor.com> <74c82d8a6b5f490784cc8f16fa7d2c12@AcuMS.aculab.com> In-Reply-To: From: Pasha Tatashin Date: Mon, 18 Mar 2024 13:37:29 -0400 Message-ID: Subject: Re: [RFC 00/14] Dynamic Kernel Stacks To: David Laight Cc: "H. Peter Anvin" , Matthew Wilcox , Kent Overstreet , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "akpm@linux-foundation.org" , "x86@kernel.org" , "bp@alien8.de" , "brauner@kernel.org" , "bristot@redhat.com" , "bsegall@google.com" , "dave.hansen@linux.intel.com" , "dianders@chromium.org" , "dietmar.eggemann@arm.com" , "eric.devolder@oracle.com" , "hca@linux.ibm.com" , "hch@infradead.org" , "jacob.jun.pan@linux.intel.com" , "jgg@ziepe.ca" , "jpoimboe@kernel.org" , "jroedel@suse.de" , "juri.lelli@redhat.com" , "kinseyho@google.com" , "kirill.shutemov@linux.intel.com" , "lstoakes@gmail.com" , "luto@kernel.org" , "mgorman@suse.de" , "mic@digikod.net" , "michael.christie@oracle.com" , "mingo@redhat.com" , "mjguzik@gmail.com" , "mst@redhat.com" , "npiggin@gmail.com" , "peterz@infradead.org" , "pmladek@suse.com" , "rick.p.edgecombe@intel.com" , "rostedt@goodmis.org" , "surenb@google.com" , "tglx@linutronix.de" , "urezki@gmail.com" , "vincent.guittot@linaro.org" , "vschneid@redhat.com" Content-Type: text/plain; charset="UTF-8" > > Perhaps a 'garbage collection' activity that reclaims stack > > pages from processes that have been asleep 'for a while' or > > haven't used a lot of stack recently (if hw 'page accessed' > > bit can be used) might make more sense. Interesting approach: if we take the original Andy's suggestion of using an access bit to know which stack pages were never used during context switch and unmap them, and as an extra optimization have a "garbage collector" that unmaps stacks in some long sleeping rarely used threads. I will think about this. Thanks, Pasha