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 1B43BE7717F for ; Thu, 12 Dec 2024 07:50:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9BCCC6B007B; Thu, 12 Dec 2024 02:50:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 946FA6B0082; Thu, 12 Dec 2024 02:50:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7E6516B0083; Thu, 12 Dec 2024 02:50:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 6340F6B007B for ; Thu, 12 Dec 2024 02:50:53 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 14D7EB057C for ; Thu, 12 Dec 2024 07:50:53 +0000 (UTC) X-FDA: 82885535334.14.236F53D Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by imf25.hostedemail.com (Postfix) with ESMTP id 5F069A0005 for ; Thu, 12 Dec 2024 07:50:33 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b=cnZfadcC; dmarc=pass (policy=none) header.from=quicinc.com; spf=pass (imf25.hostedemail.com: domain of quic_zhenhuah@quicinc.com designates 205.220.180.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=1733989840; 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=N0fDG9czXcIfHX8ntkk7y0sz92jcGrSzEkNajuWjIVc=; b=dmA+wz90SkvcwqNNjNhx5Vj/onJGfYmXIhM73s47B5sOU/QB8iNGm/gGSuBc7VN4J3UUuk 3V90JgMOFRX7EMWcwuOzHwjpJQE/KcIHohypzd52LwpBY8iRM7OLc77Bpk9bGGOUhmFvZa AVzjHYgHOtflM3OaETqdFsVCIrYr6+A= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733989840; a=rsa-sha256; cv=none; b=OVlmOCcT3xELQM8cy3QSqpRhTo5J5aCYR1lcE9ME8S4kxH9tTPtf3oxCVGpzyYu0zRxeF8 m0aeAHgOlKF+F3EcdH96ZiBbFGum7TGDHlhcGjtVh2MhKhWNvbYhKWKuAGib1G+P+iuvks Jt0fSiEDSNB0N1FdDMba5QOQJtQY99g= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b=cnZfadcC; dmarc=pass (policy=none) header.from=quicinc.com; spf=pass (imf25.hostedemail.com: domain of quic_zhenhuah@quicinc.com designates 205.220.180.131 as permitted sender) smtp.mailfrom=quic_zhenhuah@quicinc.com Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BC72sUX030098; Thu, 12 Dec 2024 07:50:48 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= N0fDG9czXcIfHX8ntkk7y0sz92jcGrSzEkNajuWjIVc=; b=cnZfadcCIZ7alfbF vSdgT0irD4m58VPjsS6WThQZhofLbZvk/j4c7kepkXt5ulJk0DRnI1AdVPMajcqk mvBNZJ2tyHSOkq/o8tBMrDtRNZqsaV84xpO0D0IjSreWQmDMtL/k7RCSChaCSXOi Lx4uF6lfCk95Z5jL4jYp46jzSH32310YQK9hr189cZ8CCA5NpAiIVgDbXLRgBynP EUZPFNDwHo2ozXz9d/TU9SFAVTZ3I8hZXlwxXoSxgffX9oG720NqiX2I23TK6z4Y 1L+d0p+MgRmKl8mNIui93710dT/NLg0/hgdbuwAsKOOti+fmhBDxKqf5XXfNNDYR E2KsKA== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 43dxw4ahhh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Dec 2024 07:50:48 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 4BC7olHp032755 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Dec 2024 07:50:47 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; Wed, 11 Dec 2024 23:50:45 -0800 Message-ID: Date: Thu, 12 Dec 2024 15:50:43 +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: N9J9giHnv6lGpTb7dDY2SDLS8jZdPMIt X-Proofpoint-GUID: N9J9giHnv6lGpTb7dDY2SDLS8jZdPMIt 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 impostorscore=0 bulkscore=0 suspectscore=0 priorityscore=1501 adultscore=0 mlxlogscore=999 clxscore=1015 spamscore=0 mlxscore=0 lowpriorityscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412120053 X-Stat-Signature: hyimx41ji6j8e6n1wbicuj9mufmmd6qe X-Rspamd-Queue-Id: 5F069A0005 X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1733989833-770774 X-HE-Meta: U2FsdGVkX19j8g7FBIFmCjbamKxF2jjaqXwWv0zylA5YkGL9vmTLeajtq6j4M41tI2ZS+BDXftaP+NjqaejE6KhNi6q2blrg2mbgiUOGNebBUrIu8UdH7UhlicUfx0imdMRnbo60WueOc76HJCLwy4DJMQU6hJ8abUWff75eUuIcFGIIWhQ0DLvxsuIgCEjZiMXAbHq3ZmGgsHD1fwI/h2ODOiPOLybFU22rRyx3i9/62qmnNa2cEm4OmEWkkaS44UlbWXfpgYTs2Aer+iI9vMWR+Pc06Z/U4qRPF+j/VROm5ItBi7jsj1ActBVXSWXTtRsw+PbLSrx6oh/8Su0941FaTtA5LdFVODHdEpIRA2CeUylUwf7zq2PPMHgsN4EiUZwcDa8bRwVnWNT5hoqk+8y3kIvwFjY06EjwDYTfEHgH3z0bMvAgoxfjyZvxf9J4scuBDlRtvw+go3lsReMHpciM0HSMj/CDqF2HFvjAngHh5ENYE0wE0/ERCGfJhrAEJ3iGaAwHOfGvLGi2vqVAkgF+D0Y5duAUA1MmUW7RWOeQtXKAOgHKy1et43rWeNZ/WHU25IwaSJa5FtHLoqBznPNEGY0yS9mOne7bKTP+vuyVq45sN58fn6UhB/DiDK7t50ikiZjwaDfi2U/BHhyG9Jl4CfZU8CnljnW8hPOvtjG6b+45WJDSx7g7K50T2rSJ3qaUH5K8NgGZeTvTqj4TzZQSN18ngCnr9po41iuVJYU3V9/eCExY25h0UGa1kEx7va17jKN8fAGYcvVJ1IVsbIPEBguKeQAaqWRoEZGTIkK1OjADN5ecbDaLOsoBlrb56GyReeGhriOmI6goIH3ZU0tyVgb1uruzacKyIQiyWPQF7MVnvtWJgudBAp2zGJFp6PzRG5AbRF8xMG9Eok08VbaFaFns9bcpeXSukWJiAmdY1mMt/OApnOnsiwDyP72f+T4qkynKVZVE8Dj+JQX ZmE5SiZp IRZnirxQFAeBokwuH4X/uZydM4+zdgqrSq5SFUSv269dcXJN4SOk2tSSDS4mNxForEnIN2hRzWjLyuZsVTsc2gFqaGi+aeppCfLi3PDE0v7YEU8n4kB2I/Rwgq7BWWiiw2AASGNQwBfUcTk7wGGJX4RtPHR9D7q0+JGWO1lJk22/5E+b97/DRopdp+EKyKejzpAP9P0DXagA+xraLHz94U5ySZklhFwubGCD8G2EH/DDwKVWNoo575eva7ZYPtnEyEFBBnTvwl+1NOtQwidQFRkp4A6qJs/aMf0PNCEi6IU5qtafC5Yxy28km9BnWBMD803atxmhgL2LtCupKwoHtPNkYLfTMO7FMWsYd5hQemNFWKYl0koCkM/oRMi888sxWCQCvHHam7+NXZDvKeH968SBQlGZnKxPoHXTgP2IBu3ffBGCy3TtK8seKAQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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.. > 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 >>