From nobody Mon Oct 07 16:48:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XMlTy1GMnz5YQ27; Mon, 07 Oct 2024 16:48:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XMlTy0gv7z4b1q; Mon, 7 Oct 2024 16:48:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728319734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/0GNJM369WiOk4P93fKusZROw35os56kn3+93LLBp8k=; b=nITSV9XMfHg+uQ+rGbdjjUJ+ZI/LDSwnj58j028NwxcTZebpgaaKFq+szcc8JB1hmt+cwb 9spByeaUPfk8uTEho+M7S/cZgbMUznL8P2/UlEA9j8ssjVRVZejIU3RoMgaIiVXCiIL3lF Mz1AyJU+c2Nht+ksiCC8AVzSIZyHSTtmBsAkK8AOodVMzQgf5bwxDiU4fE7eTbnI4Dro5u uS0B2m1pXx/XVUhHT1BCxg4xKrBrIn1VcASFZEuL8n+3KsBYgmoy4fpJPHBtC/6RgE+XK8 MJBWb9yUmo2DMM9Fi+ckNYTyl0uO0ZAU1454jsMHHVPlZsthCEd7/fDwyclEDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728319734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/0GNJM369WiOk4P93fKusZROw35os56kn3+93LLBp8k=; b=wB7DeitiU8B4JhsCFcc8axjtmAqH21iXCO+/Sw3kLU81b7JHQRD0ql41R/uX9IP1+lNxvB nc0rHT1BBi5o2hocA3vLi95zC3dsW8PT+W4F2B19N92QglG5vgY2QL9+xfthCTCIJCmCVD 1V08tee+iw0zxvemWUV+s7Xd+FVG5DEXF8frQjihn4ezdmIxTHyMmacdMFWEeG2QePdvzZ 6mAWDoX0M66GuirrE1eDq8DGFmk+m891BMAiTOsC8DZAF3u2aL/MrLuJ+4FT+DDP4ayZSN Bsb5tmjg4cljMt/3tH2y4Uw7hooqcWuF7ikbma/hUFP41euqB4k899LUs+u0iQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728319734; a=rsa-sha256; cv=none; b=rS1qnOlxPKLSknhw51zobaroGptN1ZfPzmdsOYZjgnvffHAUA9Jup0F/CMWndvpJ4pfrgx vrfEHCoyH60tvQFkMEAdZH0776LzLSony0eFViHKEAzcEwEdV7qb/c/ft71r06eXCZWLsw A0mSEC4AY05MFB5J6Qmg7Af5Ml7sn7rvOpG6Vb/DgsmMoxUSPBs8MvniwDL6Etdegsf/d5 kzKlvhpJUciqZMnlxAqqb94A9Y6RP9b93M6YrL+GcuXQ1eAF0mihoSS8waeMQ5Oo+lJNOY ECJjUtx8rdGCnAWZ4gWDJtNtdJhE4BGyMN4rNCnX1ObOCQ+Kyx0G7bI4WbUj5g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XMlTy06pXzv2p; Mon, 7 Oct 2024 16:48:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 497GmrD5086094; Mon, 7 Oct 2024 16:48:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 497GmrKN086091; Mon, 7 Oct 2024 16:48:53 GMT (envelope-from git) Date: Mon, 7 Oct 2024 16:48:53 GMT Message-Id: <202410071648.497GmrKN086091@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: a02f9685edd1 - main - vm_meter: Add counter for NOFREE pages List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a02f9685edd168ef51e2e6fd98f09c9b866fa9a9 Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=a02f9685edd168ef51e2e6fd98f09c9b866fa9a9 commit a02f9685edd168ef51e2e6fd98f09c9b866fa9a9 Author: Bojan Novković AuthorDate: 2024-10-07 14:56:08 +0000 Commit: Bojan Novković CommitDate: 2024-10-07 16:46:32 +0000 vm_meter: Add counter for NOFREE pages This change adds a new counter that tracks the total number of permanently allocated pages. Differential Revision: https://reviews.freebsd.org/D46978 Reviewed by: alc, markj --- sys/sys/vmmeter.h | 8 ++++++++ sys/vm/vm_meter.c | 2 ++ sys/vm/vm_page.c | 1 + 3 files changed, 11 insertions(+) diff --git a/sys/sys/vmmeter.h b/sys/sys/vmmeter.h index 36321be22205..ac4d2f7e7c90 100644 --- a/sys/sys/vmmeter.h +++ b/sys/sys/vmmeter.h @@ -120,6 +120,7 @@ struct vmmeter { counter_u64_t v_rforkpages; /* (p) pages affected by rfork() */ counter_u64_t v_kthreadpages; /* (p) ... and by kernel fork() */ counter_u64_t v_wire_count; /* (p) pages wired down */ + counter_u64_t v_nofree_count; /* (p) permanently allocated pages */ #define VM_METER_NCOUNTERS \ (offsetof(struct vmmeter, v_page_size) / sizeof(counter_u64_t)) /* @@ -174,6 +175,13 @@ vm_wire_count(void) return (VM_CNT_FETCH(v_wire_count)); } +static inline u_int +vm_nofree_count(void) +{ + + return (VM_CNT_FETCH(v_nofree_count)); +} + /* * Return TRUE if we are under our severe low-free-pages threshold * diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c index 7348577fc3cb..faf4074ef0c6 100644 --- a/sys/vm/vm_meter.c +++ b/sys/vm/vm_meter.c @@ -90,6 +90,7 @@ struct vmmeter __read_mostly vm_cnt = { .v_rforkpages = EARLY_COUNTER, .v_kthreadpages = EARLY_COUNTER, .v_wire_count = EARLY_COUNTER, + .v_nofree_count = EARLY_COUNTER, }; u_long __exclusive_cache_line vm_user_wire_count; @@ -386,6 +387,7 @@ VM_STATS_UINT(v_free_target, "Pages desired free"); VM_STATS_UINT(v_free_min, "Minimum low-free-pages threshold"); VM_STATS_PROC(v_free_count, "Free pages", vm_free_count); VM_STATS_PROC(v_wire_count, "Wired pages", vm_wire_count); +VM_STATS_PROC(v_nofree_count, "Permanently allocated pages", vm_nofree_count); VM_STATS_PROC(v_active_count, "Active pages", vm_active_count); VM_STATS_UINT(v_inactive_target, "Desired inactive pages"); VM_STATS_PROC(v_inactive_count, "Inactive pages", vm_inactive_count); diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 6256472e0336..67a9c2119ab8 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -2594,6 +2594,7 @@ vm_page_alloc_nofree_domain(int domain, int req) } m = &nqp->ma[nqp->offs++]; vm_domain_free_unlock(vmd); + VM_CNT_ADD(v_nofree_count, 1); return (m); }