From nobody Sat Mar 11 21:59:49 2023 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 4PYxfZ0ZJpz3ww5V; Sat, 11 Mar 2023 21:59:50 +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 4PYxfY6dZXz4Cs1; Sat, 11 Mar 2023 21:59:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678571989; 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=tqpEPLLsx6rbxWgJm1yHO4Z4te8NZmkrbOk0ahSrm7A=; b=SLKB/HJb9UnmsHsAiqZdKUwTTT1SKZMfWFweCw3DdKH5Za/bgrbXA1Ybv+qPWyMUf82fsE UT1Mkf3YyQ6uWgHL2Gn5P4X0rnarfoqpTSXAleGy/krEhimZWX4Nj/AeHsfDgCVPh61uLN XPwS8sl9PhRsC4czC1/AAFh1FKSasyEIJvIqyRuu0TwTcke8s8oOvzyZHa3GxSOermDLSD RmSitlRbT6ILbHzVDCGGdSnVt9iihnTu6I+i22BLmPIArjy8twmMak+Mz2py9bMcoXe6Ey BkeI8UMdzFOMmaSCuVjZQPcsAb7hkqfAy9p59ygXDvMvkSM7RswwtDRWVxUxPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678571989; 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=tqpEPLLsx6rbxWgJm1yHO4Z4te8NZmkrbOk0ahSrm7A=; b=EeBVmrDSKqi4TFTfy9Yj1HC0I9J/aDfqys88cvx7WZDTYiFsMNpgA1GSpvHAwPdUNYp8sr pKH0o7N7avgCehWlVLSEqObzZR1z4VQANAbjt8P9H/YoVh8uWqT8rjKXmDtLZL0HAzBRir mINeLz9lMuyUyx4mWyLmr5ejmFPHvr7qraHrAGEsdBt9kKry2/fQff+kFCL6cvGTgY5fFf 3fcjOTNiSVnd5bdvmtXwodbcUM4/+AvIahf0IqFtlfMjuRbppDY7vU/TBzpWmEMJZ2WnHf NBe0XJzgRrg87t9cJVlOMFy2NzMdWTRE4/mkRBAhB6DIcWYI7YBqcPMsxfP5Hw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678571989; a=rsa-sha256; cv=none; b=SoOnnROgCU0OCCqiYGbdf2hp7hxT+j4aWmgyYKXircZGx+DIDuEYPY0iZaCQb1p519sao4 1mamOtq1Yl8fy2sjxx6XqYguIaL5iPeDx10li2+/mBEeNeMtWSHqNb4vETBFlJiBJURWFW 0airEUiZ8aPWj1xWOIvGG7Qkpb9UIGqfviSpuXO4lKIFkIUf3yCJUaDL46O8oxTC9TTa2/ 8HH/Wm9mIzCxTDddCm2juiwLKekhqSs6345/7sy/ziOyy4xweHiYRxRR/MIlx5QfEkZjvv PqleIojTXBvLRG2jIsyvhOoM0UQ9s0z7nXiFoGLfMrcMXeDDSg5FfOl9QhZwbg== 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 4PYxfY5j12zm6k; Sat, 11 Mar 2023 21:59:49 +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 32BLxna9098196; Sat, 11 Mar 2023 21:59:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32BLxnp3098195; Sat, 11 Mar 2023 21:59:49 GMT (envelope-from git) Date: Sat, 11 Mar 2023 21:59:49 GMT Message-Id: <202303112159.32BLxnp3098195@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: 3c3a434f8ee8 - main - vm: avoid lock upgrade if possible in vm_fault_next 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 3c3a434f8ee867e6e4a69de07bf0811f2ae0c46e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=3c3a434f8ee867e6e4a69de07bf0811f2ae0c46e commit 3c3a434f8ee867e6e4a69de07bf0811f2ae0c46e Author: Mateusz Guzik AuthorDate: 2023-03-11 20:57:24 +0000 Commit: Mateusz Guzik CommitDate: 2023-03-11 21:52:01 +0000 vm: avoid lock upgrade if possible in vm_fault_next In my tests during buildkernel fs->m was always NULL at that stage. Note the change has no impact on vm obj contention during said workload. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D39027 --- sys/vm/vm_fault.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index 5df667052615..fadd7dbd2fd5 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -1092,7 +1092,7 @@ vm_fault_next(struct faultstate *fs) if (fs->object == fs->first_object) { fs->first_m = fs->m; fs->m = NULL; - } else { + } else if (fs->m != NULL) { if (!vm_fault_object_ensure_wlocked(fs)) { fs->can_read_lock = false; unlock_and_deallocate(fs);