From owner-freebsd-current@FreeBSD.ORG Wed Jun 30 17:03:01 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E87681065673 for ; Wed, 30 Jun 2010 17:03:00 +0000 (UTC) (envelope-from jeseems@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id A46878FC14 for ; Wed, 30 Jun 2010 17:03:00 +0000 (UTC) Received: by gwj16 with SMTP id 16so650007gwj.13 for ; Wed, 30 Jun 2010 10:02:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=2Qoi3RwEmV79Jb3k6x/CDVw38PX21gbJyGDDzPKGsY4=; b=XyYfzlNoc5Y4Y7D4pZ2KGHpkksxJu9drFBy1D8t3cKPWVIxi31R7fDCNyHlhbFX7vV wJeFZhjy40x3bDH+DDqNT8+i2U5Z6AZdfOF1QRHXB9b3Sv/d6avz6rGCz/7TO37YqxOe QADXhJKtBbN+bEPSuhkRp31C3dkWa3hcIQoYg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=wL1wSsBmbiwgJo8IyfOiwnn6Xm8kC44mwkCC1dVz9O4E39/8BLMJRnrsPP0vnETdr/ hkRYIVB1ZeQAB/AmBgarPVEEreHs2j9KnBBoAF/AHUbFWFAg+4fJEDsjYWikpEX2mP01 EUIWOypRrKEtJSJo5xAoJ2Lor+qd9AZAZWz2o= MIME-Version: 1.0 Received: by 10.229.80.72 with SMTP id s8mr5133141qck.150.1277915609911; Wed, 30 Jun 2010 09:33:29 -0700 (PDT) Received: by 10.229.87.2 with HTTP; Wed, 30 Jun 2010 09:33:29 -0700 (PDT) Date: Wed, 30 Jun 2010 09:33:29 -0700 Message-ID: From: Jeseem S To: freebsd-current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: tmpfs use of wired_count X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jun 2010 17:03:01 -0000 hi, I am a newbie on freebsd kernel. Am currently trying to debug a scenario, where a custom driver I load uses a lot of static memory and hence lots of wired pages. The system still has a lot of free memory ( more than 200MB) and a free swap space ( > 500MB). Once I load the driver, the tmpfs loaded on /tmp shows a size of 0. in tmpfs/tmpfs.h, I see that the free memory available is reduced by number of wired pages ( see code below). Is this correct logic ? why do we need to reduce wired count from free pages available ? /* * Returns information about the number of available memory pages, * including physical and virtual ones. * * If 'total' is TRUE, the value returned is the total amount of memory * pages configured for the system (either in use or free). * If it is FALSE, the value returned is the amount of free memory pages. * * Remember to remove TMPFS_PAGES_RESERVED from the returned value to avoid * excessive memory usage. * */ static __inline size_t tmpfs_mem_info(void) { size_t size; size = swap_pager_avail + cnt.v_free_count + cnt.v_inactive_count; size -= size > cnt.v_wire_count ? cnt.v_wire_count : size; return size; } Thanks Jeseem