Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp332526lqb; Thu, 14 Mar 2024 12:29:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWMZYpiFnmy2b8U8mIp4tjh0RMqcWkwXedBZtDmwqYAA+mJ0TGb1NtIttJru/W36PYvMLInwKGKsBWa+STaC9CbhvR4G7tmbm0Q8kIgyg== X-Google-Smtp-Source: AGHT+IHzFpXr3R5xcQ4vRxJGHk+XL35tyB0xY7+PKZBkIMn2M/DZaD9Mpk9OoSejQjxA87rzjZi4 X-Received: by 2002:a05:6402:4493:b0:568:9e3e:3711 with SMTP id er19-20020a056402449300b005689e3e3711mr2158062edb.5.1710444557751; Thu, 14 Mar 2024 12:29:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710444557; cv=pass; d=google.com; s=arc-20160816; b=T4eMfEkBh3oPV+4kd8LiGTXqgCNKjtCjd6Tb5EJ9aIMwO+JfzQtnJpDYMVycbQnE4k 4IwdPq6CrnflA5lm+pwUBujG4fnyqCdFOHPe+zO5co5at/JvwX+fzsXrH+/TeDNicC5L Sera9deTqtg/tywLntSXzSwR0URojoR2UyNMP1TK7olH0/n3AfgMOHecVrrdVECLX0TJ ZmRyjehBT5iL1uLMHyJ536hgvCRhwzjNIHVuhOTUBgHA3u32I4SQoDdZtILEuamzxr2K 4sjKLd4eTFqDEGf6WWbDvbwcOO3uNdLru7WGH/DRPk0/bFi2kv7xIsmAxE0p23TfH6YL 2Dkg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:date; bh=L5mYCuAgW9WLpcKyE4vY0uyy9Nn7D3uKkSmdVzmlRCI=; fh=e6T5KBJiba8qwy8Ok5EgdZLbYFYhW4BSIqolTe2c41g=; b=FoQtMPB51yDRD9o+lspSfAWMItw8HsPAg0oBW997pdenO/ehA960ur+TV0+/gXXmyG 5R7vLXW7HCr8mCFz6bJtrETAn/aDAzQq/jn5JpzBAiHCp6Uto05egNuHWTs2TZNqD/li vxpxp0pVkcX5XD1HcAvdxHkke6/LVMybN2yHuP3lDRsUYhLtDsSJeoIDhKE3nb48w4H1 LSOLHh02eFVxlA8a+X2zC3wZyMmgrFbIIzotSJFHycZVRQ51GNWAbB6kjf9Bp0870AJ8 igt+B4fESNgb/vNpkx2cQqHTFyavN+eXmoFjHX1C6rvEWwf601oRJA6dbB4PpixThCYz ANnw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=fbZs474P; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-103729-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103729-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id w4-20020a05640234c400b00568a301b05dsi689604edc.189.2024.03.14.12.29.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 12:29:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-103729-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=fbZs474P; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-103729-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103729-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 74D471F23557 for ; Thu, 14 Mar 2024 19:29:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 904E77580B; Thu, 14 Mar 2024 19:29:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="fbZs474P" Received: from out-183.mta0.migadu.com (out-183.mta0.migadu.com [91.218.175.183]) (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 E7C0971750 for ; Thu, 14 Mar 2024 19:29:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.183 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710444549; cv=none; b=l8zF8cdpjoauFvW+imCV60rH1M2vGAhatNmSokB2vb8ignc2RXkE5wRJFZSLm7H7Ia5q+d+sP/EVUuxDIaRScYwWM82JaIWGhCFsFPFunftXbEaIrMSSigzLso6qbJ0ivARO/ZeUTElKwA4Sk/wxAZU3q0mEim4ofW98RwdB5P4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710444549; c=relaxed/simple; bh=G/i5H2FtY2qCt+ahAUkXmXRmIbnow9JIaG1fuDzJhH8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gT5i2LHYEVIq7aOtdsUBhSJh4AC3hUwp0FPah4t+EfANIKnxSL/LgsTFcn1FdrS5E657dRtSiu4H8XiNOVjh2CPsbBCqtdimW+cDVTu+ETbZ4zgVHsTRwn/Nef0kOyqRO9hatIABmvpSRHToSIH84LxTyFDnnfESCqKEdHNxrDs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=fbZs474P; arc=none smtp.client-ip=91.218.175.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Thu, 14 Mar 2024 15:28:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1710444545; 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: in-reply-to:in-reply-to:references:references; bh=L5mYCuAgW9WLpcKyE4vY0uyy9Nn7D3uKkSmdVzmlRCI=; b=fbZs474PeXyIJsZK5v+BHUEn0x3cCbqr1L1c7WYw9Hu+WKErM/0yY5IIXojQMN2YnQp1Zd 6H1hkW7SqyHqpXtHe+KmDPq11pUwICXj5kIueCxQFkY/JD5ZYSGZQBxvpGiVhAf9SKK7lk hlEXwUWHcyBFdVZOz9JTxpG6u8Btf6w= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Pasha Tatashin Cc: "H. Peter Anvin" , 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 Subject: Re: [RFC 00/14] Dynamic Kernel Stacks Message-ID: References: <20240311164638.2015063-1-pasha.tatashin@soleen.com> <2cb8f02d-f21e-45d2-afe2-d1c6225240f3@zytor.com> 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=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT On Thu, Mar 14, 2024 at 03:23:08PM -0400, Pasha Tatashin wrote: > > > > > > My point is that what matters is total memory use, not just memory used in > > > the kernel. Amdahl's law. > > > > If userspace is running a few processes with many threads and the > > userspace stacks are small, kernel stacks could end up dominating. > > > > I'd like to see some numbers though. > > The unused kernel stack pages occupy petabytes of memory across the fleet [1]. Raw number doesn't mean much here (I know how many machines Google has, of course it's going to be petabytes ;), percentage of system memory would be better. What I'd _really_ like to see is raw output from memory allocation profiling, so we can see how much memory is going to kernel stacks vs. other kernel allocations. Number of kernel threads vs. number of user threads would also be good to know - I've been seeing ps output lately where we've got a lot more workqueue workers than we should, perhaps that's something that could be addressed.