Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1046953rwr; Wed, 3 May 2023 09:29:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7/Qv2lW6UQ6D/5Dfzuo/rvFXSNjYJbNx+xLOTMUVF9rc7HzMu8pzqkci+vpahNPyNEpfmS X-Received: by 2002:a05:6a20:144d:b0:f6:2287:e05d with SMTP id a13-20020a056a20144d00b000f62287e05dmr28296984pzi.10.1683131359798; Wed, 03 May 2023 09:29:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683131359; cv=none; d=google.com; s=arc-20160816; b=FI+h3qHe00EuQTk41btExkzVstdYI/N6Os7JT5SJsvRRuZQXNzsxmsPoiO8R2LMCLq xRVqwPzHnP8ltmhx9RCmnnF9FtVH8+1Ew9Dlnfl8Yl97xaW702HoKYIoAb7rVuW8Xuhd 0agD1Aos0UuMdzOQ8BPijxm+hU1xBxxY1h5eFNSCmuYSn9b8lhd0dwpf+H3lkyTnOlaj dslMwH+KDWiZ7qkpXv4koT8mtb9UOovpMHp5b//9Ux1lKbNusFqTqdh3O6otJGE+Fe0s MA568xI6GUbpcJwsJuLCMhnprfVcqd64SlA9JKn5Kne6qIeNogFC2EmDBtnvM8AR7mwD 37lw== 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=ENpRjF8kzYVCk9XTBHkybh8MEkNm5rA2NrZTd9z/plo=; b=Edc9dEwUV8Z289+Uz/EnQqiQwr4tGFEtEaXzXp0ZYq8b0qimsDVQbxECb3QdNPCp4s rcdAP3eDb/Hfz6yVofaHcxDrI2EeRHO5BqSD4kUQrxHr1jh7XiImBmfzXKuiJnYRLko3 KHPloFZSO5r5hT1l56xEjP1xly6By1NRKhRvP5eaZKJVHHWEHmCyYQ4xI5mkr2RvP7K0 RAUoc1+6AVQrgP8P4Z15oNG8BVQ/vGrKG23kkiEAsVdArut2gaCiYrPlQ/oBU6qBypkA 4ttjJzZ6C+O2QZww0IFM71yFo30tkraYuSfyJ1z85YszQFnUnd4zGTY6gkRYR7gjmQA+ 47sA== 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 d9-20020a170903230900b001a63a2de59asi36458322plh.494.2023.05.03.09.29.07; Wed, 03 May 2023 09:29:19 -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 S229571AbjECQ2y (ORCPT + 99 others); Wed, 3 May 2023 12:28:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjECQ2w (ORCPT ); Wed, 3 May 2023 12:28:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB57310FF; Wed, 3 May 2023 09:28:49 -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 84C686257F; Wed, 3 May 2023 16:28:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C43EDC433EF; Wed, 3 May 2023 16:28:41 +0000 (UTC) Date: Wed, 3 May 2023 12:28:39 -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: <20230503122839.0d9934c5@gandalf.local.home> In-Reply-To: References: <20230501165450.15352-1-surenb@google.com> 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 08:09:28 -0700 Suren Baghdasaryan wrote: > There is another issue, which I think can be solved in a smart way but > will either affect performance or would require more memory. With the > tracing approach we don't know beforehand how many individual > allocation sites exist, so we have to allocate code tags (or similar > structures for counting) at runtime vs compile time. We can be smart > about it and allocate in batches or even preallocate more than we need > beforehand but, as I said, it will require some kind of compromise. 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. -- Steve