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

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

 



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.

--
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]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]