From nobody Mon May 20 00:26:04 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 4VjJJY2W3Zz5LKLL; Mon, 20 May 2024 00:26:05 +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 4VjJJX4bRDz4nDP; Mon, 20 May 2024 00:26:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716164764; 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=MZMYNdAxu9gt8ZYqVKFnk9Qr1MQH5iPyKDlja2VJ6c0=; b=RJVE7Pw95JzWjlgm9yr08kWZNnyENQXsX1o6ubpcdN1inodryhHpqLSkP/laUIw4FzsAaC dt9OLwt6LgGl2UNcyXVzQ6YekjbbLFQu8gOqvjKTtwcEKBMZ1PtuJm0l1k8MAuohgeSXDe BYSJk9RONUTjMqt0jpqYRU3lYfhx2TlGXoA7xdbPr3yp9Dfop8azRZDlfFcw68wccnKCWB coN1+UWrAo3S3DbQChLxfEMLZxvpW5OmvYzQ0G5FFOnf+OFa/Uc8u6aaUbg0nXyMg+IeYr a9/14UXcdmKvT4icnJ/K6TKc6htfdtjetcB+TZqwSsbqtMBtQQdkZCl7lseyGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716164764; a=rsa-sha256; cv=none; b=ERP6AR4HAJCMAW/khBt660mxMFxO8SP7g9EzMyRhA8c6IQ3f5qPEjn51JdeZS5HlCCGjh1 bGh3KhWN7k2A6wH1afYbJSd7jU34j3sUDWIbVwu1QTrX1tsu+GO3zBynj22CmM3o2mb3pD L3IgUet5RVDSRwbw4F8wQImsK55L13EfQIE6kNyG/TvWpDIyDoUEXXt5xLEPNVy28FpnFd ukSBsNc13Q8tNu3N6UX8fztc1WwqNQj4eUg9jm624hff0tLW3J3brF1idyTXfzqFY+fCel QrEnTHUk58nSPESPka0WDuIzEod0SryPK2t4TzJNueo1c1JsUwBW+dUi0mtW5Q== 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=1716164764; 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=MZMYNdAxu9gt8ZYqVKFnk9Qr1MQH5iPyKDlja2VJ6c0=; b=iIh8dcPFOFOKk7JjYL/k9SH33KxmH973ovBvaRi355h2ZXksRnxiinHwe2wxdGUPfhFZsS 4EJVDPkaZsxzjxzFWykxe4dIfMKYZFaYfFO1gtPZATxscqML1Y4x3UxW5pFyJyrjZQaidV O1jcgBzrGqBZxXflTwczOJrLwtqJTHIt3++YVuMiJE0dSFlbVBljclAmulinmaEM3TnXiK Fz23uRX0UVWL6bCNO/uGCVCSjZIwHyfCx1tVAdPMdy2PWUV7o1nYAZkaAO6VL7LCjiTMK3 plPr0g49cdQpLMOM1uK2/bmIhOtv1OD9HF6yB7BOkMa6jxfp5rFnerJi9AYt7A== 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 4VjJJX3jhCzGxf; Mon, 20 May 2024 00:26:04 +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 44K0Q48h008710; Mon, 20 May 2024 00:26:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44K0Q4pX008707; Mon, 20 May 2024 00:26:04 GMT (envelope-from git) Date: Mon, 20 May 2024 00:26:04 GMT Message-Id: <202405200026.44K0Q4pX008707@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: 156b5b7bf44f - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 156b5b7bf44fd7be5d745accea741527c46532cc Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=156b5b7bf44fd7be5d745accea741527c46532cc commit 156b5b7bf44fd7be5d745accea741527c46532cc Author: Konstantin Belousov AuthorDate: 2024-05-08 13:58:52 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-19 00:59:13 +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 a69e0357bc59..90fffb11e4c6 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 dd7fecc066c4..a3e312af2ed9 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -3183,6 +3183,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); }