From patchwork Fri Apr 26 02:26:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tobin C. Harding" X-Patchwork-Id: 10917981 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D8B78912 for ; Fri, 26 Apr 2019 02:27:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6B9828C5E for ; Fri, 26 Apr 2019 02:27:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA6AE28D2F; Fri, 26 Apr 2019 02:27:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 18FAC28C5E for ; Fri, 26 Apr 2019 02:27:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DCCB96B0006; Thu, 25 Apr 2019 22:27:29 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id D55D96B0007; Thu, 25 Apr 2019 22:27:29 -0400 (EDT) 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 C1F126B0008; Thu, 25 Apr 2019 22:27:29 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by kanga.kvack.org (Postfix) with ESMTP id A376D6B0006 for ; Thu, 25 Apr 2019 22:27:29 -0400 (EDT) Received: by mail-qk1-f200.google.com with SMTP id c132so1640509qke.8 for ; Thu, 25 Apr 2019 19:27:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=ODApqsgPFRkZS56T3G1W+y0nwkHyeIQIwFHc+/bQecY=; b=eo2mLbA07ticoyOFk/e7yHAovED2waaoDmthXN/7HzLvuXFbhqVNQ1B6hYFncl4TTV ETaxQOXlNe2LpmKsyGTTchzWONANY3PafZdIu//4FCSEN/ha5xddwLfpgaNsOnsSmfis mrVQszsX1Mb6NETv1KM5nJo8n6hNHtH+sZDGnzMni5DW5F4tgYvvicd6A2gH9fy8chFG lzKfdMcvdBMvrJbqgWFOIUVdnqgEYyP4xhpbtTHYGDHFCpDd7RSaqFfxq/T5SOEtsxAl CR76skBbJpx+y0dItwUwJ4URU4PcvvC9BtYVJWGd8OeWjSGRM6TJyCaD/fxyJ/FqMasW wgRg== X-Gm-Message-State: APjAAAW2vHSsgSMvX9WRbj2ysBiVOi+zZdYgRChKC+FOvqy121DoUVYu DwL1SBFK165vd6xHWhBVPVWtYe26E1imQd8nWPHELH/JNRtdb9T6NUrOSVdZIs3Y5N2ojv1ExG9 bYy+jEyGhJST+lLKmrv4GqRS77uMQrkD25pJJxpoWfxNRbKZzQJ37+8V8PW+X7+8= X-Received: by 2002:ac8:3567:: with SMTP id z36mr14956484qtb.59.1556245649390; Thu, 25 Apr 2019 19:27:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqz4kO/+CfLob4eqdGpPvb1fHUJPlX1C8BHFxDtil7yscTcZWikToQkdE5WaQblgvl6EOnFp X-Received: by 2002:ac8:3567:: with SMTP id z36mr14956409qtb.59.1556245648163; Thu, 25 Apr 2019 19:27:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556245648; cv=none; d=google.com; s=arc-20160816; b=XxT2b5TqrtCBW5XnQvCiDG1jqnRe3LywC7v+VZn0bpIUdufguIU4a6Na1kRJbdztls qIQcf9hZmsVlmQAvIWR11KEBHI5gjKGL/6/+cyaTPlwl+09b0JgFR57l/lQQxjp6bieK YK2jmPXX+7QYL0RASeMv6rLfG9I44JdTKYpdduCGPjtWE+xH6tvP1UiKG2j2bulKryYe sVvUa3576viqQhGGYirk531578Q7DKj9edrG6R6yTicy7oi2Ar3OmZTS1KFzklvdKKBe kkf/lOBuEGgLwTS70U5i0qxhIBLC7Yaz5XCzYytrxLgL1S5Lx2kh5khl/miriAfsoond /XWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=ODApqsgPFRkZS56T3G1W+y0nwkHyeIQIwFHc+/bQecY=; b=bnM+g6Bee1Zuyfq1UYeGbqGTzdzLMAakv80EdyHjazrrSV4v9oMnGhy4Ux3waLeguP tR9RaGeP4JLliRSGXd/K4ioeugX7zvMdakWy9qI+Ba32cs79j+Vv4ESUUpowBTYdHsn1 xZ9RpmVZZFQNrQyhO8BW9Hxt46zPJmWNNtXiLLQUYYsgk+o6VBbblidn80dCyu4AJbLZ HjzYMtIg8Iy08k3i90GBP+80O5z1QSupZLR2KcJhch9qBVhbFEWvIqNrq7RPCPPIxMK5 QtkJz4YCkHkqwzMxsrHpdbaUMpttbnldid5sce3SF01CZPv+kdifVIr/S0vJV+8eFgII 8jAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="M9/aUmzP"; spf=softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.221 as permitted sender) smtp.mailfrom=tobin@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from new1-smtp.messagingengine.com (new1-smtp.messagingengine.com. [66.111.4.221]) by mx.google.com with ESMTPS id b31si1365341qta.220.2019.04.25.19.27.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Apr 2019 19:27:28 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.221 as permitted sender) client-ip=66.111.4.221; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="M9/aUmzP"; spf=softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.221 as permitted sender) smtp.mailfrom=tobin@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id D48A31319; Thu, 25 Apr 2019 22:27:27 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 25 Apr 2019 22:27:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=ODApqsgPFRkZS56T3G1W+y0nwkHyeIQIwFHc+/bQecY=; b=M9/aUmzP MCDW/wCiMKIGQeuN+QH+Z+uXwUfoVHgV7vZHc4M/K0DOKhV6sotXLs3uMaVSaiWL UXzJ7MA/ENkWHTMpIalnv+bOy2+Co0juTnKTc4Vz1C6IpsQYRbkkht3aZGyU13Zk Eh+XNpwJ3oQv7uCZCqVe1iQFwkATiSPqTLRbcIpgnVZOcrImO4Zln1aasj2rXybO RpklBA9WDokbIhkrDnApNLv07zoiMxK/V/04O3DH9tykbUEg4bT4U5vqql2UmcdJ lbCuDssOfZKGCH2Ur0ZAPyUj4SkbZI882w131HAJJVtdKycPVLF5XPoUd5dNyBCA CtP2rZ4YGp7Hzg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrheehgdehlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepfdfvohgsihhn ucevrdcujfgrrhguihhnghdfuceothhosghinheskhgvrhhnvghlrdhorhhgqeenucfkph epuddvgedrudeiledrudehledrvddutdenucfrrghrrghmpehmrghilhhfrhhomhepthho sghinheskhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from eros.localdomain (124-169-159-210.dyn.iinet.net.au [124.169.159.210]) by mail.messagingengine.com (Postfix) with ESMTPA id 572E9103C9; Thu, 25 Apr 2019 22:27:22 -0400 (EDT) From: "Tobin C. Harding" To: Andrew Morton Cc: "Tobin C. Harding" , Jesper Dangaard Brouer , Pekka Enberg , Vlastimil Babka , Christoph Lameter , David Rientjes , Joonsoo Kim , Tejun Heo , Qian Cai , Linus Torvalds , Mel Gorman , Alexander Duyck , Michal Hocko , Brendan Gregg , linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] tools/vm/slabinfo: Order command line options Date: Fri, 26 Apr 2019 12:26:19 +1000 Message-Id: <20190426022622.4089-2-tobin@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190426022622.4089-1-tobin@kernel.org> References: <20190426022622.4089-1-tobin@kernel.org> MIME-Version: 1.0 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: X-Virus-Scanned: ClamAV using ClamSMTP get_opt() has a spurious character within the option string. Remove it and reorder the options in alphabetic order so that it is easier to keep the options correct. Use the same ordering for command help output and long option handling code. Signed-off-by: Tobin C. Harding --- tools/vm/slabinfo.c | 70 ++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/tools/vm/slabinfo.c b/tools/vm/slabinfo.c index 73818f1b2ef8..e9b5437b2f28 100644 --- a/tools/vm/slabinfo.c +++ b/tools/vm/slabinfo.c @@ -110,7 +110,7 @@ static void fatal(const char *x, ...) static void usage(void) { printf("slabinfo 4/15/2011. (c) 2007 sgi/(c) 2011 Linux Foundation.\n\n" - "slabinfo [-aADefhilnosrStTvz1LXBU] [N=K] [-dafzput] [slab-regexp]\n" + "slabinfo [-aABDefhilLnorsStTUvXz1] [N=K] [-dafzput] [slab-regexp]\n" "-a|--aliases Show aliases\n" "-A|--activity Most active slabs first\n" "-B|--Bytes Show size in bytes\n" @@ -131,9 +131,9 @@ static void usage(void) "-T|--Totals Show summary information\n" "-U|--Unreclaim Show unreclaimable slabs only\n" "-v|--validate Validate slabs\n" + "-X|--Xtotals Show extended summary information\n" "-z|--zero Include empty slabs\n" "-1|--1ref Single reference\n" - "-X|--Xtotals Show extended summary information\n" "\n" "-d | --debug Switch off all debug options\n" @@ -1334,6 +1334,7 @@ static void xtotals(void) struct option opts[] = { { "aliases", no_argument, NULL, 'a' }, { "activity", no_argument, NULL, 'A' }, + { "Bytes", no_argument, NULL, 'B'}, { "debug", optional_argument, NULL, 'd' }, { "display-activity", no_argument, NULL, 'D' }, { "empty", no_argument, NULL, 'e' }, @@ -1341,21 +1342,20 @@ struct option opts[] = { { "help", no_argument, NULL, 'h' }, { "inverted", no_argument, NULL, 'i'}, { "slabs", no_argument, NULL, 'l' }, + { "Loss", no_argument, NULL, 'L'}, { "numa", no_argument, NULL, 'n' }, + { "lines", required_argument, NULL, 'N'}, { "ops", no_argument, NULL, 'o' }, - { "shrink", no_argument, NULL, 's' }, { "report", no_argument, NULL, 'r' }, + { "shrink", no_argument, NULL, 's' }, { "Size", no_argument, NULL, 'S'}, { "tracking", no_argument, NULL, 't'}, { "Totals", no_argument, NULL, 'T'}, + { "Unreclaim", no_argument, NULL, 'U'}, { "validate", no_argument, NULL, 'v' }, + { "Xtotals", no_argument, NULL, 'X'}, { "zero", no_argument, NULL, 'z' }, { "1ref", no_argument, NULL, '1'}, - { "lines", required_argument, NULL, 'N'}, - { "Loss", no_argument, NULL, 'L'}, - { "Xtotals", no_argument, NULL, 'X'}, - { "Bytes", no_argument, NULL, 'B'}, - { "Unreclaim", no_argument, NULL, 'U'}, { NULL, 0, NULL, 0 } }; @@ -1367,18 +1367,18 @@ int main(int argc, char *argv[]) page_size = getpagesize(); - while ((c = getopt_long(argc, argv, "aAd::Defhil1noprstvzTSN:LXBU", + while ((c = getopt_long(argc, argv, "aABd::DefhilLnN:orsStTUvXz1", opts, NULL)) != -1) switch (c) { - case '1': - show_single_ref = 1; - break; case 'a': show_alias = 1; break; case 'A': sort_active = 1; break; + case 'B': + show_bytes = 1; + break; case 'd': set_debug = 1; if (!debug_opt_scan(optarg)) @@ -1399,9 +1399,22 @@ int main(int argc, char *argv[]) case 'i': show_inverted = 1; break; + case 'l': + show_slab = 1; + break; + case 'L': + sort_loss = 1; + break; case 'n': show_numa = 1; break; + case 'N': + if (optarg) { + output_lines = atoi(optarg); + if (output_lines < 1) + output_lines = 1; + } + break; case 'o': show_ops = 1; break; @@ -1411,33 +1424,20 @@ int main(int argc, char *argv[]) case 's': shrink = 1; break; - case 'l': - show_slab = 1; + case 'S': + sort_size = 1; break; case 't': show_track = 1; break; - case 'v': - validate = 1; - break; - case 'z': - skip_zero = 0; - break; case 'T': show_totals = 1; break; - case 'S': - sort_size = 1; - break; - case 'N': - if (optarg) { - output_lines = atoi(optarg); - if (output_lines < 1) - output_lines = 1; - } + case 'U': + unreclaim_only = 1; break; - case 'L': - sort_loss = 1; + case 'v': + validate = 1; break; case 'X': if (output_lines == -1) @@ -1445,11 +1445,11 @@ int main(int argc, char *argv[]) extended_totals = 1; show_bytes = 1; break; - case 'B': - show_bytes = 1; + case 'z': + skip_zero = 0; break; - case 'U': - unreclaim_only = 1; + case '1': + show_single_ref = 1; break; default: fatal("%s: Invalid option '%c'\n", argv[0], optopt); From patchwork Fri Apr 26 02:26:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tobin C. Harding" X-Patchwork-Id: 10917983 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7D5BF912 for ; Fri, 26 Apr 2019 02:27:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B34128C5E for ; Fri, 26 Apr 2019 02:27:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5F82828D2F; Fri, 26 Apr 2019 02:27:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCC6A28C5E for ; Fri, 26 Apr 2019 02:27:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E1A966B0007; Thu, 25 Apr 2019 22:27:35 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id DCA336B0008; Thu, 25 Apr 2019 22:27:35 -0400 (EDT) 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 C927F6B000A; Thu, 25 Apr 2019 22:27:35 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by kanga.kvack.org (Postfix) with ESMTP id A7D996B0007 for ; Thu, 25 Apr 2019 22:27:35 -0400 (EDT) Received: by mail-qt1-f199.google.com with SMTP id j49so1626317qtk.19 for ; Thu, 25 Apr 2019 19:27:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=aATYrCxRlNMszFJ57g3u99UUP818320yu7bmbbR1Mt4=; b=Y+Ne6DMqsoXxzCiNhKSg0qqIFOggY36e7EnolXxW2b7usw4j3qci7waL3jHjjZlk4D TY9l3IYstGckEVpGHKsjhSYV3ATjS7Ohd5tjAraw76pLs9PPi09o5JDtQFlkUNtos8ub 3IE0gLii5SFh4jNrZ92aFpM0afeYpAvESF17PX+fji7cbV2gGWHR6o3NzLQw8bRaM3Di z8PY0dhrLY5Qx4/FADUSCtQc9DVUIC/WBd5Domc3SuDikF8cwx90ZEDCtGDxaP/EskbA kulQLhy6nXy9vQ7I9gmnei57yAgi75TQQwDZAS5F/su1xCroDmqxZ5DHnQVSUfzew4lf ifOA== X-Gm-Message-State: APjAAAXuz+zUR/bs45hDsV2pfzjLozcOc5z5sS4H6JQIwal9BVYF9DkE zB6PUmHthtmewQF+7uQdEEilDCyI81Gab9eC3BZVB3HfRRdKqqQ+f8yEcIPz437EHROWwAs1aAr M2nV1AJhYup0dYYl3eB46lOf+IZWUuuDKHTWq2P6CUxt7/0PWQVEI0Da4RuwGEFg= X-Received: by 2002:a37:8fc3:: with SMTP id r186mr33957507qkd.102.1556245655455; Thu, 25 Apr 2019 19:27:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqzOaftDGbrT3tTx/jYEMHsG+KYRUTHmTwr/08IGa5MLwDvaycehR8aKiVLVgzMwS/N3Nbol X-Received: by 2002:a37:8fc3:: with SMTP id r186mr33957458qkd.102.1556245654378; Thu, 25 Apr 2019 19:27:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556245654; cv=none; d=google.com; s=arc-20160816; b=fIdjIE+kAJLx2Yg6zDcGoU9CrZZvVr46Dc6CUuTkbGfBVG0e3DY0dbDCJC+CgiOY5k bQOccHXqiAZvu+V9tJgQKjgZHxJVQ/RBCuJ5N3I3f6vTpc4t/rcgun0i3avjHp3tOVLK 8tPts7pF5DIq//UntDLSDKRPkCL6HJ+hK+y7W8lITAsC7gHx5bbZ+X2W3lTDD+7HdEJC cMLeg12xDoliA3IwG9Dxe/ZgD+I0k6VQ+yc6FNRJZUlxkvlBuj1TuRBRxcgrH2JZDQCb NHRdwneVlClxXE68OpD8H4QuJww6nSwAg+dYIaDYaT3hTA5Uf9SYbsgv5rCHzvFk6/+F 8deQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=aATYrCxRlNMszFJ57g3u99UUP818320yu7bmbbR1Mt4=; b=Bxj2xSrhxKmKo9P2N4oqg2UM8owz1zsvRDnc02erqq5YHRmNm2IF7xd7x1D1lo34rj vU3YZqtx4PkaXZQvg5Sudk2ybJ+bjynHqljMvvIC806mddPyftPaBaQ3mo+DPJ4QnrdW uNwJkfdKPvEG/RYCyg39+/9Q9AFelsyQV+Ek1g12lFWZnF9BGaMbtJIQKJnyQ1rTrWeK nY1neJrnJd/VXLAb4S1lzsEsQYgGJ0D3571MkxnTlsY/HnJW+nBDAnFqQjY0nX5rKx5R v5IsGFN/rrbHv5zxfBM1BA42f8IjXmsygj4FD14KnkEy5KWvsvPgPwK+fT15UB4qpXG7 7psw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=68vQh+yi; spf=softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.221 as permitted sender) smtp.mailfrom=tobin@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from new1-smtp.messagingengine.com (new1-smtp.messagingengine.com. [66.111.4.221]) by mx.google.com with ESMTPS id g15si5333454qki.133.2019.04.25.19.27.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Apr 2019 19:27:34 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.221 as permitted sender) client-ip=66.111.4.221; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=68vQh+yi; spf=softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.221 as permitted sender) smtp.mailfrom=tobin@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 0D24710FA2; Thu, 25 Apr 2019 22:27:34 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 25 Apr 2019 22:27:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=aATYrCxRlNMszFJ57g3u99UUP818320yu7bmbbR1Mt4=; b=68vQh+yi M75/HLJuUgg97N18rXVBRlHToOk742865TAoiRxWPyqFG95mjm3E1uVuLFsiRLAb ABG5WUNf5jgQSzekVQs/9nDOXKVGCVOnUArwPFrh0awYu8ci3FP634CLHaJBhw3l 6RmMNRAFD9kyEY3rm9PVwfvLQTlWTwuORh2yMtwL1Q5YZiS4ccHYbWv0/y7+NDJb Y/KS23rBvGHqQycUP5jhobVbGU6iAAx2Ushd3IpWLsw9sTtG5PUML+VkO+Yl9laK puyiw1HZF2rnA8OuIreveUWdo0/p+TbSqIu2mDBUaMk4JpTcfikINciam/RbI0qh 9zw7LoJdGLb1Kg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrheehgdehlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepfdfvohgsihhn ucevrdcujfgrrhguihhnghdfuceothhosghinheskhgvrhhnvghlrdhorhhgqeenucfkph epuddvgedrudeiledrudehledrvddutdenucfrrghrrghmpehmrghilhhfrhhomhepthho sghinheskhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgepud X-ME-Proxy: Received: from eros.localdomain (124-169-159-210.dyn.iinet.net.au [124.169.159.210]) by mail.messagingengine.com (Postfix) with ESMTPA id 70F8F103C8; Thu, 25 Apr 2019 22:27:28 -0400 (EDT) From: "Tobin C. Harding" To: Andrew Morton Cc: "Tobin C. Harding" , Jesper Dangaard Brouer , Pekka Enberg , Vlastimil Babka , Christoph Lameter , David Rientjes , Joonsoo Kim , Tejun Heo , Qian Cai , Linus Torvalds , Mel Gorman , Alexander Duyck , Michal Hocko , Brendan Gregg , linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] tools/vm/slabinfo: Add partial slab listing to -X Date: Fri, 26 Apr 2019 12:26:20 +1000 Message-Id: <20190426022622.4089-3-tobin@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190426022622.4089-1-tobin@kernel.org> References: <20190426022622.4089-1-tobin@kernel.org> MIME-Version: 1.0 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: X-Virus-Scanned: ClamAV using ClamSMTP We would like to see how fragmented the SLUB allocator is, one window into fragmentation is the total number of partial slabs. Currently `slabinfo -X` shows slabs sorted by loss and by size. We can use this option to also show slabs sorted by number of partial slabs. Option '-X' can be used in conjunction with '-N' to control the number of slabs shown e.g. list of top 5 slabs: slabinfo -X -N5 Add list of slabs ordered by number of partial slabs to output of `slabinfo -X`. Signed-off-by: Tobin C. Harding --- tools/vm/slabinfo.c | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/tools/vm/slabinfo.c b/tools/vm/slabinfo.c index e9b5437b2f28..3f3a2db65794 100644 --- a/tools/vm/slabinfo.c +++ b/tools/vm/slabinfo.c @@ -79,6 +79,7 @@ int sort_size; int sort_active; int set_debug; int show_ops; +int sort_partial; int show_activity; int output_lines = -1; int sort_loss; @@ -1047,6 +1048,8 @@ static void sort_slabs(void) result = slab_activity(s1) < slab_activity(s2); else if (sort_loss) result = slab_waste(s1) < slab_waste(s2); + else if (sort_partial) + result = s1->partial < s2->partial; else result = strcasecmp(s1->name, s2->name); @@ -1307,27 +1310,39 @@ static void output_slabs(void) } } +static void _xtotals(char *heading, char *underline, + int loss, int size, int partial) +{ + printf("%s%s", heading, underline); + line = 0; + sort_loss = loss; + sort_size = size; + sort_partial = partial; + sort_slabs(); + output_slabs(); +} + static void xtotals(void) { + char *heading, *underline; + totals(); link_slabs(); rename_slabs(); - printf("\nSlabs sorted by size\n"); - printf("--------------------\n"); - sort_loss = 0; - sort_size = 1; - sort_slabs(); - output_slabs(); + heading = "\nSlabs sorted by size\n"; + underline = "--------------------\n"; + _xtotals(heading, underline, 0, 1, 0); + + heading = "\nSlabs sorted by loss\n"; + underline = "--------------------\n"; + _xtotals(heading, underline, 1, 0, 0); + + heading = "\nSlabs sorted by number of partial slabs\n"; + underline = "---------------------------------------\n"; + _xtotals(heading, underline, 0, 0, 1); - printf("\nSlabs sorted by loss\n"); - printf("--------------------\n"); - line = 0; - sort_loss = 1; - sort_size = 0; - sort_slabs(); - output_slabs(); printf("\n"); } From patchwork Fri Apr 26 02:26:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tobin C. Harding" X-Patchwork-Id: 10917985 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B32C676 for ; Fri, 26 Apr 2019 02:27:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A220528D07 for ; Fri, 26 Apr 2019 02:27:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9633128D7D; Fri, 26 Apr 2019 02:27:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C5D428D07 for ; Fri, 26 Apr 2019 02:27:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 25B2B6B000A; Thu, 25 Apr 2019 22:27:42 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 20A6D6B000C; Thu, 25 Apr 2019 22:27:42 -0400 (EDT) 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 0D2206B000D; Thu, 25 Apr 2019 22:27:42 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by kanga.kvack.org (Postfix) with ESMTP id E25BC6B000A for ; Thu, 25 Apr 2019 22:27:41 -0400 (EDT) Received: by mail-qt1-f199.google.com with SMTP id f20so1675201qtf.3 for ; Thu, 25 Apr 2019 19:27:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=U8DAYh6kKcmZLs62Z24hf1Yov5/xwP/SyAoz3HiKdRQ=; b=HedzMLBH1uUCTnlYK3u6r6dKbEOkHxzRu+Fm0dIiJlYcutBqdWVTm/CRnhxCZ9izNC YEJ+7OXojv7P6wTqa9qxMtJL7jB+BDeGzc2avUAyC3iY+OsYparxrqobg5ZhUM1ZWCDf wWs7XeRyNfmN7MW5w3QgnSPKkzEHx36wNMzpCswA7kyrIXwoh/WKv4sVPTnf8BXheKJc F6ygXOwZ1QNBX+Yie5ZoGprlrnI6PCckzlaG3UFD9cB0TeqrSw/YkzvH2FCeO7kYN/+s lpaAQpwssIqCv8a20r/n1Nsfjr0zqTPrf5cduWLSKWJZ5nPomo3VKIpzfGFvKx19EeJ3 mYoQ== X-Gm-Message-State: APjAAAXIBWtDYmVtHD2ZGUZ8BavKtIJM5SHiB6ZNfZrau05Zwy0u3Cae X2EjKyLeyccPPv53IxKdNJthsJ9kiYoYSoy+MOey1ZbL7YsJ1wzCXcnkMp3c/y/vKaq8iD9jMKg kKosvizfwt1wb547XaRqKYvsE4nKXKzsqhrWAispTOiEZUpkvbG5RuJZp16P4GBE= X-Received: by 2002:a37:8fc3:: with SMTP id r186mr33957754qkd.102.1556245661696; Thu, 25 Apr 2019 19:27:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqwg9goui3j5xp/PKw42qYwB7G47VZ9awF4+G9aoL13kTS4sJ2Fd1uROc0h3B9IPLHosJj3Z X-Received: by 2002:a37:8fc3:: with SMTP id r186mr33957699qkd.102.1556245660392; Thu, 25 Apr 2019 19:27:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556245660; cv=none; d=google.com; s=arc-20160816; b=wTPDgee+bHniiG/PaU/P99SgbfNKpC+nuUFe3P0QV+kZgsxESmlXCrkf8uTTiTGk5q TiGrrRINoatWilJ796TH0AbD0C5hPQYYAnVkicNXBIibWqiFw0xkhJab1JanNWFW19BM RWk0xP19qiO7rG/Tq7u71GTvnLdGiCD1azgBZOsIZDUJkN0fDuk5dtvVnP7mSeDoT1mn uUN7hiX1Jodref2VcKQQwY8easydjcUgCuy5TH4w189QW7TtOaspmWqLFyLJV45pmuKm drJGk8uLZgXUGiaCkD1f6lzOxX5rLv+tyZ6Wh7e/5se09tXwjkOIOMVFYGrjE+YkH+Qr +LDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=U8DAYh6kKcmZLs62Z24hf1Yov5/xwP/SyAoz3HiKdRQ=; b=Fi0duHXV5R2j+gai0O12Pm7L/Zigw+8nXei33ysV9Yi1mDf53e6rReSRx2CDkKxSSN USOluZkHcKOlS2OW10azaHT/+RMC+1olffa1co5az1jf2PfOLgrTkRNWgWtcGouUWxPY Ye9j2Anp2wrMWk+PEXbqIAgu87ftPvyxaKSeXwoYAM2BiWXOZdbwbxuXbIrcXJBOplTX RIgaw2S8OYNCtxu+KsjnEM480bF7OHClWMTqAQ8XMezXrMKKPPKdGEn9oTPhb5QuMwa3 9gbp+b5eQ62nMcGMNDLeuZy+7BuApxR2GQPqDyfl4/xG923iBbQJBPToCEMTpryKzpIv AWJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=kFld8fwp; spf=softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.221 as permitted sender) smtp.mailfrom=tobin@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from new1-smtp.messagingengine.com (new1-smtp.messagingengine.com. [66.111.4.221]) by mx.google.com with ESMTPS id x52si3908206qtb.297.2019.04.25.19.27.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Apr 2019 19:27:40 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.221 as permitted sender) client-ip=66.111.4.221; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=kFld8fwp; spf=softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.221 as permitted sender) smtp.mailfrom=tobin@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 25647CF14; Thu, 25 Apr 2019 22:27:40 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 25 Apr 2019 22:27:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=U8DAYh6kKcmZLs62Z24hf1Yov5/xwP/SyAoz3HiKdRQ=; b=kFld8fwp rxzL8gfIGZm/CBp7C83dBBFHEi/PmjGVz507ngjQMOb4MD+DTc1Q/Y7ELtkaE4LA XADpf1vw8+flbXwPL73uRfr4e3Pwg+S/fX82Cm3Nuu5inaI80LLhaHJ5kEP56VHj YisxlLXZfcia0qtoq5RuSRQ1QSkuO+W+tDsTJMF3T71CgJutzsX2cqt50hO3qF24 auMlBW4TEePdc8dj4MMgKoASjbsRnRHGfZFp8FMebISzhdkLmRiOCK8SEuLQV5wN xvOTQSInBiU15oVGCGgVZd2B5jD+YNPANqnOxqpa1lu3m+WdMgmr0zSoVKMShfgl 07ORxrfp9CY2dw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrheehgdehlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepfdfvohgsihhn ucevrdcujfgrrhguihhnghdfuceothhosghinheskhgvrhhnvghlrdhorhhgqeenucfkph epuddvgedrudeiledrudehledrvddutdenucfrrghrrghmpehmrghilhhfrhhomhepthho sghinheskhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgepvd X-ME-Proxy: Received: from eros.localdomain (124-169-159-210.dyn.iinet.net.au [124.169.159.210]) by mail.messagingengine.com (Postfix) with ESMTPA id 9D1F7103CF; Thu, 25 Apr 2019 22:27:34 -0400 (EDT) From: "Tobin C. Harding" To: Andrew Morton Cc: "Tobin C. Harding" , Jesper Dangaard Brouer , Pekka Enberg , Vlastimil Babka , Christoph Lameter , David Rientjes , Joonsoo Kim , Tejun Heo , Qian Cai , Linus Torvalds , Mel Gorman , Alexander Duyck , Michal Hocko , Brendan Gregg , linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] tools/vm/slabinfo: Add option to sort by partial slabs Date: Fri, 26 Apr 2019 12:26:21 +1000 Message-Id: <20190426022622.4089-4-tobin@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190426022622.4089-1-tobin@kernel.org> References: <20190426022622.4089-1-tobin@kernel.org> MIME-Version: 1.0 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: X-Virus-Scanned: ClamAV using ClamSMTP We would like to get a better view of the level of fragmentation within the SLUB allocator. Total number of partial slabs is an indicator of fragmentation. Add a command line option (-P | --partial) to sort the slab list by total number of partial slabs. Signed-off-by: Tobin C. Harding --- tools/vm/slabinfo.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/vm/slabinfo.c b/tools/vm/slabinfo.c index 3f3a2db65794..469ff6157986 100644 --- a/tools/vm/slabinfo.c +++ b/tools/vm/slabinfo.c @@ -111,7 +111,7 @@ static void fatal(const char *x, ...) static void usage(void) { printf("slabinfo 4/15/2011. (c) 2007 sgi/(c) 2011 Linux Foundation.\n\n" - "slabinfo [-aABDefhilLnorsStTUvXz1] [N=K] [-dafzput] [slab-regexp]\n" + "slabinfo [-aABDefhilLnoPrsStTUvXz1] [N=K] [-dafzput] [slab-regexp]\n" "-a|--aliases Show aliases\n" "-A|--activity Most active slabs first\n" "-B|--Bytes Show size in bytes\n" @@ -125,6 +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" "-r|--report Detailed report on single slabs\n" "-s|--shrink Shrink slabs\n" "-S|--Size Sort by size\n" @@ -1361,6 +1362,7 @@ struct option opts[] = { { "numa", no_argument, NULL, 'n' }, { "lines", required_argument, NULL, 'N'}, { "ops", no_argument, NULL, 'o' }, + { "partial", no_argument, NULL, 'p'}, { "report", no_argument, NULL, 'r' }, { "shrink", no_argument, NULL, 's' }, { "Size", no_argument, NULL, 'S'}, @@ -1382,7 +1384,7 @@ int main(int argc, char *argv[]) page_size = getpagesize(); - while ((c = getopt_long(argc, argv, "aABd::DefhilLnN:orsStTUvXz1", + while ((c = getopt_long(argc, argv, "aABd::DefhilLnN:oPrsStTUvXz1", opts, NULL)) != -1) switch (c) { case 'a': @@ -1436,6 +1438,9 @@ int main(int argc, char *argv[]) case 'r': show_report = 1; break; + case 'P': + sort_partial = 1; + break; case 's': shrink = 1; break; From patchwork Fri Apr 26 02:26:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tobin C. Harding" X-Patchwork-Id: 10917987 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5756E76 for ; Fri, 26 Apr 2019 02:27:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4328928C5E for ; Fri, 26 Apr 2019 02:27:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 326B828D2F; Fri, 26 Apr 2019 02:27:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC3D028C5E for ; Fri, 26 Apr 2019 02:27:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A97E36B000D; Thu, 25 Apr 2019 22:27:47 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id A47D06B000E; Thu, 25 Apr 2019 22:27:47 -0400 (EDT) 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 9105A6B0010; Thu, 25 Apr 2019 22:27:47 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by kanga.kvack.org (Postfix) with ESMTP id 6F3FA6B000D for ; Thu, 25 Apr 2019 22:27:47 -0400 (EDT) Received: by mail-qt1-f197.google.com with SMTP id t23so1646791qtj.13 for ; Thu, 25 Apr 2019 19:27:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=QQkx/gI38BRanILmeGSHvkh1ypHOhw/OGbmPVvX1nTs=; b=QQZGP3RFhKSAC2OFk7ZNwL5u/gGIMAR8E4g2GYtwk4pgl1VZZFrE2M25B098fV1u5K lGh3rog2uHeybNq4aZhMszQ1MpVPAQCwj3GE94nKePKe1iqEvLn7aGDbUK4MqPKTZFk8 ib2bQ5f0a2FKGfTgjKpQc9Nd6y7RKmEFgEesAg7ONe1ES0dcX6KK6omutK/7rQQpD70g dqc4S1TSv+kvC6xqr1PwiNkbnvf0c6a3L8AMdv3QLvKdWMk80AFoUnPunTmF1wa1LCRt jFnmd6I/XVDwtR7URraIo0C6lTylCOtEZXD6hXiMThXYiYMO76n0y9KkxWDlZQnwwDZ9 BzFg== X-Gm-Message-State: APjAAAU53R1qj2PhPAMPEMJjPvLjRSqD3fu4yrYEB3Iqv38VptKsjuBa KaYfnG0/PxvIS3ZISymeBQ5A8JVN8MNNvbp4k3imiBV8HEns+dWqygVjKuY3Bg/ae+CbDdad6yk cINuIPhWnY1iMU1QQhPAthx2K0qNsUtD0Zh84CedmjfhLY0CqmXQF4eqiEDk4tF0= X-Received: by 2002:ac8:1ab2:: with SMTP id x47mr8274418qtj.357.1556245667239; Thu, 25 Apr 2019 19:27:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyD02dhOdUeOh7E05e7IcAr0+wErvCmviuxz2lRsCOVffkeAOQtfRUPPoMyo3JwkDufM3xN X-Received: by 2002:ac8:1ab2:: with SMTP id x47mr8274384qtj.357.1556245666539; Thu, 25 Apr 2019 19:27:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556245666; cv=none; d=google.com; s=arc-20160816; b=cZOucz/hA1MLVpjil3rw3YoyCFNjy1a4e4RnsYdwvR804xxrmZaRBkMVPpkwzAhfh6 RspaVY8x7er6f9m8JMNHU7Jz7ei7L4Mnt5QJeqwuxKhinNUQ5BOhpMU3yGbzE2C9UtFR Xuo7BjDP1msDiDisgXHInTxakwHTiBGur8K58lftiPfPR0wkPsVV2cxW8uwOnm2C0EUE Iq/boLQ2CKA6sDgOHbWhBmLls77+Uq5iPeP2Qa57yTSgHkQ8//3vgojpcxVQ+KkgVKBB lk12uOd+JHFccKsNH5PHufHHqs4RNR5ZCt+9O+q5dBNdUVJ8jr0cAzgN/uTrQ0Jrrf5J YHiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=QQkx/gI38BRanILmeGSHvkh1ypHOhw/OGbmPVvX1nTs=; b=wMgVIpgJGm0Kat5d6BDPWOU4OM8PVk9vh77iTsDFmOhGSh4bH583kXcSrrGsv2xJan gZASG5iOoCSzD1BLx+HqRyzEYdZQBTvPxD++OKkkWRb/z6VGvPJSHM+crDyvdm6AhRse KZJ9tqj5Z6DJSf9v91/AN+uLgBPDjrxtPUo5c3GzFB51LJGLsjltR85YAL2L/iah8nKV 5EFSrZBBkKfZaQGmyTzkgytrpVw/kURXauFBbP5qyWPmMZEmQnzNYwaz8OT0rzJHRyoL 3LcTkyrwkB+2NnAepmjbLNiSn2cTJP7Gmt7DJ23sVAnduzsLbq2E60o2kLLt0OYmUZHj zLFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=qXdtKMep; spf=softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.221 as permitted sender) smtp.mailfrom=tobin@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from new1-smtp.messagingengine.com (new1-smtp.messagingengine.com. [66.111.4.221]) by mx.google.com with ESMTPS id z11si8083697qka.196.2019.04.25.19.27.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Apr 2019 19:27:46 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.221 as permitted sender) client-ip=66.111.4.221; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=qXdtKMep; spf=softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.221 as permitted sender) smtp.mailfrom=tobin@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 4704A1117A; Thu, 25 Apr 2019 22:27:46 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 25 Apr 2019 22:27:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=QQkx/gI38BRanILmeGSHvkh1ypHOhw/OGbmPVvX1nTs=; b=qXdtKMep 7JDjQV5xD/FEs7OSSrFz1KGr5mwvWUhM3f/Cxf7Ky9JhusqXXfdim9UkH3SQ9HqC kxlvNUvKjNyi+TNmoY8Yc9bkosj91gHOsHBNPlJY3zuRlodq+5y4ioLMiGtNBIIS 4cNadJCqn3IsZrqN1R8ssXsMHkHyRQp3pcpUSvSVDRxbkkX+dLFN9KqGFhJ4yPQi iWYK5Bid1+T10xKSE+56r6ieyGlPjSJfE3EfYHop169CUyfS44r79XHi2O1vRfLQ bM37OjrmD8Iqa8wg7XgHy5q6fB/6DXbejbk7fByMyWorBviIFlrzmqgxOKgL42Uo eeI8GS6eTZpviA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrheehgdehlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepfdfvohgsihhn ucevrdcujfgrrhguihhnghdfuceothhosghinheskhgvrhhnvghlrdhorhhgqeenucfkph epuddvgedrudeiledrudehledrvddutdenucfrrghrrghmpehmrghilhhfrhhomhepthho sghinheskhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgepfe X-ME-Proxy: Received: from eros.localdomain (124-169-159-210.dyn.iinet.net.au [124.169.159.210]) by mail.messagingengine.com (Postfix) with ESMTPA id B7D3C103D5; Thu, 25 Apr 2019 22:27:40 -0400 (EDT) From: "Tobin C. Harding" To: Andrew Morton Cc: "Tobin C. Harding" , Jesper Dangaard Brouer , Pekka Enberg , Vlastimil Babka , Christoph Lameter , David Rientjes , Joonsoo Kim , Tejun Heo , Qian Cai , Linus Torvalds , Mel Gorman , Alexander Duyck , Michal Hocko , Brendan Gregg , linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] tools/vm/slabinfo: Add sorting info to help menu Date: Fri, 26 Apr 2019 12:26:22 +1000 Message-Id: <20190426022622.4089-5-tobin@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190426022622.4089-1-tobin@kernel.org> References: <20190426022622.4089-1-tobin@kernel.org> MIME-Version: 1.0 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: X-Virus-Scanned: ClamAV using ClamSMTP Passing more than one sorting option has undefined behaviour. Add an explicit statement as such to the help menu, this also has the advantage of highlighting all the sorting options. Signed-off-by: Tobin C. Harding --- tools/vm/slabinfo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/vm/slabinfo.c b/tools/vm/slabinfo.c index 469ff6157986..68092d15e12b 100644 --- a/tools/vm/slabinfo.c +++ b/tools/vm/slabinfo.c @@ -148,6 +148,8 @@ static void usage(void) " p | P Poisoning\n" " u | U Tracking\n" " t | T Tracing\n" + + "\nSorting options (--Loss, --Size, --Partial) are mutually exclusive\n" ); }