From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32613C4829E for ; Fri, 16 Feb 2024 00:20:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 884BC8D0019; Thu, 15 Feb 2024 19:20:19 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 80CF68D0007; Thu, 15 Feb 2024 19:20:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6863B8D0019; Thu, 15 Feb 2024 19:20:19 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 5341C8D0007 for ; Thu, 15 Feb 2024 19:20:19 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 02815143069 for ; Fri, 16 Feb 2024 00:20:18 +0000 (UTC) X-FDA: 81795760158.26.66CAA1F Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf29.hostedemail.com (Postfix) with ESMTP id 5B99A120019 for ; Fri, 16 Feb 2024 00:20:17 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=none; spf=pass (imf29.hostedemail.com: domain of "SRS0=RKXr=JZ=goodmis.org=rostedt@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=RKXr=JZ=goodmis.org=rostedt@kernel.org"; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708042817; a=rsa-sha256; cv=none; b=OPjEP91ixcAO5Lv2vbSytlXtvFzvZuPHG/+MNx3QMy2YC9nPzOb8Nx8TizrbLqdPeIckQV Ke7uiSCWzeIBrAeZsprp8VooFjA9D+kk16agAXga15+Ud4pQXYhVWYsUEVNHUOyR5EjFPU Z/pvya1CLxQjhd9Yo/ZZWEFbrl1dnYw= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=none; spf=pass (imf29.hostedemail.com: domain of "SRS0=RKXr=JZ=goodmis.org=rostedt@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=RKXr=JZ=goodmis.org=rostedt@kernel.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708042817; h=from:from:sender: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=DL8SVS/pGFfqx8KyoD0I3M9q9Kd9vzdnyK00eWaNogA=; b=eo3nqDWozUm/3EY7jh1AocTEtEdt3PG7QxnURKPNZeUEMVn+S7Sv2hK+2vtjfsQoYoUSps GgWaaLn2MyJfSyuCNUW601IPbd3/6xIHaXm3ORaHGgp8YFVoRMdpjsAtdp95AHhjGHIBHC aH+sr7D5Pdh8keRsBhCPw9zGJj4919w= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id B2E91614FA; Fri, 16 Feb 2024 00:20:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D7BAC433C7; Fri, 16 Feb 2024 00:20:07 +0000 (UTC) Date: Thu, 15 Feb 2024 19:21:41 -0500 From: Steven Rostedt To: Kent Overstreet Cc: Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , 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, 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: <20240215192141.03421b85@gandalf.local.home> In-Reply-To: References: <20240212213922.783301-1-surenb@google.com> <20240212213922.783301-32-surenb@google.com> <320cd134-b767-4f29-869b-d219793ba8a1@suse.cz> <20240215180742.34470209@gandalf.local.home> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 5B99A120019 X-Stat-Signature: 9xefipc6g5fpmou1k7hb9akk1ryuapyp X-HE-Tag: 1708042817-771416 X-HE-Meta: U2FsdGVkX1/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EOhqD0eAAQyRuIppsmO2cxTgzYyqMoKhurPmahndeGfVkFfS9bV55hRQjn2KzNKNLvByL3F+df2qjruHuQmapw6Jg2SgwnBKKqLB2bdX5nWQ+VVEgFSWTVVDgRhBJ+qIH734zqtLHTIkezaFLPY10CkD4WKYT+ILUSogNBY0MW0vwWCzdOgjY8QlKRKXo7rrMGmPiMxKGDS8RwTvT5BYthqMQkXl26JUVpcVaEvZx0FTEIQWEm0qdLwk9I7LXXg65w6TMRDP2Fs5/lLWmit3pLvfYlqySlPXQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, 15 Feb 2024 18:51:41 -0500 Kent Overstreet wrote: > Most of that is data (505024), not text (68582, or 66k). > And the 4K extra would have been data too. > The data is mostly the alloc tags themselves (one per allocation > callsite, and you compiled the entire kernel), so that's expected. > > Of the text, a lot of that is going to be slowpath stuff - module load > and unload hooks, formatt and printing the output, other assorted bits. > > Then there's Allocation and deallocating obj extensions vectors - not > slowpath but not super fast path, not every allocation. > > The fastpath instruction count overhead is pretty small > - actually doing the accounting - the core of slub.c, page_alloc.c, > percpu.c > - setting/restoring the alloc tag: this is overhead we add to every > allocation callsite, so it's the most relevant - but it's just a few > instructions. > > So that's the breakdown. Definitely not zero overhead, but that fixed > memory overhead (and additionally, the percpu counters) is the price we > pay for very low runtime CPU overhead. But where are the benchmarks that are not micro-benchmarks. How much overhead does this cause to those? Is it in the noise, or is it noticeable? -- Steve