Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp759287rdb; Thu, 15 Feb 2024 14:54:54 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXVtdSZx+L4zxgHfY56sNJntxlSWyka9AGlo5c8sUpe8ZU6eG2WpQLxnkHkk7IRiGEEyUv09ioOGWaZPdB3U3z/E+U8+vbXB560P6C2iw== X-Google-Smtp-Source: AGHT+IECRYW+N3Io5tcVhb2kLSV5UtzOjlOSwyluKLOzTDaTF2TNPnhN4AkyNjVraWS8t7v0iezb X-Received: by 2002:a05:6808:1918:b0:3c1:3658:dbf6 with SMTP id bf24-20020a056808191800b003c13658dbf6mr4612901oib.3.1708037693864; Thu, 15 Feb 2024 14:54:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708037693; cv=pass; d=google.com; s=arc-20160816; b=fP+WQZQOAiOLZhGcdMaVqzSFNXyOo8skbjhQXAUDPC2bZDax6g7koj1gcu3Dw9RLfY IytSL+Ofk4w85LNCYyS/QPH5Weme0/id0GNQIMoUcTfpfklgn3oQjtwfRcBfDfWUI1Rn aRSetkFL716r1MxgrCVRdgqBZkJcIzJkArz5DGZWutr0nVR5IwgeikcB5tKSl/L2vTP7 mEeFNwvfEVme3eqGl5pGtoQrJOFz9HF4vH3M9bMzUZHvmqkNre7ZFc4TbGO1Y1VodPsP 4aDNhNaQSIXz1fNMRYsJ3+0m4bhTRidrpgHMnb9lCgq+5c1RnTmQULP+sG7WJ8JoTpji 3AXw== 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=ZDSi9l3t5jb4xqm42oA6b90TgSdD5o5/qEQqj726Xko=; fh=+SL4WG84YqU46LFMZ8SzXTiC3jZabKWCyPkn0DT7bok=; b=XT2MhwLLwRnU1SE24CkNQDC+WCqAmwd18mvFl4DkqNwiAKTng7RU2YSEwo6y4lPHOB fM9XHmBxrKClIyAqKEXJIGnE8/sSFODjHdqY4jumDJUNw33nMCjIKpY5xKLDQ6Xgzq/S VYE3JX06C6lQJyIXmNvisvMJ1HZzHhliF7E8UW+wbQnc2sg1IK9qGlGshsSMTFQIw6+3 ra6SkkIJkxEzjLfMRizvdcNLJtozhIBeSw+EyC1NR72+kQUIa5trAaF6fLT+s0KRDCZC kdM8EvHH+6qJvYi8WAHdB77mqZgWz3hI3Sl1ctsdfYy5o0w20p6TaoJFddQhM/huUN1Y qR3A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=s7GjinpF; 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-67792-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67792-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id v18-20020ac85792000000b0042dc7f37809si2814354qta.479.2024.02.15.14.54.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 14:54:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67792-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=s7GjinpF; 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-67792-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67792-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 9B2191C21DE4 for ; Thu, 15 Feb 2024 22:54:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4117214534A; Thu, 15 Feb 2024 22:54:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="s7GjinpF" Received: from out-177.mta1.migadu.com (out-177.mta1.migadu.com [95.215.58.177]) (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 69DDB13DBA4 for ; Thu, 15 Feb 2024 22:54:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708037680; cv=none; b=W+Yju1dpTAwzuWDPV9t6Juv7J7D7Jpk/eeZcF1MWx7w0aRLxQBIAltf++FjDsm34lWYPVdRHBobObuHHlTnMkwb+e2n+tNHkyObbAasf5aObiGSvL9jHhs6aDadK+ZNp2UmtA3JNhlhbPqDaC5AJ+03Kj7Eeu4bzOoRLgkQL6bQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708037680; c=relaxed/simple; bh=vpFxO4vaBL6utiq3PQIPAVgPBDoFbQo1foIo5AqK8Qc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TPnz+knajRjFhlxtNKF1BmuhwFV/nRaGEsYPsZycjZDYh+CINgp0frNPer/1v0Px1fxmvFFYf7uLIiNDM8e0xiCQN8859age0NYp9b+bnh305C9FRvKowWEaJSPrmNO6DqYL4jvatHjC+iC9IdxAbbk0XzF7SXCz0MRsbDAVnlY= 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=s7GjinpF; arc=none smtp.client-ip=95.215.58.177 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, 15 Feb 2024 17:54:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1708037676; 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=ZDSi9l3t5jb4xqm42oA6b90TgSdD5o5/qEQqj726Xko=; b=s7GjinpFAKYCSUH++IShUfbdX2oRHH7jMoJOiFXnURQJriQJpk2c1g6IKodkBsWFrf3tMo lRA7KcUWR9thLhS4EQcOGTvPoXKrv2i+J/AXkZWZfF3jhzdVpibqSVtKnHN1t1gucGHdc8 uhGVZUZbURioLMmI/fU2b1rDFnFpKMs= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Michal Hocko Cc: Vlastimil Babka , Suren Baghdasaryan , akpm@linux-foundation.org, hannes@cmpxchg.org, roman.gushchin@linux.dev, mgorman@suse.de, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, corbet@lwn.net, void@manifault.com, peterz@infradead.org, juri.lelli@redhat.com, catalin.marinas@arm.com, will@kernel.org, arnd@arndb.de, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, peterx@redhat.com, david@redhat.com, axboe@kernel.dk, mcgrof@kernel.org, masahiroy@kernel.org, nathan@kernel.org, dennis@kernel.org, tj@kernel.org, muchun.song@linux.dev, rppt@kernel.org, paulmck@kernel.org, pasha.tatashin@soleen.com, yosryahmed@google.com, yuzhao@google.com, dhowells@redhat.com, hughd@google.com, andreyknvl@gmail.com, keescook@chromium.org, ndesaulniers@google.com, vvvvvv@google.com, gregkh@linuxfoundation.org, ebiggers@google.com, ytcoode@gmail.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, bristot@redhat.com, vschneid@redhat.com, cl@linux.com, penberg@kernel.org, iamjoonsoo.kim@lge.com, 42.hyeyoo@gmail.com, glider@google.com, elver@google.com, dvyukov@google.com, shakeelb@google.com, songmuchun@bytedance.com, jbaron@akamai.com, rientjes@google.com, minchan@google.com, kaleshsingh@google.com, kernel-team@android.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, kasan-dev@googlegroups.com, cgroups@vger.kernel.org Subject: Re: [PATCH v3 31/35] lib: add memory allocations report in show_mem() Message-ID: References: <20240212213922.783301-1-surenb@google.com> <20240212213922.783301-32-surenb@google.com> <320cd134-b767-4f29-869b-d219793ba8a1@suse.cz> 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, Feb 15, 2024 at 10:54:53PM +0100, Michal Hocko wrote: > On Thu 15-02-24 15:33:30, Kent Overstreet wrote: > > If we want this report to be 100% reliable, then yes the preallocated > > buffer makes sense - but I don't think 100% makes sense here; I think we > > can accept ~99% and give back that 4k. > > Think about that from the memory reserves consumers. The atomic reserve > is a scarse resource and now you want to use it for debugging purposes > for which you could have preallocated. _Memory_ is a finite resource that we shouldn't be using unnecessarily. We don't need this for the entire time we're under memory pressure; just the short duration it takes to generate the report, then it's back available for other users. You would have us dedicate 4k, from system bootup, that can never be used by other users. Again: this makes no sense. The whole point of having watermarks and shared reserves is so that every codepath doesn't have to have its own dedicated, private reserve, so that we can make better use of a shared finite resource.