Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751551AbdITUph (ORCPT ); Wed, 20 Sep 2017 16:45:37 -0400 Received: from mail-pg0-f52.google.com ([74.125.83.52]:50466 "EHLO mail-pg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750919AbdITUpf (ORCPT ); Wed, 20 Sep 2017 16:45:35 -0400 X-Google-Smtp-Source: AOwi7QDJZJBysSDKSJQIVuNzczcLtYPX2piIqUXDidLHqtwRJjyfHyKUaUmqh4eLINwMl17qPBLjCA== Date: Wed, 20 Sep 2017 13:45:33 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Yang Shi cc: cl@linux.com, penberg@kernel.org, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, mhocko@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] tools: slabinfo: add "-U" option to show unreclaimable slabs only In-Reply-To: <1505934576-9749-2-git-send-email-yang.s@alibaba-inc.com> Message-ID: References: <1505934576-9749-1-git-send-email-yang.s@alibaba-inc.com> <1505934576-9749-2-git-send-email-yang.s@alibaba-inc.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1510 Lines: 52 On Thu, 21 Sep 2017, Yang Shi wrote: > diff --git a/tools/vm/slabinfo.c b/tools/vm/slabinfo.c > index b9d34b3..9673190 100644 > --- a/tools/vm/slabinfo.c > +++ b/tools/vm/slabinfo.c > @@ -83,6 +83,7 @@ struct aliasinfo { > int sort_loss; > int extended_totals; > int show_bytes; > +int unreclaim_only; > > /* Debug options */ > int sanity; > @@ -132,6 +133,7 @@ static void usage(void) > "-L|--Loss Sort by loss\n" > "-X|--Xtotals Show extended summary information\n" > "-B|--Bytes Show size in bytes\n" > + "-U|--unreclaim Show unreclaimable slabs only\n" > "\nValid debug options (FZPUT may be combined)\n" > "a / A Switch on all debug options (=FZUP)\n" > "- Switch off all debug options\n" I suppose this should be s/unreclaim/Unreclaim/ > @@ -568,6 +570,9 @@ static void slabcache(struct slabinfo *s) > if (strcmp(s->name, "*") == 0) > return; > > + if (unreclaim_only && s->reclaim_account) > + return; > + > if (actual_slabs == 1) { > report(s); > return; > @@ -1346,6 +1351,7 @@ struct option opts[] = { > { "Loss", no_argument, NULL, 'L'}, > { "Xtotals", no_argument, NULL, 'X'}, > { "Bytes", no_argument, NULL, 'B'}, > + { "unreclaim", no_argument, NULL, 'U'}, > { NULL, 0, NULL, 0 } > }; > Same. After that: Acked-by: David Rientjes Also, you may find it better to remove the "RFC" tag from the patchset's header email since it's agreed that we want this.