Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp797285rdb; Thu, 15 Feb 2024 16:20:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWtYS43qKzK4xIZpi7K74M/4VRK+TlAgsU+hFmccxHqdPipxkjkE89FkIxR1eWRV/q9choN7hWv0lJy9Qnts8qAjTcKTZio19iX4t8Z3g== X-Google-Smtp-Source: AGHT+IEBX70Us8LO2lQ64AqV3hv6p66w0KMMdpQbYLmzvLS8tGIEoyWxumRE9EogJM7Yt3GSKZXS X-Received: by 2002:a17:90a:f2c9:b0:298:d0ed:e13a with SMTP id gt9-20020a17090af2c900b00298d0ede13amr4676585pjb.15.1708042826189; Thu, 15 Feb 2024 16:20:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708042826; cv=pass; d=google.com; s=arc-20160816; b=iIFC9H9dQ84P1Yh7BHCBQCfMDsSawdTtQpSwzk9P3s/+oH2AmqYSqrjN5ObQR/I3ao 3BJ70gW9Erc+tmx6XWn1W/ZplwXrKT41aw673eEbIcSPNsRU4JKiLW48WRP3WGGBLZov mZpwBfFP1niB6ZR04H6qtbXd8r+xQ9rdkPluf3pnHgr/yh7VmNPaAkP8qGuetjDcRNoT jpr7NQeNTqDzFrXiI0VRJGxjj+6HmpLq5ZTsctDuKrqCMYllkg4dM6v5AJMgA8YQI02P tK9BokImit5LeLagiB2tGzMRxgVG0aUpJDyEcqyKUyOAbuwVpKLoWWiOUbgUAlQSsmlt sRDw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=DL8SVS/pGFfqx8KyoD0I3M9q9Kd9vzdnyK00eWaNogA=; fh=yAsR8mz6OHt7FqUIcMxTq2xSLRkYQrfOXi2SdkYqlko=; b=ved034GFIwlnwuSwQQCESA1U+pCEx/RtHb6Fp7560tNzPun5xkiDmd/NaavEyNA1LE ZOHX64D2VyjGSJHIv+dBv1CIBA6fkLqSxkBYlWZwvBSe4jq6xJAmyTwT/Tdq+VzA2S7O 3Jbhzyie6FcxgJqIvapTTI0f7kdqFqiE2oPGGUxxxrLRy/49thBnoTwSLhRkQmWy9H64 h/ubrghiwO1UJPWmCZozk5cqJy7+JFlufRbQ+aiCwbFOE4oxQNATu751G7SqRtuWwGSq VygGgEKDn4rvcuRpbo9ArwhCye0s6D2QiTmX/asC8L4W0G8eU7pCZ3cf6gdGce5jYgw4 KZug==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-67889-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67889-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id pa10-20020a17090b264a00b00290b59aa10bsi2045024pjb.120.2024.02.15.16.20.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 16:20:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67889-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-67889-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67889-linux.lists.archive=gmail.com@vger.kernel.org" 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 DF3E52846CF for ; Fri, 16 Feb 2024 00:20:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2F7555C83; Fri, 16 Feb 2024 00:20:15 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8C11C38F; Fri, 16 Feb 2024 00:20:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708042814; cv=none; b=MR1e8WcBea5SeFpZeIouZHgq+82aGYUKJPSkTeZJyoItsxINUECva8RI0Ym5ST02UG/8Uxnyi2okkLTUbucTvQKeDzTdbUtjd3cA63L1/yHG6aT2mAnX1VkYZINrtptfYEtMBZ6MdHqBdsspTeEnskqBcf9jAHUNisbZWBBjsAU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708042814; c=relaxed/simple; bh=GD1Wa7SHUnGt9gUDi+iC0B1+iivxZqph8uOCh9oMSdQ=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=A/MGmBanpdj7MoHYk33IxLyrSLNMbKdYdXZNbg1ss6gTa9cqkYr2rPu1Kclw3vsEPk03803+Vay3y6ZolMK2kO4/ZV+iEiH4FLg6uD/DoeBgasXt26+mMsRaYrYGpGFUVcM5FdwAeudh5vJYpvKTCWMDQ9JWMKZArzLWQOG3Pbo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 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) 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-Transfer-Encoding: 7bit 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