From owner-freebsd-hackers@FreeBSD.ORG Sat Sep 20 04:03:16 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 99BAA16A4B3 for ; Sat, 20 Sep 2003 04:03:16 -0700 (PDT) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 162C443FEC for ; Sat, 20 Sep 2003 04:03:15 -0700 (PDT) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [IPv6:3ffe:400:8d0:301:200:92ff:fe9b:20e7]) (authenticated bits=0) h8KB2pFs072981 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Sat, 20 Sep 2003 13:02:53 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [IPv6:3ffe:400:8d0:301::12]) by cicely5.cicely.de (8.12.10/8.12.10) with ESMTP id h8KB2oWZ013252 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 20 Sep 2003 13:02:50 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.12.9/8.12.9) with ESMTP id h8KB2nrY028347; Sat, 20 Sep 2003 13:02:49 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.9/8.12.9/Submit) id h8KB2nA4028346; Sat, 20 Sep 2003 13:02:49 +0200 (CEST) Date: Sat, 20 Sep 2003 13:02:49 +0200 From: Bernd Walter To: "Ralf S. Engelschall" Message-ID: <20030920110248.GE21665@cicely12.cicely.de> References: <20030919211138.GA67987@engelschall.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030919211138.GA67987@engelschall.com> X-Operating-System: FreeBSD cicely12.cicely.de 5.1-CURRENT alpha User-Agent: Mutt/1.5.4i cc: freebsd-hackers@freebsd.org Subject: Re: Gaps in memory usage summary!? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ticso@cicely.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Sep 2003 11:03:16 -0000 On Fri, Sep 19, 2003 at 11:11:39PM +0200, Ralf S. Engelschall wrote: > ------------------------------------------------------------------------------ > FreeBSD-5.1-CURRENT/alpha > > SYSTEM MEMORY INFORMATION: > mem_wire: 32555008 ( 31MB) [ 12%] Wired: disabled for paging out > mem_active: + 57344000 ( 54MB) [ 22%] Active: recently referenced > mem_inactive:+ 116170752 ( 110MB) [ 45%] Inactive: recently not referenced > mem_cache: + 4620288 ( 4MB) [ 1%] Cached: almost avail. for allocation > mem_free: + 12484608 ( 11MB) [ 4%] Free: fully available for allocation > mem_gap_vm: + 31113216 ( 29MB) [ 12%] Memory gap: UNKNOWN > -------------- ------------ ----------- ------ > mem_all: = 254287872 ( 242MB) [100%] Total real memory managed > mem_gap_sys: + 11116544 ( 10MB) Memory gap: Kernel?! > -------------- ------------ ----------- > mem_phys: = 265404416 ( 253MB) Total real memory available > mem_gap_hw: + 3031040 ( 2MB) Memory gap: Segment Mappings?! > -------------- ------------ ----------- > mem_hw: = 268435456 ( 256MB) Total real memory installed > > SYSTEM MEMORY SUMMARY: > mem_used: 121012224 ( 115MB) [ 47%] Logically unused memory > mem_avail: + 133275648 ( 127MB) [ 52%] Logically available memory > -------------- ------------ ----------- ------ > mem_total: = 254287872 ( 242MB) [100%] Logically total memory > ------------------------------------------------------------------------------ > > My remaining questions now are: > > 1. What memory is "map_gap_vm" and why is there no such gap on Intel > boxes but on Alpha boxes? The number I arithmetically calculate is > > vm.stats.vm.v_page_count > - ( vm.stats.vm.v_wire_count > + vm.stats.vm.v_active_count > + vm.stats.vm.v_inactive_count > + vm.stats.vm.v_cache_count > + vm.stats.vm.v_free_count ) > > and I always would expect 0 here, but as you can see it is not at > least on Alpha. Is this a bug in our VM statistic code? Any clues? This point is interesting. On two current alphas I see large positive values: mem_gap_vm: + 30744576 ( 29MB) [ 12%] Memory gap: UNKNOWN mem_gap_vm: + 98672640 ( 94MB) [ 4%] Memory gap: UNKNOWN On a stable system I get the following: [296]srv1.cosmo-project.de# perl ~/freebsd-memory SYSTEM MEMORY INFORMATION: mem_wire: 47742976 ( 45MB) [ 38%] Wired: disabled for paging out mem_active: + 58908672 ( 56MB) [ 47%] Active: recently referenced mem_inactive:+ 11059200 ( 10MB) [ 8%] Inactive: recently not referenced mem_cache: + 6635520 ( 6MB) [ 5%] Cached: almost avail. for allocation mem_free: + 696320 ( 0MB) [ 0%] Free: fully available for allocation mem_gap_vm: + -16384 ( 0MB) [ 0%] Memory gap: UNKNOWN -------------- ------------ ----------- ------ mem_all: = 125026304 ( 119MB) [100%] Total real memory managed mem_gap_sys: + 6660096 ( 6MB) Memory gap: Kernel?! -------------- ------------ ----------- mem_phys: = 131686400 ( 125MB) Total real memory available mem_gap_hw: + 2531328 ( 2MB) Memory gap: Segment Mappings?! -------------- ------------ ----------- mem_hw: = 134217728 ( 128MB) Total real memory installed SYSTEM MEMORY SUMMARY: mem_used: 106635264 ( 101MB) [ 85%] Logically unused memory mem_avail: + 18391040 ( 17MB) [ 14%] Logically available memory -------------- ------------ ----------- ------ mem_total: = 125026304 ( 119MB) [100%] Logically total memory [298]srv1.cosmo-project.de# perl ~/freebsd-memory SYSTEM MEMORY INFORMATION: mem_wire: 49479680 ( 47MB) [ 39%] Wired: disabled for paging out mem_active: + 55934976 ( 53MB) [ 44%] Active: recently referenced mem_inactive:+ 10821632 ( 10MB) [ 8%] Inactive: recently not referenced mem_cache: + 8085504 ( 7MB) [ 6%] Cached: almost avail. for allocation mem_free: + 696320 ( 0MB) [ 0%] Free: fully available for allocation mem_gap_vm: + 8192 ( 0MB) [ 0%] Memory gap: UNKNOWN -------------- ------------ ----------- ------ mem_all: = 125026304 ( 119MB) [100%] Total real memory managed mem_gap_sys: + 6660096 ( 6MB) Memory gap: Kernel?! -------------- ------------ ----------- mem_phys: = 131686400 ( 125MB) Total real memory available mem_gap_hw: + 2531328 ( 2MB) Memory gap: Segment Mappings?! -------------- ------------ ----------- mem_hw: = 134217728 ( 128MB) Total real memory installed SYSTEM MEMORY SUMMARY: mem_used: 105422848 ( 100MB) [ 84%] Logically unused memory mem_avail: + 19603456 ( 18MB) [ 15%] Logically available memory -------------- ------------ ----------- ------ mem_total: = 125026304 ( 119MB) [100%] Logically total memory Maybe a timing glitch on those values for -stable and a leak on -current? However - I'm not shure that memory always have to be on those lists. > 2. What memory is "mem_gap_sys", i.e. > (hw.physmem - (vm.stats.vm.v_page_count * hw.pagesize)) ? > Is this the loaded kernel code? I'm not shure, but I asume that's the kernel and static startup allocation. > 3. What memory is "mem_gap_hw", i.e. > (rounded(hw.physmem) - hw.physmem) ? > Is this caused by some special hardware memory segmenting? On alpha systems this is typically PAL/SRM memory which is not available to the OS. On x86 systems sometimes ROM shadow and so on is not available. -- B.Walter BWCT http://www.bwct.de ticso@bwct.de info@bwct.de