Re: [PATCH 1/2] tools: slabinfo: add "-U" option to show unreclaimable slabs only

From: Yang Shi
Date: Wed Sep 20 2017 - 17:28:54 EST




On 9/20/17 1:45 PM, David Rientjes wrote:
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 <rientjes@xxxxxxxxxx>

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.

Thanks, will get fixed in v4.

Yang