Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp3388859rwr; Sun, 7 May 2023 10:32:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5RIoZdCOaGzPrw8x6yedSjZ/SiXDoKl+329vX/VQrEKKfNWgvP+phbbG7WbftOg8ackfQ+ X-Received: by 2002:a17:902:ec83:b0:1ac:5ded:97cf with SMTP id x3-20020a170902ec8300b001ac5ded97cfmr5020780plg.11.1683480744972; Sun, 07 May 2023 10:32:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683480744; cv=none; d=google.com; s=arc-20160816; b=MzhUTI0E/MmCUgqUrwp7ye6cZ5C+2F9ukiH/h730RsO4tWCQhg0H5KFZzF0bTmrySV 0beYaYESsGflXoVCV8J6Xf36Uq50FREIxlbraXU1hA+gkce/KfXD9WK9PDIY9xBsyPzs lW6KWpNUR4sWup53I1oUOGbytYS4nCMMGwZgTKld81KGEEzki8Gb3oXFOvJsmVcRgW2X ksbqOJ33QXrug5exQ9U+GVXRpHyLJhEI8CUvmyPNR4kPSafdjnAneBP9Y8yMyxBK5u/N 3u/zZZj/E0WAIG2MXZ8+TWG522x1P2g8lBepyyXXJa8p+kLMEfKOGwDVpVaVFH0VloBd aMUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:dkim-signature:date; bh=K2IKs9gP6n8AwGF/yIy3vUTevnAld9lGncsxDoAPz7I=; b=COTaw5xCYzEjjktrSdQBpYGjH06MhQXugBS7Nd4UZI0RmZE+bKQL0sCKCnIEP8n25T KcwpW4FRlCpFA6XojMIr56/l9ERMHP86aCI8ahFkCtQsyB8h6d7sD8EhVISAUrFtp3Ss COL4SaFaGCcoitkyqC/FvvmcFwUsmUTrieHsF88Fn04NBeVCp2lUGhBf6cyTCtE7zwvw fRR3A6SqfSA4CpNJpF43d0WXUwscdPYNZjX/4qni99FftYQRo4wmLtAUYzTpoZCMSZor kTFeZvt0xFrrxgiCcVaBDNDhJdp4FC7FYJ3oi/giZq0hUyjxxL+D+KY5QlEn9Y4Q3Bei iF6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=RBllo5SE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t22-20020a170902b21600b001aaf91ae3acsi5927487plr.485.2023.05.07.10.32.13; Sun, 07 May 2023 10:32:24 -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; dkim=pass header.i=@linux.dev header.s=key1 header.b=RBllo5SE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230415AbjEGRCR (ORCPT + 99 others); Sun, 7 May 2023 13:02:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229460AbjEGRCP (ORCPT ); Sun, 7 May 2023 13:02:15 -0400 Received: from out-4.mta1.migadu.com (out-4.mta1.migadu.com [95.215.58.4]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2268440D8 for ; Sun, 7 May 2023 10:02:13 -0700 (PDT) Date: Sun, 7 May 2023 13:01:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1683478930; h=from:from: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=K2IKs9gP6n8AwGF/yIy3vUTevnAld9lGncsxDoAPz7I=; b=RBllo5SEteiXdDXnxk7cvHhWc/ZZh0WQhZDZBnP+ByAnv8lRSeIbU166BGu3cTiWFAlwdB nBFEChtqdNB9Z3bo6qijnMaFFiQ4D4cogj6akL7Hso38B4dGgPNp5YpE0GoUhkJAbR1zsk SwoHfdcoAv3j3qWwaVk8QGGqXSvbXYE= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Michal Hocko Cc: Suren Baghdasaryan , akpm@linux-foundation.org, 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, rostedt@goodmis.org, 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: References: <20230501165450.15352-1-surenb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Sun, May 07, 2023 at 12:27:18PM +0200, Michal Hocko wrote: > On Thu 04-05-23 08:08:13, Suren Baghdasaryan wrote: > > On Thu, May 4, 2023 at 2:07 AM Michal Hocko wrote: > [...] > > > e.g. is it really interesting to know that there is a likely memory > > > leak in seq_file proper doing and allocation? No as it is the specific > > > implementation using seq_file that is leaking most likely. There are > > > other examples like that See? > > > > Yes, I see that. One level tracking does not provide all the > > information needed to track such issues. Something more informative > > would cost more. That's why our proposal is to have a light-weight > > mechanism to get a high level picture and then be able to zoom into a > > specific area using context capture. If you have ideas to improve > > this, I'm open to suggestions. > > Well, I think that a more scalable approach would be to not track in > callers but in the allocator itself. The full stack trace might not be > all that important or interesting and maybe even increase the overall > overhead but a partial one with a configurable depth would sound more > interesting to me. A per cache hastable indexed by stack trace reference > and extending slab metadata to store the reference for kfree path won't > be free but the overhead might be just acceptable. How would you propose to annotate what call chains need what depth of stack trace recorded? How would you propose to make this performant?