From owner-freebsd-current@FreeBSD.ORG Thu Jul 1 18:34:12 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 78968106566B for ; Thu, 1 Jul 2010 18:34:12 +0000 (UTC) (envelope-from alan.l.cox@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id D4D078FC1C for ; Thu, 1 Jul 2010 18:34:09 +0000 (UTC) Received: by yxe42 with SMTP id 42so368784yxe.13 for ; Thu, 01 Jul 2010 11:33:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:reply-to :in-reply-to:references:date:message-id:subject:from:to:cc :content-type; bh=lwrkcYw1EATe4RFdRN4Nh19T9SdGK/nV6gHcGq9+PiI=; b=X+iRe0cgZ3cAOab4xrsMBKE92ndaVS2hYn0Fnm8zw8aGGXTrWGw2vEDLQJTWZ4Hg1s 5ANXKs17+Hh3gNtU2FZ+dMQSGzyDPQplG4Xlh0BFDNWcRtbODaXF2gsnp9x+gOntBqkW CPSk/TlLw5qt58zlGIPeD3M2l9CmA56AUQBiM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; b=nZKhttABdTK7w+JIfAk34hBJLqxQSyNt0wc3DFIQAzVeBhWBbwk8iExx+hW7TsAS87 34743EjgaP0ISstank3UUpfHOEPW+M2MCurH8N+5OoTTeSKlhrAuXKjv15r6eFkYVpmT pZVXmgKfC0L1UcnHjv+sPbv6OI0Uok6EaiNzs= MIME-Version: 1.0 Received: by 10.229.237.138 with SMTP id ko10mr6396890qcb.200.1278009237857; Thu, 01 Jul 2010 11:33:57 -0700 (PDT) Received: by 10.229.46.75 with HTTP; Thu, 1 Jul 2010 11:33:57 -0700 (PDT) In-Reply-To: References: Date: Thu, 1 Jul 2010 13:33:57 -0500 Message-ID: From: Alan Cox To: Jeseem S Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-current@freebsd.org Subject: Re: tmpfs use of wired_count X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: alc@freebsd.org List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jul 2010 18:34:12 -0000 On Wed, Jun 30, 2010 at 11:33 AM, Jeseem S wrote: > 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 ? > > No, it doesn't appear correct. Moreover, it's also incorrect that cnt.v_cache_count isn't included in the initial calculation of size. Regards, Alan > > /* > * 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 > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" >