Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756960AbYBEHuT (ORCPT ); Tue, 5 Feb 2008 02:50:19 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756732AbYBEHuA (ORCPT ); Tue, 5 Feb 2008 02:50:00 -0500 Received: from neuf-infra-smtp-out-sp604007av.neufgp.fr ([84.96.92.120]:38346 "EHLO neuf-infra-smtp-out-sp604007av.neufgp.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753053AbYBEHt7 (ORCPT ); Tue, 5 Feb 2008 02:49:59 -0500 Message-ID: <47A81513.4010301@cosmosbay.com> Date: Tue, 05 Feb 2008 08:49:39 +0100 From: Eric Dumazet User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Pekka J Enberg CC: Christoph Lameter , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: SLUB: Support for statistics to help analyze allocator behavior References: 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: 1090 Lines: 31 Pekka J Enberg a ?crit : > Hi Christoph, > > On Mon, 4 Feb 2008, Christoph Lameter wrote: >> The statistics provided here allow the monitoring of allocator behavior >> at the cost of some (minimal) loss of performance. Counters are placed in >> SLUB's per cpu data structure that is already written to by other code. > > Looks good but I am wondering if we want to make the statistics per-CPU so > that we can see the kmalloc/kfree ping-pong of, for example, hackbench > better? AFAIK Christoph patch already have percpu statistics :) +#define STAT_ATTR(si, text) \ +static ssize_t text##_show(struct kmem_cache *s, char *buf) \ +{ \ + unsigned long sum = 0; \ + int cpu; \ + \ + for_each_online_cpu(cpu) \ + sum += get_cpu_slab(s, cpu)->stat[si]; \ + return sprintf(buf, "%lu\n", sum); \ +} \ -- 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/