From nobody Sat Mar 11 11:08:41 2023 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 4PYgCF55Zfz3xWGx; Sat, 11 Mar 2023 11:08:41 +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 4PYgCF4B3Qz4DTr; Sat, 11 Mar 2023 11:08:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678532921; 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=Q4zh9ao6G9WurUV9xF9dWeSfT2QJ5aFqu+Qk5d1dVLU=; b=f8fzOe2qvc6uDpwSlPug6qUqIW9Rr/UB13A8fZBp3sEUG6k+Iex7XcRgd2isNIPPJpMyWf HD78KzK/MXXzJP1hLXOwgC8gFezVNT+Tx2kEZvEq6Tzc3Py5WWk2azfv5fFIhlP0zTNS4p pY4y9F6VTAW7klnaERwPj5OJpYPxfYvzdpJg/QIJ5OU75vGULNvR81xWMNMfBc12Q2tyVJ zssGOuy9l5KRg8FsWq6aTDJR9RSpQOfmBaT8aVtdiiHY41CPZvMzj5Dow3XpV3kEV8Ay1Z 7fvnz4rfV2z5/cOjEhEd1w3B7zPNxnOsnChzGhLi+nYL+AKw60M1HC7a4I+vkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678532921; 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=Q4zh9ao6G9WurUV9xF9dWeSfT2QJ5aFqu+Qk5d1dVLU=; b=gSCtbq2wdDlESi8TmS2CIVxjIFWm71lbmgIYnvf8/lLNmWGm1KGUj1IZ3g709Ojz1PR35i 8YE/lY3QysNmx3UDpJoP3VB4r/D/3fgzJtRNkxoWiD7Kefask5fyQ6zfvpWG2t7rRuz1qX x9N7HFIccSL94v2jAt6cHWx8pllLjyjmapPmPqhNbxs4xYHadjnUbMdikxHGGlJx+o1Ml2 cMDhHTBiGrzxjmCrQr4xQJNkde5p2nW7k3nSnhM1Ykpfml0cIgJPRGC6wzcPki3ygVy7eh v85oE5CT/nOtkYtiQyGg9nvZbgrwBeVimJQ0Pc9oQxrdmwDtzM360w2Zc44TKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678532921; a=rsa-sha256; cv=none; b=gYtX/lRF4OJHddXc8/lFIns9WOrD9u54CDzVZdofzW954fGyq/r8jy/av/Q79WCavy/RH8 Oy+kbgQMat/S6GiP8T1Ihy1oxmMX3UpFRc4L8qhOdZG590uDETCVn3JXS9PLDkgufsBVy8 skQRs8IkMivLerJIyPujxhKrfw9HcqGImwrag8htn67B+9GoYKWtgePl+fsM7aQd6R+fLT oL1r7HbUf7ohNe01yINbStq0ZCybyHsEVJ5TQ+oNnytTwkuphUkMrFuIb7/f5DIF20Grwb XpLu9TxpKJ6W3gcse/nJcRKP2R4NYMBN2JIsyrdJ0EISsjherBGQu69Qb5l6+w== 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 4PYgCF38LyzSXN; Sat, 11 Mar 2023 11:08:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32BB8f8u028677; Sat, 11 Mar 2023 11:08:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32BB8fbj028676; Sat, 11 Mar 2023 11:08:41 GMT (envelope-from git) Date: Sat, 11 Mar 2023 11:08:41 GMT Message-Id: <202303111108.32BB8fbj028676@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 73b951cd3914 - main - vm: move up object lock asserts in fault functions 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 73b951cd39148accf768d01344a752c377ea4475 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=73b951cd39148accf768d01344a752c377ea4475 commit 73b951cd39148accf768d01344a752c377ea4475 Author: Mateusz Guzik AuthorDate: 2022-08-07 13:05:47 +0000 Commit: Mateusz Guzik CommitDate: 2023-03-11 11:08:21 +0000 vm: move up object lock asserts in fault functions No functional changes. Reviewed by: kib Reviewed by: markj Tested by: pho Differential Revision: https://reviews.freebsd.org/D38964 --- sys/vm/vm_fault.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index 336cee7ca972..2afe5a19d2d7 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -1047,6 +1047,8 @@ vm_fault_next(struct faultstate *fs) { vm_object_t next_object; + VM_OBJECT_ASSERT_WLOCKED(fs->object); + /* * The requested page does not exist at this object/ * offset. Remove the invalid page from the object, @@ -1067,7 +1069,6 @@ vm_fault_next(struct faultstate *fs) * Move on to the next object. Lock the next object before * unlocking the current one. */ - VM_OBJECT_ASSERT_WLOCKED(fs->object); next_object = fs->object->backing_object; if (next_object == NULL) return (false); @@ -1382,6 +1383,8 @@ vm_fault_object(struct faultstate *fs, int *behindp, int *aheadp) enum fault_status res; bool dead; + VM_OBJECT_ASSERT_WLOCKED(fs->object); + /* * If the object is marked for imminent termination, we retry * here, since the collapse pass has raced with us. Otherwise, @@ -1416,7 +1419,6 @@ vm_fault_object(struct faultstate *fs, int *behindp, int *aheadp) return (FAULT_SOFT); } } - VM_OBJECT_ASSERT_WLOCKED(fs->object); /* * Page is not resident. If the pager might contain the page