Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759569AbYBFVlT (ORCPT ); Wed, 6 Feb 2008 16:41:19 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752680AbYBFVlF (ORCPT ); Wed, 6 Feb 2008 16:41:05 -0500 Received: from neuf-infra-smtp-out-sp604003av.neufgp.fr ([84.96.92.124]:39553 "EHLO neuf-infra-smtp-out-sp604003av.neufgp.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758873AbYBFVlE (ORCPT ); Wed, 6 Feb 2008 16:41:04 -0500 Message-ID: <47AA2955.50502@cosmosbay.com> Date: Wed, 06 Feb 2008 22:40:37 +0100 From: Eric Dumazet User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Christoph Lameter CC: Andrew Morton , Pekka Enberg , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: SLUB: statistics improvements References: <20080206001948.6f749aa8.akpm@linux-foundation.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1505 Lines: 61 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@stapp:/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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/