From nobody Wed Aug 07 08:44:11 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 4Wf3cq6f4mz5SxXC; Wed, 07 Aug 2024 08:44:11 +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 4Wf3cq5wB1z4KkS; Wed, 7 Aug 2024 08:44:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723020251; 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=KcqdEPuqsiYZwxDQqxSOwn20QD0BITIBKXuQ6QhKN5g=; b=yFWNjkMNA+vpqVyOLLY0/sJwF24GdacqRUyA2uyS5Gfg/szlR6JuW1Qq9W0nDqGpNpTtxM iX+C958lk/7qqrdJ80HBDHhrcv3U+0wjLXFbFOS3rzAePX4OxD7BQirurlqyI3FY0Ye+RZ 4liCfBKZ1RB1dI+mNf6aWp8wvV60v/beGwigImJsEXU/kWzrU5k2H0L2f+dBGkPhVRybDG 8uXJlTffVhhew17w36fQFbaQf+wRM3vJ2mAMIOMvss9tfFy7J52eZq2mfjZKnr4fk1t8TX akBlaUKaPE0nJIJzy8Uj5wG24eOpRWyaNXXmU0MXIblBthkbOKnIptxt3F6AWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723020251; a=rsa-sha256; cv=none; b=iLgwVGHdTtDQOr7Q/zAvel3jE3RH0d3Ib5hropuUx0kJYZfBvEaoPsDJrb/cvwc+f/gdWK RsSjz3qJL4ZxShTxBSAmHAHhBcFHSSPgz/9etPMRADP34gBntT0kA/dKDlJL6+KdvXV+2X zSJtC6zMsJPe3ZpI0bXZShQm3xpxXUjzLjG8nQN2YoJ+TqALKqp4Pou+wZkGVCo18UlEaw dhVKyDsuxyyag2+i6/78/hAoclkizT5NrVS1w7mjiQypvQec9M1dW6WW4VuPXmyMeNt112 IcNrqHTSXt/ndAxws365zyGzDXpPA8D5UXcmpCAor5Y1XApocf7TFYAGn8vvtA== 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=1723020251; 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=KcqdEPuqsiYZwxDQqxSOwn20QD0BITIBKXuQ6QhKN5g=; b=TBmm2GI7D2TLFo0dyJCjPLkI1p8GL1qcxaRq+hqASzClUYimwRESJU+UKCA8of4M1+OHMH 3Lg5EKA2U0QbF2jKHoZNv9SFEnHyEaQX03tu5JpwKHFM9w+YKYEk++HI+EfPV3blPecFRl 7Ym1tUnbkMd7Y35E6qT0NSCdvIGhNDzNgujSjMEhgfG9EtygzTrtKg9iXTrq30I+Zu+MWh l3X8f69MXtMyn3tTPn4dNS3/fRL3fJNQ0F/q8WwxkOgpk3L2zxls0fSY0EcFzoqdIZ/hwb fHcqIlyv+y8VxriNpt7t1tUt/jBc8yWD1G4IcpUFg6CO3QpOXJMqWXlEuzRIpw== 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 4Wf3cq5WStzkcP; Wed, 7 Aug 2024 08:44:11 +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 4778iBs4026058; Wed, 7 Aug 2024 08:44:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4778iB9w026055; Wed, 7 Aug 2024 08:44:11 GMT (envelope-from git) Date: Wed, 7 Aug 2024 08:44:11 GMT Message-Id: <202408070844.4778iB9w026055@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: e413e15c1ad5 - main - swap_pager_freespace: fix freed count 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: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e413e15c1ad5ba6dde8d2747c3c505cc39746c80 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=e413e15c1ad5ba6dde8d2747c3c505cc39746c80 commit e413e15c1ad5ba6dde8d2747c3c505cc39746c80 Author: Doug Moore AuthorDate: 2024-08-07 08:37:18 +0000 Commit: Doug Moore CommitDate: 2024-08-07 08:37:18 +0000 swap_pager_freespace: fix freed count Function swp_pager_meta_transfer uses 'pindex' as the start address of the swblk in calculating which page to lookup in order to count freed pages. However, the lookup for a swblk at 'pindex' or greater may produce one greater than 'pindex', given by sb->p, and that's the value that should be used to compute a page adddress. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D46234 --- sys/vm/swap_pager.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 9df1521858c1..59d947c71279 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -2201,10 +2201,9 @@ swp_pager_meta_transfer(vm_object_t srcobject, vm_object_t dstobject, VM_OBJECT_WLOCK(srcobject); } if (moved != NULL) { - if (m != NULL && m->pindex != pindex + i - 1) - m = NULL; - m = m != NULL ? vm_page_next(m) : - vm_page_lookup(srcobject, pindex + i); + m = (m != NULL && m->pindex == sb->p + i - 1) ? + vm_page_next(m) : + vm_page_lookup(srcobject, sb->p + i); if (m == NULL || vm_page_none_valid(m)) mc++; }