From nobody Mon May 20 00:25:31 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 4VjJHw2q0Dz5LKNX; Mon, 20 May 2024 00:25:32 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjJHw1rGZz4mNy; Mon, 20 May 2024 00:25:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716164732; 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=9+figa2fC++hXuq7E6jzIUwCx7wNzxOYhcktwyRLrO4=; b=yTvouN/dyQQTJjhYhvJBpSMU15yPeYXQV9HaUjyCq+xGBrls3mvEXVTsMwj/4jrzpdf/Qv KcLBNXA601rQDxt7XXoLB1s/kkFpmO6kd1oT/+BfTvsmV6J1a++CupDmJZgbZ5MolE7mWC gZw8OFJwTrKMEPnHgcxqIGU1S/F7zYgRfftUnLMhIQlz3ocSEG7zD48NxBHRsD69Pte1JR L1Ru0DtmUq4Mfe4pcC4wmWO5010t/RQhoUxBCDAQ1YUm2f2j78mSV54g3y9i/zBm9Xpgin 9HHFwekoDZboktGdhtib0LVy3KzfZ2YaTYRXJpLvsZUadJZfdUUOvhZEvclgFw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716164732; a=rsa-sha256; cv=none; b=twVGBw2xLZ1S8SV2SauAOE8gbNabwtMJsXfBuJRryPLR29zbzR5/M0NWNGh4C8QPr4vLnZ Hz/nYwvLufsQDuqrpkEjtLbSLKNNyKOzj+kT2rw/mW6k4UyXb/Is5ufeDQ2TKeno/QJQN/ FGXfba2DPrNwCmiEr36jAR2+P3bCi5KxHLM9ppCdpHgoWNwV64x+t6WOCmMLCp7utZzz/J mOj0j0uFeu4V5qbVnkakNKBhDKtP3tZlDSeJZhKYrxLYIAl1KFKdxYtXqnq7C9H3YiasVZ nRkVHbjFkXbe/fPJZYEXftEosRfmwdoqHXeRBo43QivipStoj6wI/3y6dfkT/A== 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=1716164732; 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=9+figa2fC++hXuq7E6jzIUwCx7wNzxOYhcktwyRLrO4=; b=osQwBHKDEL9fUhDxQyiAtLi6w1bCs3V3TDtZ0SFIFv/fdAOJ6hWuPxGzcRtmAkLoqiRNXh KXgSav7bZdNIEgDpn/yU9kD0xLRGV98Ka2qb1NG3fgMU4fzuRaSaWng1Dt8bquI2cmaDLn 0lOFMcTmjWS+CSgUGGtZ1Oi4bIapRm93Oix2NI3cTJhD1H7ZCEFvO2MoQ2QdFg38THwLL1 9lmY//0jHlN3qzu2yMHMGDJCYCgTm9aRx2Wyy1+oQhYX+mlk6skagy7Gile/FQboWHNVKS BUS8trweWIpx9vMWpz/3IT9VWFoH5GvvUo5ER3RKMDAO1kEL6CNFabvgkjPgWw== 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 4VjJHw020VzGrh; Mon, 20 May 2024 00:25:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44K0PVf6008374; Mon, 20 May 2024 00:25:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44K0PV4A008371; Mon, 20 May 2024 00:25:31 GMT (envelope-from git) Date: Mon, 20 May 2024 00:25:31 GMT Message-Id: <202405200025.44K0PV4A008371@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: f0d6377a3eab - stable/14 - swap-like pagers: assert that writemapping decrease does not pass zero 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f0d6377a3eab6d07f73d5b34922c2b3d9019554c Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f0d6377a3eab6d07f73d5b34922c2b3d9019554c commit f0d6377a3eab6d07f73d5b34922c2b3d9019554c Author: Konstantin Belousov AuthorDate: 2024-05-08 13:58:52 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-19 00:57:54 +0000 swap-like pagers: assert that writemapping decrease does not pass zero (cherry picked from commit 6ada4e8a0ae901f0012015c8d277d80aad7d8f37) --- sys/fs/tmpfs/tmpfs_subr.c | 3 +++ sys/vm/swap_pager.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 13323d50228a..b12e9b91fabc 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -179,6 +179,9 @@ tmpfs_pager_release_writecount(vm_object_t object, vm_offset_t start, KASSERT((object->flags & OBJ_ANON) == 0, ("%s: object %p with OBJ_ANON", __func__, object)); old = object->un_pager.swp.writemappings; + KASSERT(old >= (vm_ooffset_t)end - start, + ("tmpfs obj %p writecount %jx dec %jx", object, (uintmax_t)old, + (uintmax_t)((vm_ooffset_t)end - start))); object->un_pager.swp.writemappings -= (vm_ooffset_t)end - start; new = object->un_pager.swp.writemappings; tmpfs_pager_writecount_recalc(object, old, new); diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index c8b08e0e8315..ce578cc4fd8b 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -3161,6 +3161,10 @@ swap_pager_release_writecount(vm_object_t object, vm_offset_t start, VM_OBJECT_WLOCK(object); KASSERT((object->flags & OBJ_ANON) == 0, ("Splittable object with writecount")); + KASSERT(object->un_pager.swp.writemappings >= (vm_ooffset_t)end - start, + ("swap obj %p writecount %jx dec %jx", object, + (uintmax_t)object->un_pager.swp.writemappings, + (uintmax_t)((vm_ooffset_t)end - start))); object->un_pager.swp.writemappings -= (vm_ooffset_t)end - start; VM_OBJECT_WUNLOCK(object); }