From owner-freebsd-stable@freebsd.org Thu Apr 8 03:04:46 2021 Return-Path: Delivered-To: freebsd-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 757EC5CC14E for ; Thu, 8 Apr 2021 03:04:46 +0000 (UTC) (envelope-from dewayne@heuristicsystems.com.au) Received: from hermes.heuristicsystems.com.au (hermes.heuristicsystems.com.au [203.41.22.115]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2560 bits) client-digest SHA256) (Client CN "hermes.heuristicsystems.com.au", Issuer "Heuristic Systems Type 4 Host CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FG5hr4hV6z3jJW for ; Thu, 8 Apr 2021 03:04:43 +0000 (UTC) (envelope-from dewayne@heuristicsystems.com.au) Received: from [10.0.5.3] (noddy.hs [10.0.5.3]) (authenticated bits=0) by hermes.heuristicsystems.com.au (8.15.2/8.15.2) with ESMTPSA id 13832siZ027115 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Thu, 8 Apr 2021 13:02:55 +1000 (AEST) (envelope-from dewayne@heuristicsystems.com.au) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=heuristicsystems.com.au; s=hsa; t=1617850975; x=1618455776; bh=Pi5aZmAZM4JQaM+w/og5OSyI5MWI/xvCEt2fpG2OSAs=; h=Subject:To:From:Message-ID:Date; b=JRimuirtYiNTLMGbGBX2m97EMon6ru4fnJ0fP8K2URr9N96+YzdNsCdHGqdZ5kb9f 1YKwPv11hcFlFbScXD9SDHMKzA9rE/rnnh8WBA+wa2zjqv0XE+ZHFnX+AImGjvq8Z1 fSiww+9Dl4K4+RLYBGo8v0xX1DfnFyji/7hdK5u7xH4TnnnZ/T1aw X-Authentication-Warning: b3.hs: Host noddy.hs [10.0.5.3] claimed to be [10.0.5.3] Subject: Re: stable/13, vm page counts do not add up To: freebsd-stable@freebsd.org References: <0606571f-fec0-c7ad-98e8-a0b8554918e2@FreeBSD.org> From: Dewayne Geraghty Message-ID: <7b47289d-2f6d-0400-b97c-e23bb27e28af@heuristicsystems.com.au> Date: Thu, 8 Apr 2021 13:01:31 +1000 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4FG5hr4hV6z3jJW X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=heuristicsystems.com.au header.s=hsa header.b=JRimuirt; dmarc=none; spf=pass (mx1.freebsd.org: domain of dewayne@heuristicsystems.com.au designates 203.41.22.115 as permitted sender) smtp.mailfrom=dewayne@heuristicsystems.com.au X-Spamd-Result: default: False [-5.78 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; HAS_XAW(0.00)[]; TO_DN_NONE(0.00)[]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; RCVD_IN_DNSWL_MED(-0.20)[203.41.22.115:from]; DKIM_TRACE(0.00)[heuristicsystems.com.au:+]; NEURAL_HAM_SHORT(-0.58)[-0.580]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:1221, ipnet:203.40.0.0/13, country:AU]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[heuristicsystems.com.au:s=hsa]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_MED(-2.00)[heuristicsystems.com.au:dkim]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-stable@freebsd.org]; DMARC_NA(0.00)[heuristicsystems.com.au]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-stable] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Apr 2021 03:04:46 -0000 On 8/04/2021 6:56 am, Mark Johnston wrote: > On Wed, Apr 07, 2021 at 11:22:41PM +0300, Andriy Gapon wrote: >> On 07/04/2021 22:54, Mark Johnston wrote: >>> On Wed, Apr 07, 2021 at 10:42:57PM +0300, Andriy Gapon wrote: >>>> >>>> I regularly see that the top's memory line does not add up (and by a lot). >>>> That can be seen with vm.stats as well. >>>> >>>> For example: >>>> $ sysctl vm.stats | fgrep count >>>> vm.stats.vm.v_cache_count: 0 >>>> vm.stats.vm.v_user_wire_count: 3231 >>>> vm.stats.vm.v_laundry_count: 262058 >>>> vm.stats.vm.v_inactive_count: 3054178 >>>> vm.stats.vm.v_active_count: 621131 >>>> vm.stats.vm.v_wire_count: 1871176 >>>> vm.stats.vm.v_free_count: 187777 >>>> vm.stats.vm.v_page_count: 8134982 >>>> >>>> $ bc >>>>>>> 187777 + 1871176 + 621131 + 3054178 + 262058 >>>> 5996320 >>>>>>> 8134982 - 5996320 >>>> 2138662 >>>> >>>> As you can see, it's not a small number of pages either. >>>> Approximately 2 million pages, 8 gigabytes or 25% of the whole memory on this >>>> system. >>>> >>>> This is 47c00a9835926e96, 13.0-STABLE amd64. >>>> I do not think that I saw anything like that when I used (much) older FreeBSD. For reference, I think that a smaller error has been around for awhile. On a UFS only system, FreeBSD 12.2-STABLE #0 r369523M: Sat Mar 27 00:27:03 AEDT 2021 I have: # sysctl vm.stats | fgrep count; top -b vm.stats.vm.v_cache_count: 0 vm.stats.vm.v_user_wire_count: 0 vm.stats.vm.v_laundry_count: 0 vm.stats.vm.v_inactive_count: 423959 vm.stats.vm.v_active_count: 82623 vm.stats.vm.v_wire_count: 256273 vm.stats.vm.v_free_count: 5457329 vm.stats.vm.v_page_count: 6112118 last pid: 83881; load averages: 0.07, 0.09, 0.06 up 0+07:31:44 12:59:37 90 processes: 1 running, 89 sleeping CPU: 0.0% user, 0.0% nice, 0.0% system, 0.0% interrupt, 99.9% idle Mem: 323M Active, 1656M Inact, 1001M Wired, 585M Buf, 21G Free Swap: 24G Total, 24G Free # bc 423959+82623+256273+5457329 6220184 6112118 - 6220184 -108066