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 1BEE7E7717D for ; Fri, 13 Dec 2024 03:51:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EC7CF6B0089; Thu, 12 Dec 2024 22:51:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E76256B008C; Thu, 12 Dec 2024 22:51:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D3DF36B0092; Thu, 12 Dec 2024 22:51:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id B6DD16B0089 for ; Thu, 12 Dec 2024 22:51:28 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 65CA680AFC for ; Fri, 13 Dec 2024 03:51:28 +0000 (UTC) X-FDA: 82888560006.27.E0A5730 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by imf18.hostedemail.com (Postfix) with ESMTP id A5F1A1C0007 for ; Fri, 13 Dec 2024 03:51:14 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b=PfrW7HR0; dmarc=pass (policy=none) header.from=quicinc.com; spf=pass (imf18.hostedemail.com: domain of quic_zhenhuah@quicinc.com designates 205.220.168.131 as permitted sender) smtp.mailfrom=quic_zhenhuah@quicinc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734061874; a=rsa-sha256; cv=none; b=d1ohg7cNMPXL0VNJ3UDIuQKmMMthqWPhfzMzcPJ+6+I7JrMUpNM8RNA0AFHbsC9PVfQqtz 8AQ9ncFiJ6J69yv+qKeW3gCkhm4v3hop39AvttVXl/iqlQARRh8sORfHpbvw2cL9eUd+Gq lIJLXgXynX+SUyNhRRtRkWMlK7wshyk= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b=PfrW7HR0; dmarc=pass (policy=none) header.from=quicinc.com; spf=pass (imf18.hostedemail.com: domain of quic_zhenhuah@quicinc.com designates 205.220.168.131 as permitted sender) smtp.mailfrom=quic_zhenhuah@quicinc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734061874; 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=0WlVVhuuMZbcprATQkmkfPuIsGNaCLEJRsRRrs6ecRk=; b=CP4ecm1KQH6Vc97N9Xj4/hq689aiGRU+fY8d+ynKJJdBUTWmJNWNTwjn1p4NzZfYi6GG6g dtvzEcrRnrfrg0Jo8mDUJzFmgC8KPY4kzGHUmv6oZceEu7ZJQ7C8mCYKPT8U28wZx1plA8 a3kcOg5zkmsr6rCdly8kGxHShkISY/I= Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BCIDN5r024728; Fri, 13 Dec 2024 03:51:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 0WlVVhuuMZbcprATQkmkfPuIsGNaCLEJRsRRrs6ecRk=; b=PfrW7HR0x836L9NY 9i5yEMlZ/3K/YI0buD1hI12lBUlWy8iELgGs9iARlIK2YyoU0kLTjxNPWEVKIW5W 7pAlDsnA6k/012fn+aZyUnb/fVEq+ahYecFo4AOKexUGlVgm3S/kw7FHVyF51b1i 1RsROv2QimR5bGD+hOtHyFIyLXN/R62tGIWw/4wuSDZQmJit8wyr/QCvAsvnaPEd FLq7SVUGWBJZoOR+JaBErBRM2Z3G3PuTST6dprIopjdZwBgITGA69z1u9MzB2XXJ 41l/QUCOsD2M1q+F31D4bC7DR8D+sjIQZOESBoCHOy74K1RehxCCXcgFL+sYSpsp lWaG1Q== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 43g4wn93d9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 13 Dec 2024 03:51:23 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 4BD3p55p003225 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 13 Dec 2024 03:51:05 GMT Received: from [10.239.132.245] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Thu, 12 Dec 2024 19:51:03 -0800 Message-ID: <2c97de38-4256-47c4-97e4-7d1cb6c30fc0@quicinc.com> Date: Fri, 13 Dec 2024 11:51:01 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mm/code_tag: Skip displaying the code_tag if it is not called To: Suren Baghdasaryan CC: , , , References: <20241211085616.2471901-1-quic_zhenhuah@quicinc.com> Content-Language: en-US From: Zhenhua Huang In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: NQnHQwSddZ8JHVitINq7erOljEmatnlS X-Proofpoint-GUID: NQnHQwSddZ8JHVitINq7erOljEmatnlS X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 priorityscore=1501 mlxlogscore=999 spamscore=0 mlxscore=0 clxscore=1015 adultscore=0 phishscore=0 suspectscore=0 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412130027 X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: A5F1A1C0007 X-Stat-Signature: bppep3rjcgxrwsfqyoo4ebi4od5u6c4z X-HE-Tag: 1734061874-972773 X-HE-Meta: U2FsdGVkX18qQ7dt631SO0Ol8TxH7r0Dzd3cXCh7GZgzwrHt194JOAABPPxY3eML91sdb9FZO8G+jQnAT/T/j88PkUmj72ECWJZZdU9WNhzf900l4Zb+arOa/oYLkXtZAY31+Of3naCgvk1LWub6MnzqqFoCBzh4pcOiWK0SWkDH1ljYIC0eQC/U2EGfAuAiI3KL18WQehh9+FB67qADN4qfE/WbxEynlVuMCmj3CJn19h0szPBzx6uSroaF5vLISGgZ4LJfr1JKY83pNMqF6s1Qpll31eSt+VAWWpGnqVFaYPgyrIQ9PGnr7CL+Oi3C5I+KGguzTwPFyHQ6zE0vx5UWzy31VaEiKNMfTfczYGJRshZU3dKLdbrVjs2QsVZ8ru12JAJHqPvGX55xH91NOPl38DRYcv76fGJvcA7KlQFTWUt7QQfSkebz8usTWO1Lbn5xjxcpswW3n6UJMSmneqSiPb83FXic+lGi3rFtHLzxDM0TZk9TAt4fxAT2SIusTS6qipwGWXOL7VqwO/ga3IsrZ0INQaUgSDVDNrzYhJD6cVOkmzZdQgqRQsRLWqZ7PZQXjLqrbZYfsPj5qy5qfWbQJVXE91DM7IgI98qE257pVNhHN2Qj+B3oU1MZ9AGw6Ud9argRKvhutOA+Cr92k1CuyVhLi46rLZ61eetwTqV4gCE5AEnt+IRb+WZItyAW+EkBdbcNx1PwTVr1oHqP/nhsSEv5/2mmw5BpZ45xlqKJupDb4f0sy9Ud6VAECohe2jIdya+Qp3T19mf0ljCgLJJvy1snHQ/BS+PYmhs71nwOqZvWqLfzxbX6PGSP6mSL4dPocJ/1qex+++0t5KjshoK1kbJmNlzeLEMH8lh7n7KvlL+T56yIst6tiis8MeFktbU6o4GopoHtCodKSMGoDx1OgcJ2CXR1NGaXoImzxWrzrUhr+bV4/FaFET94om/HI1o0wxXT8SDG954vwyI Reyu4mfp 37dAnVqtOhaatBsk7GNVjmpHH1bCFVb8xpZc52+NHD6Kgpei+ZqO4hR/xJzeHYNsIlajHd59TkpHrOeUXMEKWx5SFbBltBXUx5S/ljEyJOFcWDJnKk0MIBm5OKOBpM8vJOmSkSHD2xhOp3x1wn6nJAvEepiDBmV8Qsii383jEifPm9y+4KUUP3zw/bqFVJJqY9KRHUsG3TlClNT5CT0XWUG9ETc95vfALdMgs/yBC928fXJbMylFZ5xV/KW0tRdHLEGF7zalEigacIKhmTib7gIk9sAv4VPZ8N1cH/BUvhHTK8Tgwm4x+NTrRU4dhQsm8VS5eEx+87BDLp/pb6R1S/6z4p+SnwtOAKz/J7x7u5T9cnsG5JKuM1N4s/rsmpLP24XUXb60nt4WFH2WK1NJ1XlTPlRxs0i88c8C9/9sqee/QGEnLZ1RgDPyh4XshHu7828B+igCKHA0zLgjeSWU5+rtAKjbU6+QnbrC6 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, 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 2024/12/13 10:44, Suren Baghdasaryan wrote: > On Wed, Dec 11, 2024 at 11:50 PM Zhenhua Huang > wrote: >> >> Hi Suren, >> >> On 2024/12/12 15:16, Suren Baghdasaryan wrote: >>> On Wed, Dec 11, 2024 at 12:56 AM 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. OK, Thanks, got it. > >> >>> 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 = alloc_tag_read(tag); >>>> s64 bytes = 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.calls); >>>> + 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 >>>> >>