From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 30 20:26:56 2010 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB6E9106566C for ; Thu, 30 Sep 2010 20:26:56 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 0CF1F8FC16 for ; Thu, 30 Sep 2010 20:26:55 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id XAA28770; Thu, 30 Sep 2010 23:26:54 +0300 (EEST) (envelope-from avg@icyb.net.ua) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1P1PiP-0008GL-Se; Thu, 30 Sep 2010 23:26:53 +0300 Message-ID: <4CA4F28C.3020804@icyb.net.ua> Date: Thu, 30 Sep 2010 23:26:52 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.9) Gecko/20100918 Lightning/1.0b2 Thunderbird/3.1.4 MIME-Version: 1.0 To: Garrett Cooper References: <4CA4C63F.4070503@icyb.net.ua> In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@FreeBSD.org Subject: Re: sysctl for querying kmem_map->size X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2010 20:26:57 -0000 on 30/09/2010 21:52 Garrett Cooper said the following: > On Thu, Sep 30, 2010 at 10:17 AM, Andriy Gapon wrote: >> >> Here's a patch that adds a sysctl for querying kmem_map->size, which may be useful >> for system state/resources monitoring: >> http://people.freebsd.org/~avg/sysctl-kmem_map_size.diff >> >> I am quite unsure about sizeof(kmem_map->size) == sizeof(int) hack, but I couldn't >> think of other way to decide whether to use SYSCTL_ADD_UINT or SYSCTL_ADD_ULONG >> depending on real type behind vm_size_t. > > Is the base value of the field size_t? If so, then it's ulong on > 64-bit archs and uint on 32-bit archs. Maybe it's a good time then to No, it's vm_size_t, but it's defined similarly to size_t I guess: vm_size_t -> __vm_size_t -> {__uint32_t or __uint64_t depending on arch} > actually get the sysctl and tunables work that I started on into base. > I have a functioning and tested copy of the tunables work, but I'll > need to do similar for the sysctls as well (des@ and I kind of got out > of sync a few months back). I believe that this is the first time I hear about this project. -- Andriy Gapon