Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1188749rwr; Wed, 3 May 2023 11:16:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ku96r34Ofeme2DCFC1lyxfhwQQEGSPuVJiEVufcPUGJtp/Nc+rA60l17YyBW3TA6r9bhd X-Received: by 2002:a05:6a20:938c:b0:f2:afd5:e52e with SMTP id x12-20020a056a20938c00b000f2afd5e52emr27953919pzh.33.1683137788609; Wed, 03 May 2023 11:16:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683137788; cv=none; d=google.com; s=arc-20160816; b=Be8tR2irkvHAmc9VwlrdcdpiuA2IZAZvSHHHy2LIoLR+44GoYfiNFVne9i432RbYLT G62kUHoj4YiwmoX4En1G3VSEhcGBBegzcS3ad+mXoBjzd4FMQoBIGdaA252vD7lklUtp M65YrlSEHbJiJJW4E6SE/WeFCJuyPRUUl6FGVtEAlc/F+E7B+h4ArxMHEIFLw5WLmwPo HcTAmiTkrJ1xJtnKQuElcjU6AsAzwBuuYXUZyWZkHCdYW6ibWV+nSy0CdFjsQTkRuFmG 9rlqpNcig7Na0VWKBmtgat4jOuDJL5609tbAOGXiLjetko6ALb0tCKAXjxPZNiPDWVk1 NRlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=AyP7QknWmOYs/Eyw9p7/FpXAHwus4Ee8a3gRFpGkmGw=; b=ylbomsdvN0uqnKNvasNvoYx1k0694XWlI3HJUIh5uL+6x6is8L4gWBe/uYCOoL3CQG +3P07WY0YhSXMx+1jHhmbYqo0UX5aFn+cm5BhANK4WdKHTOd5qOFKaI8Oy5ILE6GUQpp W5DfGPx0IEQsZnsbQG45QpcSdut6zo2n2o3B/WFvvFEVSeGFcxd6HZ42+dJbUkZLSQUr pp6HHIY5kNbx0DQFwx59wpCN8V8JFhFd/MekW/XFoi06U9Mw+2SzxlWufEDnGQ4v8lBF bQwuCwjh/wxerBOajZTWrY01k51ZtoxeM3q9uxjW6DhF/nY+YyRz+QsEGUjW27E33rLd A+7A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l185-20020a633ec2000000b0051f0d0d6343si1322222pga.688.2023.05.03.11.16.16; Wed, 03 May 2023 11:16:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230055AbjECSDy (ORCPT + 99 others); Wed, 3 May 2023 14:03:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229519AbjECSDs (ORCPT ); Wed, 3 May 2023 14:03:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5495E4C13; Wed, 3 May 2023 11:03:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E440362F38; Wed, 3 May 2023 18:03:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04F9CC433EF; Wed, 3 May 2023 18:03:38 +0000 (UTC) Date: Wed, 3 May 2023 14:03:37 -0400 From: Steven Rostedt To: Suren Baghdasaryan Cc: Michal Hocko , akpm@linux-foundation.org, kent.overstreet@linux.dev, vbabka@suse.cz, 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, ldufour@linux.ibm.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, 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 00/40] Memory allocation profiling Message-ID: <20230503140337.0f7127b2@gandalf.local.home> In-Reply-To: References: <20230501165450.15352-1-surenb@google.com> <20230503122839.0d9934c5@gandalf.local.home> X-Mailer: Claws Mail 3.17.8 (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-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 3 May 2023 10:40:42 -0700 Suren Baghdasaryan wrote: > > This approach is actually quite common, especially since tagging every > > instance is usually overkill, as if you trace function calls in a running > > kernel, you will find that only a small percentage of the kernel ever > > executes. It's possible that you will be allocating a lot of tags that will > > never be used. If run time allocation is possible, that is usually the > > better approach. > > True but the memory overhead should not be prohibitive here. As a > ballpark number, on my machine I see there are 4838 individual > allocation locations and each codetag structure is 32 bytes, so that's > 152KB. If it's not that big, then allocating at runtime should not be an issue either. If runtime allocation can make it less intrusive to the code, that would be more rationale to do so. -- Steve