Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1472185

Re: [PATCH v4 resend] mm/slab: Improve performance of gathering slabinfo stats

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4 resend] mm/slab: Improve performance of gathering slabinfo stats
Date 2016-08-30 03:10 +0200
Message-ID <sbFIR-6oh-3@gated-at.bofh.it> (permalink)
References <sbFpw-62D-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, 2016-08-29 at 17:44 -0700, Aruna Ramakrishna wrote:
> This patch optimizes 'cat /proc/slabinfo' by maintaining a counter for
> total number of allocated slabs per node, per cache.
[]
> We tested this after
> growing the dentry cache to 70GB, and the performance improved from 2s to
> 5ms.

Seems sensible, thanks.

One completely trivial note:
> diff --git a/mm/slab.c b/mm/slab.c
[]
> @@ -1394,24 +1395,27 @@ slab_out_of_memory(struct kmem_cache *cachep, gfp_t gfpflags, int nodeid)
>  	for_each_kmem_cache_node(cachep, node, n) {
>  		unsigned long active_objs = 0, num_objs = 0, free_objects = 0;
>  		unsigned long active_slabs = 0, num_slabs = 0;
> +		unsigned long num_slabs_partial = 0, num_slabs_free = 0;
> +		unsigned long num_slabs_full;
[]
> +		num_slabs_full = num_slabs -
> +			(num_slabs_partial + num_slabs_free);

vs

> @@ -4111,6 +4119,8 @@ void get_slabinfo(struct kmem_cache *cachep, struct slabinfo *sinfo)
>  	unsigned long num_objs;
>  	unsigned long active_slabs = 0;
>  	unsigned long num_slabs, free_objects = 0, shared_avail = 0;
> +	unsigned long num_slabs_partial = 0, num_slabs_free = 0;
> +	unsigned long num_slabs_full = 0;
[]
> +	num_slabs_full = num_slabs - (num_slabs_partial + num_slabs_free);

It seems odd to have different initialization styles
for num_slabs_full.  It seems the second one doesn't
need to be initialized.

It'd also be nicer I think if the two declarations
blocks had more similar layouts.

Maybe in a follow-on patch.  Or not.  Your choice.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v4 resend] mm/slab: Improve performance of gathering slabinfo stats Aruna Ramakrishna <aruna.ramakrishna@oracle.com> - 2016-08-30 02:50 +0200
  Re: [PATCH v4 resend] mm/slab: Improve performance of gathering  slabinfo stats Aruna Ramakrishna <aruna.ramakrishna@oracle.com> - 2016-08-30 02:50 +0200
  Re: [PATCH v4 resend] mm/slab: Improve performance of gathering  slabinfo stats Joe Perches <joe@perches.com> - 2016-08-30 03:10 +0200

csiph-web