From owner-freebsd-arch@FreeBSD.ORG Thu May 8 15:10:32 2008 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B7D11065676 for ; Thu, 8 May 2008 15:10:32 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from proxy.meer.net (proxy.meer.net [64.13.141.13]) by mx1.freebsd.org (Postfix) with ESMTP id 189DD8FC16 for ; Thu, 8 May 2008 15:10:31 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from mail.meer.net (mail.meer.net [64.13.141.3]) by proxy.meer.net (8.14.2/8.14.2) with ESMTP id m48FASUu053412; Thu, 8 May 2008 08:10:31 -0700 (PDT) (envelope-from gnn@neville-neil.com) Received: from mail2.meer.net (mail2.meer.net [64.13.141.16]) by mail.meer.net (8.13.3/8.13.3/meer) with ESMTP id m48FAG5k093496; Thu, 8 May 2008 08:10:16 -0700 (PDT) (envelope-from gnn@neville-neil.com) Received: from minion.local.neville-neil.com (hudson-trading.com [66.150.84.160] (may be forged)) (authenticated bits=0) by mail2.meer.net (8.14.1/8.14.1) with ESMTP id m48FAGCG001409; Thu, 8 May 2008 08:10:16 -0700 (PDT) (envelope-from gnn@neville-neil.com) Date: Thu, 08 May 2008 11:10:15 -0400 Message-ID: From: gnn@freebsd.org To: Giorgos Keramidas In-Reply-To: <8763tqkdk3.fsf@kobe.laptop> References: <4811E384.5020604@freebsd.org> <8763tqkdk3.fsf@kobe.laptop> User-Agent: Wanderlust/2.15.5 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.7 Emacs/22.1.50 (i386-apple-darwin8.11.1) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Canit-CHI2: 0.50 X-Bayes-Prob: 0.5 (Score 0, tokens from: ) X-Spam-Score: 0.10 () [Tag at 5.00] COMBINED_FROM X-CanItPRO-Stream: default X-Canit-Stats-ID: 273453 - 9903ecad0498 X-Scanned-By: CanIt (www . roaringpenguin . com) on 64.13.141.13 Cc: arch@freebsd.org, Andre Oppermann Subject: Re: Accounting for mbufs and clusters assigned to a socket buffer X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2008 15:10:32 -0000 At Wed, 07 May 2008 06:17:48 +0300, Giorgos Keramidas wrote: > > I guess we could check *both* (m_flags & M_EXT) and m_ext.ext_type. > > This won't really show how many mbufs use a classic cluster vs. a 9k > cluster, but checking for all the m_ext.ext_types is probably going to > look a bit ugly in a single if-check :( > > We have at least EXT_CLUSTER, EXT_JUMBOP, EXT_JUMBO9, EXT_JUMBO16 and > EXT_PACKET which may be interesting for cluster-related accounting, but > in socketvar.h we can't really use the uma zone accounting. I just > noticed that the 'interesting' ext_types are conveniently short integers > though. Maybe we could change sb_ccnt to a small array, and then change > > if ((m)->m_flags & M_EXT) \ > (sb)->sb_ccnt += 1; > > to something like: > > if ((m)->m_flags & M_EXT && (m)->m_ext.ext_type < EXT_MBUF) \ > (sb)->sb_ccnt[(m)->m_ext.ext_type - 1] += 1; \ > > With our current ext_type's > > #define EXT_CLUSTER 1 /* mbuf cluster */ > #define EXT_SFBUF 2 /* sendfile(2)'s sf_bufs */ > #define EXT_JUMBOP 3 /* jumbo cluster 4096 bytes */ > #define EXT_JUMBO9 4 /* jumbo cluster 9216 bytes */ > #define EXT_JUMBO16 5 /* jumbo cluster 16184 bytes */ > #define EXT_PACKET 6 /* mbuf+cluster from packet zone */ > #define EXT_MBUF 7 /* external mbuf reference (M_IOVEC) */ > ... > > the [ext_type - 1] would move the burden of parsing the ext_type at the > place where we actually have to print something about the sb_ccnt > counters. > > Would the 'bloat' of u_int[6] for ext_type's which are unused be too > much to keep around? I don't know if we want to go that far, but we could certainly try it. I'll keep it in mind. Thanks, George