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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux