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 08846E7717F for ; Fri, 13 Dec 2024 02:44:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5E3C26B0085; Thu, 12 Dec 2024 21:44:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 593CB6B0088; Thu, 12 Dec 2024 21:44:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 45B2D6B0089; Thu, 12 Dec 2024 21:44:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 26CBE6B0085 for ; Thu, 12 Dec 2024 21:44:49 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 9932D80A54 for ; Fri, 13 Dec 2024 02:44:48 +0000 (UTC) X-FDA: 82888392300.10.5A489AA Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) by imf02.hostedemail.com (Postfix) with ESMTP id EEAE28000E for ; Fri, 13 Dec 2024 02:43:58 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=DAxvrYJV; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf02.hostedemail.com: domain of surenb@google.com designates 209.85.160.172 as permitted sender) smtp.mailfrom=surenb@google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734057863; a=rsa-sha256; cv=none; b=O5hAq+UBMu52zhW4cKgtqZkSzaNYhoSw2HEokfdHt4tFwrdP69curt42/2TH9s00zlobB0 cJFOjreAy/Fo0e4u8TMOF9HJDJ/CaNbZk/NsprIk1SpyKQOx4EmdU/2NREkCFWbwxNLPVQ E5fuJir5s/ZeTvAahwIvGJpCEEbWg24= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=DAxvrYJV; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf02.hostedemail.com: domain of surenb@google.com designates 209.85.160.172 as permitted sender) smtp.mailfrom=surenb@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734057863; 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:dkim-signature; bh=J77mR7lV5FZAxzlkB0a05Nm6eBULB0dl5ZV23bmS9bY=; b=xUNWRBkCkz+vt61gFdXRo7SDfcV6YSAipI2W3t/yzqxwpqvvMPjH4yOvy10ctiXTjbaB4+ kiOu1I7bpB/XliBDc7ZrJ7+hCHqw4H2gJ2k9bO1x9SzXJbY2q7G1mgzJQlYrO6BNjZLJ8U LHBCU0vvF2bnDQAoq9tkgtqVdFvUX1A= Received: by mail-qt1-f172.google.com with SMTP id d75a77b69052e-4675936f333so65471cf.0 for ; Thu, 12 Dec 2024 18:44:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1734057886; x=1734662686; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=J77mR7lV5FZAxzlkB0a05Nm6eBULB0dl5ZV23bmS9bY=; b=DAxvrYJVWFYf2a3100GrC2lyOFrVNTwhJceVa3P19BdCiv6oxBkt1jVx3Wg8u2I7Ws TSIXziM9CgOhSsyHVTafvRkNwiPtMRfw5aOqOoqKeIG75EROV68SpSCxzua3V7qV01dX Klxv3x5LjmTlBQ1hYneBwUkdU5lZarzj3oI3Cm5wv3fj9cyaTw1OXN7QZj/ZsZnm5MKz 5t4dEZVOGQjJNBVch3zFQGcZqnC4eDOS70N7cd/kNCQ/9TGlzXk1LEi4oMPcGuS0plMh XK+lQKm9h46s+Eg+srB6agQk6POy5bOJntou1PdEgHsm7gH60k5LO6CwSIX83mbBN8Oo NC9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734057886; x=1734662686; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=J77mR7lV5FZAxzlkB0a05Nm6eBULB0dl5ZV23bmS9bY=; b=QN8m71XaisioP8bvbfLVKSOy0jcCRDjr/L5EhyyAkD62XpreZV0OwPD1emwLbtmuTe 5gR+l3/G1GiUYt0rf397dE/Zrc98fCZ457nRFgoKL1FTIDg3wKv+Ty4IjOmr8kqh0Ftz QabDm8Yu9Wo//bvtFUVLWs+bsPZAKR/uTAlJW2hNeTY41ZrwnJ1bVgS+6WsGo/VqX5mn FDwuSoO8OngK/TR18LaDwmzSD1+TKYwxBFqnUnQ9b+ODrHnuEsdDVhilNIXf8xZjr4VL Xdoa4A4G7kiLVv5kaq60rXWj+m8ra47umZTwbWeOQVbuEhgGoD8Gol6GWB4WhVbIZ4mH M2cg== X-Forwarded-Encrypted: i=1; AJvYcCVX3O/DEiyQHHpRy2Y7MootPtp4R9QNsjBmogG4GX5I9FAgHkpVm3L0elX5h170FnerTmUizEbJGw==@kvack.org X-Gm-Message-State: AOJu0Yx7DDtJui1AIPiwUZXvjpm8dSEjRwVUokrZMm4yItO+83Y704HJ fHu/qNaVTny+TQIJL+o1zxEa/pKgIKmRcOgv+is6TyP1ChnMPyM2YKBR7sBQ5qVMdOvm0OSIVzh fegOmd/25jx20tICChxkPaNs1D5S5eOyRWxBD X-Gm-Gg: ASbGncs6dRREM861eqbWe3bAbrucZ1gWZ9zNiNiytG2JfwCKDvbTVDOwmzsPCWwhSPy 6dp9DlEGRWVWSm1fvqWIMfKxZBeOhVLmsFJfjog== X-Google-Smtp-Source: AGHT+IG1/MZN2i5l6ktygO3stTpJyYfOJed+z3+lyx4SJkct22STzOBYMxJ99IdhJInFE7RmorqNZ+NIZvCT2F/cygE= X-Received: by 2002:a05:622a:579a:b0:466:8a29:9de7 with SMTP id d75a77b69052e-467a424b97cmr1803241cf.12.1734057885517; Thu, 12 Dec 2024 18:44:45 -0800 (PST) MIME-Version: 1.0 References: <20241211085616.2471901-1-quic_zhenhuah@quicinc.com> In-Reply-To: From: Suren Baghdasaryan Date: Thu, 12 Dec 2024 18:44:34 -0800 Message-ID: Subject: Re: [PATCH] mm/code_tag: Skip displaying the code_tag if it is not called To: Zhenhua Huang Cc: akpm@linux-foundation.org, kent.overstreet@linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Stat-Signature: enzsxawb1gns7o8jjqsz9tu6xtk1ntf1 X-Rspam-User: X-Rspamd-Queue-Id: EEAE28000E X-Rspamd-Server: rspam08 X-HE-Tag: 1734057838-549814 X-HE-Meta: U2FsdGVkX1/VdYm21wZIaPoyxQ3gjcg3bAg5UBCqNO9ZHabXamtZCS6pLaoU9qVCJPrpdWj4aGKvViMTTi6sXvHKNDp+2oyZ5OhcV/+R02CRc3jSuUtBmd6mqq8kGVuAMyaJwaMfMqNeRFi1OWBpF7Twm/bRaB61Aq0BEd3Zl/Cy+RHs9l4+pqkq45zvL63KCVyLeHKyhTgCRZV6N+RDz8+3SiK0U54W5HJIRY5onmKklRHuisQNEZWNwwNZvA9FhKMsNFEIZf28GVNTp6W7tLzahSpxiAyGWkXsHYslFmZ/oAaPzPW7qSYx+JUqhj/e+mr/ZUiTm++e1/pTnycrUeuOrLXLlOJaMM52ai09LziOU9dk1aBu6xg+THHMXtFkrTjz7Gy1Ce0AiSILOeAWWjg0GdKDQaEZDM8PHPVyxQ0RFT2jvZ56H1mdPeCxLEoELLUKEILToC5hRbwDBI7yIQUx+Qv3gfzwl0j758HFcLOGtRGpX5AhbvYQuUSPWt870A9HV0vGOEDALA1dg+EPhWVmqG2chD1nWEu+z1HzCYAKa77fvjPrjtPZaHwgf2fdHZs/RmeeIO69Npvt2ao8u3QTCTcEJHrj+EK39dWox5J84f72LfHAlHv784eJg8UAnLumj0DP4+UGW6ow8X22/rmWsFc0PqSSnhWhiu1Vo6GL5B/3PIadpv274oD08mE8CBfjLsYQlz95JXPfnM6PWM5QOMfX2AwA2OlnGS9SRBEjMtqjHvplSHcNbkJpLXNNhrnXIBC2HBgxf6c4rB9zgsqfAAm9tuq7iBduBbdtUd3tQX4Nja8VAdi4YRZL2tWAYEnsi0G7SP/iI8wfSKfXBHreLLPM0hXKuyotIQoq80vK+Cf6zEMV6qCJqV58p0i+Tg3LeZofGbzrbiY5BwhYa3NKnLZsUyjUJoUUvaeNHj8d05xEzbatP9It4XnVg1XjRRoFgYuhH+Ght/ekFhE cOgoXsKt lJWJvNaWz2yY/qdmu+/7DGiigK7TDlxu9iGk1rNg6SqNgDliAObMkw5h2kSSWzT93d8/5Q9hxWztKniMYcS3bEeqSscosvrSJq9RnRAXSxWYc4ooekTVHgs24Hz6oB/UUWS0/FQJ/mrAhxoZ4nMXNHaf0NQQ8Dc7lQWwffM6N3J4leut8yCbp+Fkx8u597L4Qcmz8biah7IcDDFlTJ0YbMYM5X//tfn8IW11hrxI3xYxdyC5w8AAT0P9Qyuc06w5uV0OFW9lN8iir2C9jyB0MdBG1CQNmOMFDMPRiWDR3USarV6GZBt3uYuUJdVCT8yHYgXx7H4YCEjTS75o= X-Bogosity: Ham, tests=bogofilter, spamicity=0.409087, 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 Wed, Dec 11, 2024 at 11:50=E2=80=AFPM Zhenhua Huang wrote: > > Hi Suren, > > On 2024/12/12 15:16, Suren Baghdasaryan wrote: > > On Wed, Dec 11, 2024 at 12:56=E2=80=AFAM Zhenhua Huang > > wrote: > >> > >> /proc/allocinfo is full of callsites which are not called at all. > >> Let's only output if the callsite actually been invoked. > > > > No, I disagree. Allocation that was never invoked is not the same as > > no allocation at all. How would we know the difference if we filter > > But it doesn't affect further display when it is actually called? why we > need to know the diff here... > > The point from me is: up to now, the callsite hasn't been invoked, so it > can be ignored in the output.. The original output is really huge.. My point is that with this change we lose information which can be useful. For example if I want to analyze all the places in the kernel where memory can be potentially allocated, your change would prevent me from doing that. > > > out the empty ones? > > If you don't want to see all the unused sites, you can filter them in > > the userspace. I also suspect that for practical purposes you would > > want to filter small ones (below some threshold) as well. > > Yeah, that's the expected way from us as well :) > > > > >> > >> Signed-off-by: Zhenhua Huang > >> --- > >> lib/alloc_tag.c | 10 ++++++---- > >> 1 file changed, 6 insertions(+), 4 deletions(-) > >> > >> diff --git a/lib/alloc_tag.c b/lib/alloc_tag.c > >> index 35f7560a309a..06fb7eb5c0bc 100644 > >> --- a/lib/alloc_tag.c > >> +++ b/lib/alloc_tag.c > >> @@ -95,10 +95,12 @@ static void alloc_tag_to_text(struct seq_buf *out,= struct codetag *ct) > >> struct alloc_tag_counters counter =3D alloc_tag_read(tag); > >> s64 bytes =3D counter.bytes; > >> > >> - seq_buf_printf(out, "%12lli %8llu ", bytes, counter.calls); > >> - codetag_to_text(out, ct); > >> - seq_buf_putc(out, ' '); > >> - seq_buf_putc(out, '\n'); > >> + if (bytes || counter.calls) { > >> + seq_buf_printf(out, "%12lli %8llu ", bytes, counter.ca= lls); > >> + codetag_to_text(out, ct); > >> + seq_buf_putc(out, ' '); > >> + seq_buf_putc(out, '\n'); > >> + } > >> } > >> > >> static int allocinfo_show(struct seq_file *m, void *arg) > >> -- > >> 2.25.1 > >> >