From nobody Mon Jul 15 07:13:33 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 4WMths3dcnz5QlZg; Mon, 15 Jul 2024 07:13:33 +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 4WMths35twz4g91; Mon, 15 Jul 2024 07:13:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721027613; 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=6NLI1vSoh5+wH/QXV1GRZ1xEYEfmOn+QK4q9yR8h4/k=; b=KRoKjmSvzwZy4TwIKJ4wqp5NNW5InjPW3edYb6DlJg5pez+3u46eqpo1litxwLa5mHrPIc j5k3vpH07NoefCibSS4CvyczcANJsaDTXk4h7TsDIEp85BemEGAzzgcVSqZs3Lyl1GbQH4 2rl5t0OA66i96iQHZd4mktsVzHUnpZltkEnkX7pDtEVcZaEy2qJS1kufMsV5PyvXDDHnnS P3A4UmGoBmUQ5Pld1KlB2ikcYXz82+piWw4MsMhppp4e2RqlTsvx+EjAXNZFPcnO3ZrHxk 4Nb3yqYuXhqNzpntnr/bDy+/ROdv+y48SqSwA4wFYvnnPDD34HrrJ5VPCLWJTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721027613; a=rsa-sha256; cv=none; b=VA+CpjsDpp8Brao41uG/qEKIIeoCf45QNSZ5bTI/oaZC7LrYCS7/GPOP1ogpspv52XpL4D RgOlXdeQBCtSDxQWlCjqW//F7TjYIJ2XeFuuD5TbsTKMcOfvmc/uC1Yn10HW4LDay9Z4pI XFgKD0emPBOzAxGljBGcDX5hLXXhu5zFSmgJ5TFbXwnD4BFckJaF0yPf+U6kQGq6Flu2N4 jIqHi9Dm1g7XdUr58WwjUO3LabmvgBPfm6voa6uxtiMufrqbCAaow5+e4+7irQRbbr+iZ2 OKJMWUG6Ti8ND6T7be+ueL6znURG53SYhUKSs8T7Lhzw5SG8qDINxbBrQqd6qQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721027613; 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=6NLI1vSoh5+wH/QXV1GRZ1xEYEfmOn+QK4q9yR8h4/k=; b=HA2xEOsbmSYsHEvZYKQ1xVi351phyuG66BF4Y3Surb37k/ZAdWH2Ib33drkk+rWUJ8kSOw q3+woPym1P0bPnFTCMWToE/mgvk7yDx/TJAKJT93ezdLPUpb6fsu5EZewTbbQP1Pm10bUM Mk6RqsM/cmHA+BHOVRrGL5QV3BXF/YC/UMW1eZ4FDAJoqAcK0/UF+2DRjCmYXRriBUBqua o+qgj1YDm95jjO6a5Z6npR946gpTaMgfGRRdEFQNOZEZ0g6K/Ius5ojN6gg3/Zkm0BsZXl EuJwnKbgL9f1RwDzUJVcLYNesZsPCeCpofWSA1MMT3R8TMJfORrFK19sGYb8Dw== 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 4WMths2ft6zjH9; Mon, 15 Jul 2024 07:13:33 +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 46F7DXOk015433; Mon, 15 Jul 2024 07:13:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46F7DXo3015430; Mon, 15 Jul 2024 07:13:33 GMT (envelope-from git) Date: Mon, 15 Jul 2024 07:13:33 GMT Message-Id: <202407150713.46F7DXo3015430@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 45cde0e43918 - main - vm_page: add vm_page_clearref() helper 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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 45cde0e439188589ca2511f6fd76829cbf68267e Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=45cde0e439188589ca2511f6fd76829cbf68267e commit 45cde0e439188589ca2511f6fd76829cbf68267e Author: Konstantin Belousov AuthorDate: 2024-07-08 17:45:33 +0000 Commit: Konstantin Belousov CommitDate: 2024-07-15 06:15:50 +0000 vm_page: add vm_page_clearref() helper It is supposed to be used for ref_count manipulations when the pages are owned by an object, but ref_count is used for something else than the wiring, e.g. PTE population count on the page table page. Reviewed by: markj Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D45910 --- sys/vm/vm_page.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index f419ba8e3d34..49f4c0fbc0cb 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -947,6 +947,17 @@ vm_page_in_laundry(vm_page_t m) return (queue == PQ_LAUNDRY || queue == PQ_UNSWAPPABLE); } +static inline void +vm_page_clearref(vm_page_t m) +{ + u_int r; + + r = m->ref_count; + while (atomic_fcmpset_int(&m->ref_count, &r, r & (VPRC_BLOCKED | + VPRC_OBJREF)) == 0) + ; +} + /* * vm_page_drop: *