lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <47AA2955.50502@cosmosbay.com>
Date:	Wed, 06 Feb 2008 22:40:37 +0100
From:	Eric Dumazet <dada1@...mosbay.com>
To:	Christoph Lameter <clameter@....com>
CC:	Andrew Morton <akpm@...ux-foundation.org>,
	Pekka Enberg <penberg@...helsinki.fi>,
	linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: SLUB: statistics improvements

Christoph Lameter a écrit :
> SLUB: statistics improvements
> 
> - Fix indentation in unfreeze_slab
> 
> - FREE_SLAB/ALLOC_SLAB counters were slightly misplaced and counted
>   even if the slab was kept because we were below the mininum of
>   partial slabs.
> 
> - Export per cpu statistics to user space (follow numa convention
>   but change the n character to c (no slabinfo support for display yet)
> 
> F.e.
> 
> christoph@...pp:/sys/kernel/slab/kmalloc-8$ cat alloc_fastpath
> 9968 c0=4854 c1=1050 c2=468 c3=190 c4=116 c5=1779 c6=185 c7=1326

nice :)

> 
> 
> +static int show_stat(struct kmem_cache *s, char *buf, enum stat_item si)
> +{
> +	unsigned long sum  = 0;
> +	int cpu;
> +	int len;
> +	int *data = kmalloc(nr_cpu_ids * sizeof(int), GFP_KERNEL);
> +
> +	if (!data)
> +		return -ENOMEM;
> +
> +	for_each_online_cpu(cpu) {
> +		int x = get_cpu_slab(s, cpu)->stat[si];

unsigned int x = ...

> +
> +		data[cpu] = x;
> +		sum += x;

or else x will sign extend here on 64 bit arches ?

> +	}
> +
> +	len = sprintf(buf, "%lu", sum);
> +
> +	for_each_online_cpu(cpu) {
> +		if (data[cpu] && len < PAGE_SIZE - 20)
> +			len += sprintf(buf + len, " c%d=%u", cpu, data[cpu]);
> +	}
> +	kfree(data);
> +	return len + sprintf(buf + len, "\n");
> +}
> +


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ