From patchwork Mon Feb 17 08:48:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tobin C. Harding" X-Patchwork-Id: 11385817 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 499B61395 for ; Mon, 17 Feb 2020 08:48:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1686F2064C for ; Mon, 17 Feb 2020 08:48:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="wV/IdaOx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1686F2064C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C269E6B0006; Mon, 17 Feb 2020 03:48:53 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id BAF756B0007; Mon, 17 Feb 2020 03:48:53 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A77AB6B0008; Mon, 17 Feb 2020 03:48:53 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0086.hostedemail.com [216.40.44.86]) by kanga.kvack.org (Postfix) with ESMTP id 8FDB76B0006 for ; Mon, 17 Feb 2020 03:48:53 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 2FE75181AEF00 for ; Mon, 17 Feb 2020 08:48:53 +0000 (UTC) X-FDA: 76498993746.24.sense30_306b21b464f06 X-Spam-Summary: 2,0,0,82220906bc9fd38f,d41d8cd98f00b204,tobin@kernel.org,:cl@linux.com:tobin@kernel.org:akpm@linux-foundation.org::linux-kernel@vger.kernel.org,RULES_HIT:41:355:379:541:800:960:973:982:988:989:1260:1261:1345:1359:1437:1534:1541:1711:1714:1730:1747:1777:1792:2393:2559:2562:2892:3138:3139:3140:3141:3142:3350:3865:3866:3867:4250:4321:4605:4823:5007:6261:6653:7903:7904:8603:9121:10004:11026:11233:11658:11914:12297:12555:12895:13069:13206:13229:13311:13357:14181:14384:14394:14721:21080:21627:30034:30054:30075,0,RBL:64.147.123.25:@kernel.org:.lbl8.mailshell.net-62.6.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fs,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: sense30_306b21b464f06 X-Filterd-Recvd-Size: 3747 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Mon, 17 Feb 2020 08:48:52 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 833255A8; Mon, 17 Feb 2020 03:48:51 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 17 Feb 2020 03:48:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=zFN5hgyJe3TtyC4xmLFL/ZQlcvBNI bla0NMXIYckHbo=; b=wV/IdaOx9UVtHBfBnPVTg7+s00lL6FOVxef/MY9CIqb// EoHNuzyeiVEDtcLJW4vFvDXSFFugPhOH7MlzJEqDrEcDR+bP6tQ02zq4AQE3Ut7c jr+msOMsJOyvKc+X3YIWR+LP9EKI1TMNTIfllWFxf/wuTQXxkH2t7IHqgHZJdj1l LFVp48ydWxX6W0U9+3x6CLQBdcTzc3RhbBWggR2q6rf4iqf/PakLcGWhtS3psArF HKoZFUp2JPVVPRiXVx39CHDF472TGmdqPRpEHzBKmXZknn99ZYYq/49zFCg1Ho9H YSkSuBua9WJEHGl1SfJP9obUE78nFW0ghSv+nDkEQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrjeehgdduvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfsedttdertdertddtnecuhfhrohhmpedfvfhosghinhcu vedrucfjrghrughinhhgfdcuoehtohgsihhnsehkvghrnhgvlhdrohhrgheqnecukfhppe dvtdefrddujeefrddvkedrudektdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpehtohgsihhnsehkvghrnhgvlhdrohhrgh X-ME-Proxy: Received: from ares.fritz.box (203-173-28-180.dyn.iinet.net.au [203.173.28.180]) by mail.messagingengine.com (Postfix) with ESMTPA id 313D23280060; Mon, 17 Feb 2020 03:48:48 -0500 (EST) From: "Tobin C. Harding" To: Christoph Lameter Cc: "Tobin C. Harding" , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] tools: vm: slabinfo: Replace tabs with spaces Date: Mon, 17 Feb 2020 19:48:27 +1100 Message-Id: <20200217084828.9092-2-tobin@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200217084828.9092-1-tobin@kernel.org> References: <20200217084828.9092-1-tobin@kernel.org> 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: We have some rouge tabs within the output string of `slabinfo -h` causing the description output of the `--partial` option to be incorrectly aligned when printed. Replace the tabs with spaces, correctly aligning all option description strings. Signed-off-by: Tobin C. Harding Acked-by: Christoph Lameter --- tools/vm/slabinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/vm/slabinfo.c b/tools/vm/slabinfo.c index 68092d15e12b..29f8ecb59cf6 100644 --- a/tools/vm/slabinfo.c +++ b/tools/vm/slabinfo.c @@ -125,7 +125,7 @@ static void usage(void) "-n|--numa Show NUMA information\n" "-N|--lines=K Show the first K slabs\n" "-o|--ops Show kmem_cache_ops\n" - "-P|--partial Sort by number of partial slabs\n" + "-P|--partial Sort by number of partial slabs\n" "-r|--report Detailed report on single slabs\n" "-s|--shrink Shrink slabs\n" "-S|--Size Sort by size\n" From patchwork Mon Feb 17 08:48:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tobin C. Harding" X-Patchwork-Id: 11385819 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C89C01395 for ; Mon, 17 Feb 2020 08:48:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8880B2067D for ; Mon, 17 Feb 2020 08:48:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="2MhlPgKZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8880B2067D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 328E66B0007; Mon, 17 Feb 2020 03:48:56 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 2B2716B0008; Mon, 17 Feb 2020 03:48:56 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 08B8C6B000A; Mon, 17 Feb 2020 03:48:56 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0045.hostedemail.com [216.40.44.45]) by kanga.kvack.org (Postfix) with ESMTP id E44C66B0007 for ; Mon, 17 Feb 2020 03:48:55 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 861D34DB4 for ; Mon, 17 Feb 2020 08:48:55 +0000 (UTC) X-FDA: 76498993830.17.face77_30bd90c872007 X-Spam-Summary: 2,0,0,f3007b0aa7cba177,d41d8cd98f00b204,tobin@kernel.org,:cl@linux.com:tobin@kernel.org:akpm@linux-foundation.org::linux-kernel@vger.kernel.org,RULES_HIT:41:355:379:541:800:960:966:973:988:989:1260:1261:1345:1359:1437:1535:1544:1711:1730:1747:1777:1792:2196:2198:2199:2200:2393:2559:2562:2731:2892:2901:3138:3139:3140:3141:3142:3354:3865:3866:3867:3868:3871:3872:4117:4250:4321:4385:4605:5007:6261:6653:9121:10004:11026:11233:11658:11914:12043:12291:12297:12438:12555:12683:12895:13138:13161:13229:13231:14096:14181:14394:14721:21080:21627:30029:30054:30070:30075,0,RBL:64.147.123.25:@kernel.org:.lbl8.mailshell.net-62.6.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fs,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:27,LUA_SUMMARY:none X-HE-Tag: face77_30bd90c872007 X-Filterd-Recvd-Size: 6969 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Mon, 17 Feb 2020 08:48:54 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id D2310578; Mon, 17 Feb 2020 03:48:53 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 17 Feb 2020 03:48:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=C7OnKRF2IxPjjx3ttk61uc9uKHChW tpnA2tIrjpDu6k=; b=2MhlPgKZAssStM6Nu5Hj+By6eFniKbTdLkgXZ2QfXvEjE JGAhqlakSu52vbRGdb9sdn4dLVo70v+YnWV/aWE8I/a6wBsPPMiFxdnD2q/vHOCQ Eix80+29A2f66zt54XgWRAqQLYtjpUOKtpdfA+Iy6049inuwEvL2oZ1zjDMFt3qb 8J/IAtm8Rjpwd18or6cWXHp/rfIzIyJBxpT84otPuUy6kePZPHXSrby6vWlg0Guh Cl2DdcL7KK18J3P7tu8zthTYIcXmRviCgRNvMDoRGGccy4ufk+j6kZaVLINOTs0d 4gj2jl+QYxll6luSYcIphyj0xbbrwi5iaCvftGwcA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrjeehgdduvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfsedttdertdertddtnecuhfhrohhmpedfvfhosghinhcu vedrucfjrghrughinhhgfdcuoehtohgsihhnsehkvghrnhgvlhdrohhrgheqnecukfhppe dvtdefrddujeefrddvkedrudektdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpehtohgsihhnsehkvghrnhgvlhdrohhrgh X-ME-Proxy: Received: from ares.fritz.box (203-173-28-180.dyn.iinet.net.au [203.173.28.180]) by mail.messagingengine.com (Postfix) with ESMTPA id 8385A328005D; Mon, 17 Feb 2020 03:48:51 -0500 (EST) From: "Tobin C. Harding" To: Christoph Lameter Cc: "Tobin C. Harding" , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] tools: vm: slabinfo: Add numa information for objects Date: Mon, 17 Feb 2020 19:48:28 +1100 Message-Id: <20200217084828.9092-3-tobin@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200217084828.9092-1-tobin@kernel.org> References: <20200217084828.9092-1-tobin@kernel.org> 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: Currently we are not handling NUMA information for a bunch of slab attribute files, files of form `170 N0=170 ...`. These are objects objects_partial total_objects cpu_slabs For other attribute files, namely `partial` and `slabs`, we do handle the NUMA information. Add a field to the slabinfo struct for the NUMA information and output it during a NUMA report as is done for `slabs` and `partial`. reference: /sys/kernel/slab/kmeme_cache_node/ Signed-off-by: Tobin C. Harding --- tools/vm/slabinfo.c | 67 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 62 insertions(+), 5 deletions(-) diff --git a/tools/vm/slabinfo.c b/tools/vm/slabinfo.c index 29f8ecb59cf6..65254c051da2 100644 --- a/tools/vm/slabinfo.c +++ b/tools/vm/slabinfo.c @@ -46,6 +46,10 @@ struct slabinfo { unsigned long cpu_partial_alloc, cpu_partial_free; int numa[MAX_NODES]; int numa_partial[MAX_NODES]; + int numa_objects[MAX_NODES]; + int numa_objects_partial[MAX_NODES]; + int numa_total_objects[MAX_NODES]; + int numa_cpu_slabs[MAX_NODES]; } slabinfo[MAX_SLABS]; struct aliasinfo { @@ -394,13 +398,49 @@ static void slab_numa(struct slabinfo *s, int mode) printf("\n"); if (mode) { printf("%-21s ", "Partial slabs"); - for(node = 0; node <= highest_node; node++) { + for (node = 0; node <= highest_node; node++) { char b[20]; store_size(b, s->numa_partial[node]); printf(" %4s", b); } printf("\n"); + + printf("%-21s ", "CPU slabs"); + for (node = 0; node <= highest_node; node++) { + char b[20]; + + store_size(b, s->numa_cpu_slabs[node]); + printf(" %4s", b); + } + printf("\n"); + + printf("%-21s ", "Objects"); + for (node = 0; node <= highest_node; node++) { + char b[20]; + + store_size(b, s->numa_objects[node]); + printf(" %4s", b); + } + printf("\n"); + + printf("%-21s ", "Partial objects"); + for (node = 0; node <= highest_node; node++) { + char b[20]; + + store_size(b, s->numa_objects_partial[node]); + printf(" %4s", b); + } + printf("\n"); + + printf("%-21s ", "Total objects"); + for (node = 0; node <= highest_node; node++) { + char b[20]; + + store_size(b, s->numa_total_objects[node]); + printf(" %4s", b); + } + printf("\n"); } line++; } @@ -1205,6 +1245,7 @@ static void read_slab_dir(void) alias->ref = strdup(p); alias++; break; + case DT_DIR: if (chdir(de->d_name)) fatal("Unable to access slab %s\n", slab->name); @@ -1214,13 +1255,27 @@ static void read_slab_dir(void) slab->aliases = get_obj("aliases"); slab->align = get_obj("align"); slab->cache_dma = get_obj("cache_dma"); - slab->cpu_slabs = get_obj("cpu_slabs"); + + slab->cpu_slabs = get_obj_and_str("cpu_slabs", &t); + decode_numa_list(slab->numa_cpu_slabs, t); + free(t); + slab->destroy_by_rcu = get_obj("destroy_by_rcu"); slab->hwcache_align = get_obj("hwcache_align"); slab->object_size = get_obj("object_size"); - slab->objects = get_obj("objects"); - slab->objects_partial = get_obj("objects_partial"); - slab->objects_total = get_obj("objects_total"); + + slab->objects = get_obj_and_str("objects", &t); + decode_numa_list(slab->numa_objects, t); + free(t); + + slab->objects_partial = get_obj_and_str("objects_partial", &t); + decode_numa_list(slab->numa_objects_partial, t); + free(t); + + slab->objects_total = get_obj_and_str("total_objects", &t); + decode_numa_list(slab->numa_total_objects, t); + free(t); + slab->objs_per_slab = get_obj("objs_per_slab"); slab->order = get_obj("order"); slab->partial = get_obj("partial"); @@ -1232,9 +1287,11 @@ static void read_slab_dir(void) slab->red_zone = get_obj("red_zone"); slab->sanity_checks = get_obj("sanity_checks"); slab->slab_size = get_obj("slab_size"); + slab->slabs = get_obj_and_str("slabs", &t); decode_numa_list(slab->numa, t); free(t); + slab->store_user = get_obj("store_user"); slab->trace = get_obj("trace"); slab->alloc_fastpath = get_obj("alloc_fastpath");