From patchwork Mon Jun 3 04:26:28 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: 10972213 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 E87A61515 for ; Mon, 3 Jun 2019 04:28:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D8D2228385 for ; Mon, 3 Jun 2019 04:28:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC08E28174; Mon, 3 Jun 2019 04:28:20 +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 58DF628174 for ; Mon, 3 Jun 2019 04:28:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5DE416B026A; Mon, 3 Jun 2019 00:28:19 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 5B7C36B0271; Mon, 3 Jun 2019 00:28:19 -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 4A7936B0272; Mon, 3 Jun 2019 00:28:19 -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 2CB586B026A for ; Mon, 3 Jun 2019 00:28:19 -0400 (EDT) Received: by mail-qt1-f199.google.com with SMTP id z16so6499112qto.10 for ; Sun, 02 Jun 2019 21:28:19 -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=eB8W4ZifzOOx7n477C9lsHSgteznueDWRYbTVC4RGG4=; b=I0uSbvoSbvWkj+RnhubY9vN6KVomjpVhK9fTbQPZ6P5a9VGjeS+QJHcHqhZEst94NW fOwAhxpMHH9ltoNAzCnT+LRJVMxrcBDPqJO4qYxAPDKQ7TOqAAB0qMQKc252JFv8+Q30 VVLpoc8LRCSdxsrBnusR89wRyMxHP14qpL58HVSy/A1T8VF+9Jbl5iJu1zdzu7ordG6R cnpNMlm2zt11NRte1Lh6cz8DvtxDuvyN0L3ujW/kCrc17fdBull0mgiPvmg+2U6Fynt3 SQef+1RTeKmLUzvbAChu65RqXA1DBDsXXNftlX7kV6SE0i7KaqIz3z1qKjhhUwyME4Dn uBGQ== X-Gm-Message-State: APjAAAUsqAF4cORazEWF/cELNm1tgKKg+ZQZJDOgItVR8/QochyfBVnG P80Id1wIrq96NxeLpApryf2N12iKBVFuhLiGBhWPMkRJgezBPOyETxN0EjprlpWpvhMqO+KMhte 0XPq0ShVPxXam1Yy/xHKbVyxrzt6QYnBGo28CJzM22XVbOqqmWq7oApzP1UncePg= X-Received: by 2002:a0c:fcc6:: with SMTP id i6mr9543104qvq.109.1559536098939; Sun, 02 Jun 2019 21:28:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOTpjhCS4n9ScPTSH+qieBgRjGKoj/37kNiPvf+DK+Xwh6elqGCHKl8iwG45AQi6pl8r/6 X-Received: by 2002:a0c:fcc6:: with SMTP id i6mr9543068qvq.109.1559536098093; Sun, 02 Jun 2019 21:28:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559536098; cv=none; d=google.com; s=arc-20160816; b=KoXpRdmdOJFMuFQKl7YZi7OLLvpOm2SuECATSLNjBQRqK70SuRMJESY6wjZfDrhStW wdUTODQMiL9PNRC/AH31bZ7gIHxJ3sPZr3xK1q6MG2Bbk8DUCooEFEUdJaMilm0Pk4UI B3o7Cnbf8j24mhiocqO620D0zBUDPPkFrocyfsWEfudr4cZvWUte/ipvuUccgq22MJev 17CaPUXsSX2xHkaMo7gtw85Wl8tMqonpm9Di7TE6ad04G1VhuaXm/4gVR/sUv0K93eMz 8PB+2tQ4d/a6ctUwSHvbfqMN6bhujKqObZaefquCni5ygZoJTHgf8doy9/baFH/fXgCH MJ1Q== 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=eB8W4ZifzOOx7n477C9lsHSgteznueDWRYbTVC4RGG4=; b=O4inlAWb/f1pJY3jFYX6NVzWM3gWicRTJ7JeE9SXUKPFAWDPJScRernGcG2VlTOYsi Pbz2WNZnIi7yK7dMhhX4GdWrUOZbylLUIviHdRpEzYv2DsrCmnyhPpTS4uZV9hsshW5r W5CfqaAp6aBA9nNuL2j8xNmheSAHuXIa8fthIZY6Dnjf0NbthTNbA/5tbqiLOnlfgqg8 /AMfUUe3zuVyFcSmBo6Ojb9VcLyUyZQnDxzDZ6zzl5k3Hbp+ZkSD7qGyA9IT48MeCbik S7uqoKjSa/D/6gMEA4wy0enPTn5yiOAGp4N7dZKU112MNbMbUN4aVTbcxCc0EXhaYz8b brVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=h8lhB1kH; spf=softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.230 as permitted sender) smtp.mailfrom=tobin@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com. [66.111.4.230]) by mx.google.com with ESMTPS id q5si1009048qke.271.2019.06.02.21.28.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Jun 2019 21:28:18 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.230 as permitted sender) client-ip=66.111.4.230; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=h8lhB1kH; spf=softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.230 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 D64B415E4; Mon, 3 Jun 2019 00:28:17 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 03 Jun 2019 00:28:17 -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=eB8W4ZifzOOx7n477C9lsHSgteznueDWRYbTVC4RGG4=; b=h8lhB1kH /ZzWq7shkCDu3x1p3MQLgFcheSThypTFlbmAunpKVRrTI+jS3wEx0oXjx1+h4vae osoL6PSLNto2hLwr/Oqkoq9YUQ4/Ilv19G4cbmgdd/fe2oZ8QwkalEhSlW+fhfe0 78jdTuCqOqOjx5O1ekAIDMFSnqksJyvWPvmUfHSE1kYsHDlWzcY/CIGHeH7z3O/f 7f8EP/7M9IMXnrQQcoQ1jnISJkxFZKEp0KbxSVO5aU2648H3JH3VCqb5LP1aN3xY kytxgvMZjJY614JPtc0ry8yak8OPJjPoI4i+Kzdn/KwuUx/PPUx15JGQeBWK05ju LaW42Ofr9GVSGg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrudefiedgkedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpedfvfhosghi nhcuvedrucfjrghrughinhhgfdcuoehtohgsihhnsehkvghrnhgvlhdrohhrgheqnecukf hppeduvdegrddugeelrdduudefrdefieenucfrrghrrghmpehmrghilhhfrhhomhepthho sghinheskhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from eros.localdomain (124-149-113-36.dyn.iinet.net.au [124.149.113.36]) by mail.messagingengine.com (Postfix) with ESMTPA id AEE378005C; Mon, 3 Jun 2019 00:28:10 -0400 (EDT) From: "Tobin C. Harding" To: Andrew Morton Cc: "Tobin C. Harding" , Roman Gushchin , Alexander Viro , Christoph Hellwig , Pekka Enberg , David Rientjes , Joonsoo Kim , Christopher Lameter , Miklos Szeredi , Andreas Dilger , Waiman Long , Tycho Andersen , Theodore Ts'o , Andi Kleen , David Chinner , Nick Piggin , Rik van Riel , Hugh Dickins , Jonathan Corbet , Matthew Wilcox , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 06/15] tools/vm/slabinfo: Add defrag_used_ratio output Date: Mon, 3 Jun 2019 14:26:28 +1000 Message-Id: <20190603042637.2018-7-tobin@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190603042637.2018-1-tobin@kernel.org> References: <20190603042637.2018-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 Add output for the newly added defrag_used_ratio sysfs knob. Signed-off-by: Tobin C. Harding --- tools/vm/slabinfo.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/vm/slabinfo.c b/tools/vm/slabinfo.c index d2c22f9ee2d8..ef4ff93df4cc 100644 --- a/tools/vm/slabinfo.c +++ b/tools/vm/slabinfo.c @@ -34,6 +34,7 @@ struct slabinfo { unsigned int sanity_checks, slab_size, store_user, trace; int order, poison, reclaim_account, red_zone; int movable, ctor; + int defrag_used_ratio; int remote_node_defrag_ratio; unsigned long partial, objects, slabs, objects_partial, objects_total; unsigned long alloc_fastpath, alloc_slowpath; @@ -549,6 +550,8 @@ static void report(struct slabinfo *s) printf("** Slabs are destroyed via RCU\n"); if (s->reclaim_account) printf("** Reclaim accounting active\n"); + if (s->movable) + printf("** Defragmentation at %d%%\n", s->defrag_used_ratio); printf("\nSizes (bytes) Slabs Debug Memory\n"); printf("------------------------------------------------------------------------\n"); @@ -1279,6 +1282,7 @@ static void read_slab_dir(void) slab->deactivate_bypass = get_obj("deactivate_bypass"); slab->remote_node_defrag_ratio = get_obj("remote_node_defrag_ratio"); + slab->defrag_used_ratio = get_obj("defrag_used_ratio"); chdir(".."); if (read_slab_obj(slab, "ops")) { if (strstr(buffer, "ctor :"))