From patchwork Tue Nov 22 19:46:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Christoph Lameter (Ampere)" X-Patchwork-Id: 127154 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A1DC61007D1 for ; Wed, 23 Nov 2011 06:46:58 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755075Ab1KVTqT (ORCPT ); Tue, 22 Nov 2011 14:46:19 -0500 Received: from smtp102.prem.mail.ac4.yahoo.com ([76.13.13.41]:20493 "HELO smtp102.prem.mail.ac4.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754681Ab1KVTqQ (ORCPT ); Tue, 22 Nov 2011 14:46:16 -0500 Received: (qmail 69123 invoked from network); 22 Nov 2011 19:46:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1321991175; bh=P/lF3dHwtxncxE4kn28UTe05n1JM9vFy7fitoca//V8=; h=X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Received:Date:From:X-X-Sender:To:cc:Subject:In-Reply-To:Message-ID:References:User-Agent:MIME-Version:Content-Type; b=Lcc1LzSr/RbmhQhLNnnGULE6y4t5BDVEYmCECVWDRepIn4nYsHLHuoX+SAGMWOKJi41QcvpYPngIoLch9fNnpv7JaVasXFZOcFeNTPDMg+bkLW4dlV8cunZl3c+p5riBnXV2/knBTJAgmMYI3BOlh3ADy9BDIJ1+UPFQiT1NW24= X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 8Za12TQVM1nyVyyCH.vwc9xHCO_mtZBr.klOmkC5DM10TWB xrN2kYlbgN3xrK3PKLxsSHKDNWqcBaHT.9NDu5suBD2FvvMjx82NV5cOEeZ2 yIB0QjFgomdcFDDKoFX4xicLT36d4Y_XTEZ9QzsJ2lpmtrIcFMP7cuJll1Vq Q2_izcwFFRodmbHzd5oFTM4V6YOuQLcF9W8FaHf5IN8NyXblHXUE.9fKE77e 1GXNeCJIrOdjeP5emBxqgbFJ7LHEdqcJTI5oypEnSmvdTiQ7stpUfB80njb7 PNTKZy1cR.jniNmDmrW8pCwCHN1QWUDj93ijZk49JkJgoCEyihyPcWD8OtMw hMjeUR7GqlGJ6VjK9CdyenzB6BCLMry3fxpG7ayYOC8WYkVSoV9K6Ubxt7UU _CHUW.dP1vzG8_jbT0JscCw-- X-Yahoo-SMTP: _Dag8S.swBC1p4FJKLCXbs8NQzyse1SYSgnAbY0- Received: from router.home (cl@99.30.10.212 with plain) by smtp102.prem.mail.ac4.yahoo.com with SMTP; 22 Nov 2011 19:46:15 +0000 UTC Received: from cl (helo=localhost) by router.home with local-esmtp (Exim 4.71) (envelope-from ) id 1RSwII-0008R5-JR; Tue, 22 Nov 2011 13:46:14 -0600 Date: Tue, 22 Nov 2011 13:46:11 -0600 (CST) From: Christoph Lameter X-X-Sender: cl@router.home To: Markus Trippelsdorf cc: Eric Dumazet , Christian Kujau , Benjamin Herrenschmidt , "Alex,Shi" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , Pekka Enberg , Matt Mackall , "netdev@vger.kernel.org" , Tejun Heo Subject: Re: slub: Lockout validation scans during freeing of object In-Reply-To: <20111122193231.GB1627@x4.trippels.de> Message-ID: References: <1321982484.18002.6.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> <20111122185540.GA1627@x4.trippels.de> <20111122193231.GB1627@x4.trippels.de> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, 22 Nov 2011, Markus Trippelsdorf wrote: > > Could you get me the value of the "slabs" field for the slabs showing the > > wierd values. I.e. do > > > > cat /sys/kernel/slab/signal_cache/slabs > > > > > signal_cache 268 920 360.4K 18446744073709551614/7/24 17 2 31 68 A > > > > It's quite easy to explain. You're using unsigned ints in: > snprintf(dist_str, 40, "%lu/%lu/%d", s->slabs - s->cpu_slabs, s->partial, s->cpu_slabs); > > and (s->slabs - s->cpu_slabs) can get negative. For example: > > task_struct 269 1504 557.0K 18446744073709551601/5/32 21 3 29 72 > > Here s-slabs is 17 and s->cpu_slabs is 32. > That gives: 17-32=18446744073709551601. s->cpu_slabs includes the number of per cpu partial slabs since 3.2. And that calculation is broken it seems. It adds up the number of objects instead of the number of slab pages. So much for review and having that stuff in -next for a long time. Sigh. Subject: slub: Fix per cpu partial statistics Support for SO_OBJECTS was not properly added to show_slab_objects(). If SO_OBJECTS is not set then the number of slab pages needs to be returned not the number of objects in the partial slabs. We do not have that number so just return 1 until we find a better way to determine that. Signed-off-by: Christoph Lameter --- mm/slub.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-2.6/mm/slub.c =================================================================== --- linux-2.6.orig/mm/slub.c 2011-11-22 13:42:23.000000000 -0600 +++ linux-2.6/mm/slub.c 2011-11-22 13:43:56.000000000 -0600 @@ -4451,7 +4451,7 @@ static ssize_t show_slab_objects(struct continue; if (c->page) { - if (flags & SO_TOTAL) + if (flags & SO_TOTAL) x = c->page->objects; else if (flags & SO_OBJECTS) x = c->page->inuse; @@ -4464,7 +4464,11 @@ static ssize_t show_slab_objects(struct page = c->partial; if (page) { - x = page->pobjects; + if (flags & SO_OBJECTS) + x = page->pobjects; + else + /* Assume one */ + x = 1; total += x; nodes[c->node] += x; }