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 8726BC48BC4 for ; Thu, 15 Feb 2024 23:26:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 185AE8D0017; Thu, 15 Feb 2024 18:26:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 109148D0007; Thu, 15 Feb 2024 18:26:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EEC788D0017; Thu, 15 Feb 2024 18:26:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id DC91E8D0007 for ; Thu, 15 Feb 2024 18:26:09 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id B6CCE140891 for ; Thu, 15 Feb 2024 23:26:09 +0000 (UTC) X-FDA: 81795623658.03.1047133 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf21.hostedemail.com (Postfix) with ESMTP id 631FA1C000A for ; Thu, 15 Feb 2024 23:26:06 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=none; spf=pass (imf21.hostedemail.com: domain of "SRS0=YdmF=JY=goodmis.org=rostedt@kernel.org" designates 145.40.73.55 as permitted sender) smtp.mailfrom="SRS0=YdmF=JY=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=1708039568; 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=6XgPAigeqGXK136gymMYpZlF5a7viw1K17zUDVmMoKE=; b=vp/jY1YtprX4P6N8y9tF2xjLRJcHJjeVakNsYEp9auNNV5Nz7tyT8TUHB4zttNk9gFvUmB ILzn9P0R4wm9vhRBG/0KxktmZE/EWNQydUiShjWOA5GdUWmEUkyZuEGWubwMoXud8LCDFu IdKEw2W3V6lA9kPb0/m1Mq56AvB6aYo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708039568; a=rsa-sha256; cv=none; b=HeC4h5+fR/SP5pxfLPp9eYmZA82b4KNaaMqY6k5Pg0L+PkbquPRad4YKzFiRNGSflmHo3+ PJbbuxHiGzQztDFKjx2r+9+EEs9L+jRyEEsMie6vRit+nYpU6BcSOCZV6/nQiMAOFybWNM 8gPZK/Luqv9+vhQhvFHK5icw1ELWbwo= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=none; spf=pass (imf21.hostedemail.com: domain of "SRS0=YdmF=JY=goodmis.org=rostedt@kernel.org" designates 145.40.73.55 as permitted sender) smtp.mailfrom="SRS0=YdmF=JY=goodmis.org=rostedt@kernel.org"; dmarc=none Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id C3EEECE293D; Thu, 15 Feb 2024 23:26:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6610C433F1; Thu, 15 Feb 2024 23:25:55 +0000 (UTC) Date: Thu, 15 Feb 2024 18:27:29 -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: <20240215182729.659f3f1c@gandalf.local.home> In-Reply-To: <20240215181648.67170ed5@gandalf.local.home> 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> <20240215181648.67170ed5@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-Stat-Signature: jnoj4dmfdhobzcqhewr66ynoajk6kzmu X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 631FA1C000A X-Rspam-User: X-HE-Tag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44116BBsFJGm/h3axLby2q7e9UAHUt5KHuo+15y5G1FhlCV3S0qGg0zALff8kZ+DMV1w9OnzUjbSOkl5ALycwl2dyYcTdxz6bYwHajWqpUtOCj2NbpFi87V+9QR9EoO9+pEwrIPttvXIAPKtOM0PY63C8kyfvCI3dUkE+HnveFesfFRxxu3glgGAFeLupSUfgUTIBYr0rkiSvB1Y+Q4NtVWGTkHFtVqsZwWFIS7lxBWU76D6TnFQpX6i5UZu9gXEPx9jLlPc4ZBfmusBcquNFlbcn+YabQekGCGssQMNQGldANWREd9osgezN7R3jGJg91a306Qw64h4pIa1zKTbdrM9tjUk3mKpAOl2ySkgHHZ9YgEoE= 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:16:48 -0500 Steven Rostedt wrote: > On Thu, 15 Feb 2024 18:07:42 -0500 > Steven Rostedt wrote: > > > text data bss dec hex filename > > 29161847 18352730 5619716 53134293 32ac3d5 vmlinux.orig > > 29162286 18382638 5595140 53140064 32ada60 vmlinux.memtag-off (+5771) > > 29230868 18887662 5275652 53394182 32ebb06 vmlinux.memtag (+259889) > > 29230746 18887662 5275652 53394060 32eba8c vmlinux.memtag-default-on (+259767) dropped? > > 29276214 18946374 5177348 53399936 32ed180 vmlinux.memtag-debug (+265643) > > If you plan on running this in production, and this increases the size of > the text by 68k, have you measured the I$ pressure that this may induce? > That is, what is the full overhead of having this enabled, as it could > cause more instruction cache misses? > > I wonder if there has been measurements of it off. That is, having this > configured in but default off still increases the text size by 68k. That > can't be good on the instruction cache. > I should have read the cover letter ;-) (someone pointed me to that on IRC): > Performance overhead: > To evaluate performance we implemented an in-kernel test executing > multiple get_free_page/free_page and kmalloc/kfree calls with allocation > sizes growing from 8 to 240 bytes with CPU frequency set to max and CPU > affinity set to a specific CPU to minimize the noise. Below are results > from running the test on Ubuntu 22.04.2 LTS with 6.8.0-rc1 kernel on > 56 core Intel Xeon: These are micro benchmarks, were any larger benchmarks taken? As microbenchmarks do not always show I$ issues (because the benchmark itself will warm up the cache). The cache issue could slow down tasks at a bigger picture, as it can cause more cache misses. Running other benchmarks under perf and recording the cache misses between the different configs would be a good picture to show. > > kmalloc pgalloc > (1 baseline) 6.764s 16.902s > (2 default disabled) 6.793s (+0.43%) 17.007s (+0.62%) > (3 default enabled) 7.197s (+6.40%) 23.666s (+40.02%) > (4 runtime enabled) 7.405s (+9.48%) 23.901s (+41.41%) > (5 memcg) 13.388s (+97.94%) 48.460s (+186.71%) > > Memory overhead: > Kernel size: > > text data bss dec diff > (1) 26515311 18890222 17018880 62424413 > (2) 26524728 19423818 16740352 62688898 264485 > (3) 26524724 19423818 16740352 62688894 264481 > (4) 26524728 19423818 16740352 62688898 264485 > (5) 26541782 18964374 16957440 62463596 39183 Similar to my builds. > > Memory consumption on a 56 core Intel CPU with 125GB of memory: > Code tags: 192 kB > PageExts: 262144 kB (256MB) > SlabExts: 9876 kB (9.6MB) > PcpuExts: 512 kB (0.5MB) > > Total overhead is 0.2% of total memory. All this, and we are still worried about 4k for useful debugging :-/ -- Steve