From nobody Wed Oct 23 17:28:14 2024 X-Original-To: dev-commits-src-main@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 4XYbcJ0TZzz5ZSkB for ; Wed, 23 Oct 2024 17:28:32 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic315-54.consmr.mail.gq1.yahoo.com (sonic315-54.consmr.mail.gq1.yahoo.com [98.137.65.30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4XYbcG1v1Hz53nw for ; Wed, 23 Oct 2024 17:28:30 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=aETUXHAs; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.65.30 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1729704508; bh=4+1q88uA5KTDlAhfMOdQxbRAb2CUHxVSA1rGeR17x+4=; h=From:Subject:Date:To:References:From:Subject:Reply-To; b=aETUXHAscbno2KcKiROLPxSqFmEeBB8BharoJBRhscTKQj8nqSRsjNPCox+am6zMLRjoV5mAqN7BOs49mSmn7mIa/uB1u58X+ZXGP0wy2w3xcoy4B8g7bv37ee6v5iKbdpkjhnyOsVs1TCHD46f4IhYPXzyGf9h99w8dWUS6VuaW8iBCs2QUr9XEa7m9OTdPHu1iJxklWHWJql96O+40zH+ggGNmaFVvm1GYMd7V31cxZ0lXV3VI/EimDLybPl2SKNtfO5RA3f4CSzX00t/NxnAwcofgYFYzTL6QF7htekkW9NwnVeXh1v5F/vUCntpg2fuJGIDjKKBILCFuM1QYsw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1729704508; bh=H4K0ImK8qXIal/1VZB+mDi9tW644LBY6t0/JCszg875=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=RX0EDRMw0qTTEV8zdBGeK7zf9Q6I66chzi2E3Gc3zpI6o/jYSAYJ0CKw3f6gKTicy4ehHNNqHZD/TCB90RewkLUCSXUMzjx1infrw2jQdUaXy/Zr+gQVjJ/gk1/Om+NJP0j8KQe+obx9ckuXRu3qja4H9jVzy9nmPwJpFKwomOQEAywLibCMvDfKb3RwSvCXyjerFRM5cElBqTANQlzape62Fv45ZhHIww6O7022zqJhODLIp0u2uXgPAw8jh+r2H6HvtYDYIUfd0yQbO/OMYVdh+0DlG1kjplaRiaPCRq+Oxr4e+oxGZfRPi9Mvc4XlbaJpuzlYrQXF7+SvfiKYRA== X-YMail-OSG: BfLmgQ8VM1l7rN5NgN7d7a.SuS9NDbY9BPyljLqulQ2qPAOT5WIVH499TgUgoZg tlZpP3I1DEO7TPkT.CjDz2FFBhsApsUCoT4Nehsvr9npmKog.y7_3jcZnbpD49CO0Zt3UWj727yb m_QFtXiznfXAZk8abqhSwn2FvoT4aZeOlVi8EXnLqKlTzZdA8hij_XaLv1LI73kpy0R.u3bz2NQs ZOZXRnfcpW2Vr8i2ZUFB8T.K8klCge.O10uQLgGaZsyY.hhwLCFZ8BeTWq2KDSlG..qpvlxAJ2rv beDstVmqJ_ShlV6gJ.lR829zOK8ah_5r7aMW.h.mbCxp4Ircd8rbkQ8QmgZTlBeGv_SZzSJjmygF zp9z.AJeKdHvTRMUMzjXqCdm_MyGZJsJpjmM4NY2qdG5kCxiRjvAo3rMzOQONDFSnRuJXLNJho2A wFTjW0tV04Xtb75LBQcI43Qm3TK17KiGftrp9aksTfYhLYS1NaOABy7TXV.ygjUVMYn3hnU8TTPM ILRTGeSfelqK2BwpBTse8fgyneNHMgS0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aJmsUm9ZFBrZex5SjfyHIti5 z2AvRFe3ocIG5MMkln78aWETtRMmK58k27VVZGNrFuY9w1wTy.sPZuK68Gsm_fi2OpSv5itbm55q KNVN7_FqaefjPnArJFUq3vPMhug4mlpdV_HbYjuMGqTvnLP3PnOvCp_f3NMYnbvNpqrUJhpu.H9z s4j7xkijwFuePZnb3mN99dvxRc5bFNWQHYvmHqdscUqbOc_0DlWDbT27SFVpmoUpPgj.7suJDnId r38Xuwask6TcZGWe6K8PuwkOhlEsqwPVjFvQ5Dy9ts41stuJ2_X7aOY9ldHB8Kfv.aS1KdGChytD tbKrRpWDqaDT4heMJir6as7sez6HYBF.ZauDXuQ56ivXBPpKnQ3XU3.5oeEeZGY6xDMc_ORVTCrF NvvUsxvK9Aa3yBWu1jAN03HDz7MFgpLQZGtQLYcTknOuUNxCCdqC1bRDtSrdS1HpWR5LrzZzXh.7 AVjAaiTglKZueRaeOvwpQd6CObj.pwINfTXSW6O_f1TY9E_9kIcRrxIqjBgLkgHqubwqyGF1G_pJ Ao5a4J1KkF.s3pZuJRRg5aqoX_.68ZtMymxuA_79Xl3yYJDKADUKfrqLhjdaxmDHLUgfCiYCWFt0 4lHOFhXV3PX.eFGUmBO9rco1V3puDMFk4Hm3BFEbelTvtFZU7N3y0yap29d59lGiOgLPJnipijZN zmas4Fg-- X-Sonic-MF: X-Sonic-ID: ced1ebf0-ab00-480b-b509-1d78152f0715 Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.gq1.yahoo.com with HTTP; Wed, 23 Oct 2024 17:28:28 +0000 Received: by hermes--production-gq1-5dd4b47f46-n48bg (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID bf685a0f80ffa77536c01bcbcf15298a; Wed, 23 Oct 2024 17:28:25 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: RE: git: 6a07e67fb7a8 - main - vm_meter: Fix laundry accounting Message-Id: <3470CC62-5E19-43EF-8BB3-A8419C2C4AC1@yahoo.com> Date: Wed, 23 Oct 2024 10:28:14 -0700 To: Mark Johnston , dev-commits-src-main@freebsd.org X-Mailer: Apple Mail (2.3776.700.51) References: <3470CC62-5E19-43EF-8BB3-A8419C2C4AC1.ref@yahoo.com> X-Spamd-Result: default: False [-3.95 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.95)[-0.950]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_FROM(0.00)[yahoo.com]; TO_DN_SOME(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.65.30:from]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; APPLE_MAILER_COMMON(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.65.30:from]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim] X-Rspamd-Queue-Id: 4XYbcG1v1Hz53nw X-Spamd-Bar: --- Mark Johnston wrote on Date: Tue, 22 Oct 2024 12:50:42 UTC : > The branch main has been updated by markj: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D6a07e67fb7a8b5687a492d9d70a10651= d5933ff5 >=20 > commit 6a07e67fb7a8b5687a492d9d70a10651d5933ff5 > Author: Mark Johnston > AuthorDate: 2024-10-22 12:48:43 +0000 > Commit: Mark Johnston > CommitDate: 2024-10-22 12:48:43 +0000 >=20 > vm_meter: Fix laundry accounting > =20 > Pages in PQ_UNSWAPPABLE should be considered part of the laundry. > Otherwise, on systems with no swap, the total amount of memory = visible > to tools like top(1) decreases. > =20 > It doesn't seem very useful to have a dedicated counter for = unswappable > pages, and updating applications accordingly would be painful, so = just > lump them in with laundry for now. > =20 > PR: 280846 > Reviewed by: bnovkov, kib > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D47216 > --- > sys/vm/vm_meter.c | 20 +++++++++++++++++--- > 1 file changed, 17 insertions(+), 3 deletions(-) >=20 > diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c > index faf4074ef0c6..fef28bb883e4 100644 > --- a/sys/vm/vm_meter.c > +++ b/sys/vm/vm_meter.c > @@ -455,7 +455,8 @@ u_int > vm_laundry_count(void) > { > =20 > - return (vm_pagequeue_count(PQ_LAUNDRY)); > + return (vm_pagequeue_count(PQ_LAUNDRY) + > + vm_pagequeue_count(PQ_UNSWAPPABLE)); > } > =20 > static int > @@ -477,6 +478,18 @@ SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_pdpages, > CTLTYPE_U64 | CTLFLAG_MPSAFE | CTLFLAG_RD, NULL, 0, = sysctl_vm_pdpages, "QU", > "Pages analyzed by pagedaemon"); > =20 > +static int > +sysctl_vm_laundry_pages(SYSCTL_HANDLER_ARGS) > +{ > + struct vm_domain *vmd; > + u_int ret; > + > + vmd =3D arg1; > + ret =3D vmd->vmd_pagequeues[PQ_LAUNDRY].pq_cnt + > + vmd->vmd_pagequeues[PQ_UNSWAPPABLE].pq_cnt; > + return (SYSCTL_OUT(req, &ret, sizeof(ret))); > +} > + > static void > vm_domain_stats_init(struct vm_domain *vmd, struct sysctl_oid = *parent) > { > @@ -503,8 +516,9 @@ vm_domain_stats_init(struct vm_domain *vmd, struct = sysctl_oid *parent) > "inactpdpgs", CTLFLAG_RD, > &vmd->vmd_pagequeues[PQ_INACTIVE].pq_pdpages, 0, > "Inactive pages scanned by the page daemon"); > - SYSCTL_ADD_UINT(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, > - "laundry", CTLFLAG_RD, = &vmd->vmd_pagequeues[PQ_LAUNDRY].pq_cnt, 0, > + SYSCTL_ADD_PROC(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, > + "laundry", CTLFLAG_RD | CTLTYPE_UINT, vmd, 0, > + sysctl_vm_laundry_pages, "IU", > "laundry pages"); > SYSCTL_ADD_U64(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, > "laundpdpgs", CTLFLAG_RD, I see that there are 4 laundry-related (Unswappable included) per vm.domian.* (my context only has domain 0, so that is what I show): vm.domain.0.stats.laundpdpgs: Laundry pages scanned by the page daemon vm.domain.0.stats.laundry: laundry pages vm.domain.0.stats.unswappable: Unswappable pages vm.domain.0.stats.unswppdpgs: Unswappable pages scanned by the page = daemon Also, there is: vm.stats.vm.v_laundry_count: Pages eligible for laundering (vm.stats.vm.* seems to have nothing analogous to unswappable) (Unswappable is being treated as laundry in some places to avoid under accounting for the total memory spanned.) It seems that the descriptions should now likely be explicit about the context each covers, one of: ) Swappable Laundry ) Unswappable Laundry ) Swappable+Unswappable Laundry In part, this would guide figuring out when to add vs. substract vs. use-as-is for what one wants to produce from the information. Where ever Swappable+Unswappable in old calling-code may be in use, those arithmetic operations would now double count Unswappable. (I've no clue if there is such code someplace.) My notes in the PR about this may have the details wrong about which changed vs. which did not: I only just noticed the vm.stats.vm.v_laundry_count was something that I'd missed so I'd thought there was only one laundry place and did not check which at the time. So my details there should not be followed but just be considered as suggestive types of wording that might be involved. =3D=3D=3D Mark Millard marklmi at yahoo.com