From patchwork Fri Sep 6 00:53:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 13793119 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 2783FCE7AA6 for ; Fri, 6 Sep 2024 00:53:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B71876B0093; Thu, 5 Sep 2024 20:53:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B22356B0096; Thu, 5 Sep 2024 20:53:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A11126B0098; Thu, 5 Sep 2024 20:53:50 -0400 (EDT) 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 8922A6B0093 for ; Thu, 5 Sep 2024 20:53:50 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 2749380212 for ; Fri, 6 Sep 2024 00:53:50 +0000 (UTC) X-FDA: 82532491020.05.0FAB56D Received: from out-188.mta1.migadu.com (out-188.mta1.migadu.com [95.215.58.188]) by imf22.hostedemail.com (Postfix) with ESMTP id 5A42AC0007 for ; Fri, 6 Sep 2024 00:53:48 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=VCtnP7Mu; spf=pass (imf22.hostedemail.com: domain of kent.overstreet@linux.dev designates 95.215.58.188 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725583979; a=rsa-sha256; cv=none; b=oHD62ByE/9hbQS4doz9OjRRWrjS413mNAtw1vXTiYIYuChO/K7eqdKJrkAMtf6RqiGGv6P ue+ZX3uizTYIUdqjlrUVHVI5PDmos2nGGFmSZKLHRZob99SEMbLqmKOYZ7tIWtsHx7OIt+ wWWvVj0iTzUmQD99z2FDhyZXrm0vsHQ= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=VCtnP7Mu; spf=pass (imf22.hostedemail.com: domain of kent.overstreet@linux.dev designates 95.215.58.188 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725583979; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=Yp/Qwl66bzNTJKTHCnRrU5pVmyEM46AHrp3iaoTD3Z4=; b=Fp24iK1fOEoOylX8hmLeGz0aE4b2czST9uvu0tmf8FSupTW0DfyUFImiExiXESayRVN4jQ snACMqA1wcylBYVnfTuR4q5Hck1QaXPiVpb+6QC6sJghociMACoRWmBs1V6aOTcc0nCDDN J0oJHHpmD6oPT+7tWAtrWM/ibX5Z23c= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1725584027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Yp/Qwl66bzNTJKTHCnRrU5pVmyEM46AHrp3iaoTD3Z4=; b=VCtnP7MulFQjVFxLMtYPcDDFkG+w1qksQWwT2SNjiPOXoPn3tjitepuK72yPs0t3pHrQLz Nf4mF1QkGX2mosLhQBLunKyk7Iwjtx8+qUpErQMw5LpRc+mQjwGIBVZEy9pYn0kfA7G0k+ Lj+gLbHl0IEFChxtj6YfFjlj6jdSC94= From: Kent Overstreet To: akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Kent Overstreet , Suren Baghdasaryan Subject: [PATCH] mm/show_mem.c: report alloc tags in human readable units Date: Thu, 5 Sep 2024 20:53:37 -0400 Message-ID: <20240906005337.1220091-1-kent.overstreet@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Stat-Signature: zamroa817bmd1e86ef7mj6mmwtzuudyk X-Rspamd-Queue-Id: 5A42AC0007 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1725584028-680704 X-HE-Meta: U2FsdGVkX18dt3aLesVpTWnr4zThZx2kbkSEznyI+LflSlxsuEd7W3Ar4A4lvjtLHVSZ0WTuItAIYd9EhAxqY10DLR+3Q8XQgFM5jC95RAPYQFsypBOj/X4wARphqmzujbXKY2VzSydKW/FRFgvhbKx3KNgTyomom9l8ibhTI3ARJ1gksD81ks+lfFSlpZPpkc16GSsspiipPOc3K1Ke9sRJWikxxYR4Q8NDnst7q7V61uQHwQF3mSHILq4QWHR5mGc6TgCxkDnejJWB5zmR43Jk1Q38naWoDyDhIdVrlLu/GCkSnrQkT+Fe0GGybTQuwscf0ZkBqX0WIhHjXRG4PERug2dBr0HAaRrtpVR3oj3d4IKPthBdkiI2o+XnYkWBUAL4Sh3QV6q1VIQIe+AQDX1n2bMnT+X7UznkKNXISfGFwctIfC8qbSggKJDhCn4oCQQ4sm3smzCvxUXZ5jcVKAdGfBxRVXmnBXFFcUW5uVXZ8lB0LkPsxmuezhCXpevwqhACXrlGOufw9QBwsp4ZrAVmnFVRlFdnCvbXSe5P07lnVja7VcYNGWpOVU1qGafdSnAoe5+3RjgHsidUNVBhpgfBht8lJV0seQEZ5zFQKsignqFx4011g9iopiSJyRQN2pff546045GtWZABeVVdzSvkImi0fXOcD7Ph1JWv9gYbJ/cb18sFi/k3PkBZBDH0kWSitfg7g5p2Oi/Y8K8V56FC/L7PNwF6T5QwsekT1jinZSDbT0FNiYcVeivoek+Vv+zqW3bhic3PXvCb931jn6gFUx2nNx3RWdw/tBoIEfGw4IhxBHKncBsOCerKgikX5hCoXiRf7mpGvJpttwgT3P/h/JVH6sEOOHYPp13D0F4D8UpjQHd7hit/HOXiTnQtUKBtmF88CRqZAFfRS8Vh8VzISSREfAvNadeAVuatr54WCdTGG9JYTtST8CDoMU4OZx3QI1Zhb5TwlWbvvEK 7YZpLz6r YWf0+QDCNHLO/3v84GOGfmgKxA46esXUKU+h+YmPHLANMlAwPUT42mNsFTNWddIw65JTIdI7/tb21EeEvzs2F707FUcqFZ0hC/wXiEz7NT9sYmNFA0nlRut3CwqTRXGc4qrmtoUWjmRj1Y3NRRsH0oecfR4wx5xWTMiXaCJ9OwQvvj0WsYGmv+Cl1nJanCQBoFwWiMEN1xHxzNtI= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000069, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: We already do this when reporting slab info - more consistent and more readable. Cc: Suren Baghdasaryan Signed-off-by: Kent Overstreet Reviewed-by: Suren Baghdasaryan --- mm/show_mem.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mm/show_mem.c b/mm/show_mem.c index 691e1b457d04..1b448e1ebd09 100644 --- a/mm/show_mem.c +++ b/mm/show_mem.c @@ -459,15 +459,18 @@ void __show_mem(unsigned int filter, nodemask_t *nodemask, int max_zone_idx) struct codetag *ct = tags[i].ct; struct alloc_tag *tag = ct_to_alloc_tag(ct); struct alloc_tag_counters counter = alloc_tag_read(tag); + char bytes[10]; + + string_get_size(counter.bytes, 1, STRING_UNITS_2, bytes, sizeof(bytes)); /* Same as alloc_tag_to_text() but w/o intermediate buffer */ if (ct->modname) - pr_notice("%12lli %8llu %s:%u [%s] func:%s\n", - counter.bytes, counter.calls, ct->filename, + pr_notice("%12s %8llu %s:%u [%s] func:%s\n", + bytes, counter.calls, ct->filename, ct->lineno, ct->modname, ct->function); else - pr_notice("%12lli %8llu %s:%u func:%s\n", - counter.bytes, counter.calls, ct->filename, + pr_notice("%12s %8llu %s:%u func:%s\n", + bytes, counter.calls, ct->filename, ct->lineno, ct->function); } }