From nobody Wed Aug 09 04:03:09 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 4RLGcZ2vHRz4m6Dv; Wed, 9 Aug 2023 04:03:10 +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 4RLGcY6xRtz3Zjr; Wed, 9 Aug 2023 04:03:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691553790; 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=TPBFGVdu1EpLpNymT3YG05wx6J9xE1XPTneCx8X0e2U=; b=oOiBEuAo00Dhdih/5qbHf/9w8yqMxXOVuQ96+qNrx7Te0BBmlWJicVDSawJt3kSMxVGMcl bhWMi95AVOHFNeNUc7PAt+FpnrjAIS+UxEQAmz+9d+VwVBJCAGdxwqphxuWO2U8uQaabve 5YYlpiRR9wXVBowk/5P83AFtkO8pD140hEWsTFq3A3w+awQv5Czx7K3vgHj+ZgH7+SyMkP omen9oBvaLQtmeUQ15rsFJZTgYENc+jRHIyMC9g/0EGQ8G+LLo5kX3E3/xmdnXVTrpQn0d idNyv/f7JHg61MOGZDIXRwy91eNOUwQCj79vHf0rUX5fw+ce7lAIyZVQh0GgWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691553790; 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=TPBFGVdu1EpLpNymT3YG05wx6J9xE1XPTneCx8X0e2U=; b=ZjCNXWfC17UJrxKaEY5sz+pirbmApvH2mDCFv9aTJ8rmGdvi7rBMAzEVn1DFHxPDN6XMsQ nlPAi/WTHgL6EKOSVPM8cfkccIf4UTZfl1+fqQdag/pttNqBbGNmbtqAd79cPDTk6S0DK4 jTFJxEsgAXcMW7vFLh2IH24alwtpR8sqptMBiZXuUexGH681zDcpT4ifipVVFsxcSp03LS t88Fbcy88M2UWhKKNvE165OqHygWwXhN48hIBWN89czv1pVNtb1He4a5LBWrQ9B7bawTT8 buZYXH6eglM5/G6GN3FOXZaGh6haCGGhf5XTATqO0Vb1kJHCoAkWIuRKFrbvzA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1691553790; a=rsa-sha256; cv=none; b=Z5ixktLPJd+TuYQfLaTth93A6zU5vJ+Gmj2wsCx/P3M9H7lO33VwrMQcWn1c1ATELdNay4 m2+kqxV51Y2fzPNX+3djwkOqWkYlKbwFpIf8gFipFkaSIyZC3GBFgtCe9nUHwq/9UT9ZUn PURrf7AV/fvtFZFSq56Mtpf49Nr8UBw3eAxe//a5PSQSneWBuJ8j7Vc+ghZS9DjwCy+si/ ySpeqlco5yoVVz2LlDEaUx6iMjyA0+yI0brG3qmf6Crn8WK0QFUZUU5PAaRklDtwUjjnzJ pinGt4/NuKNP9czcukqqYmW7iy+xzvp7mT73dUoyHpkP1KmaG+ztaKFj629DTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4RLGcY62J0z11kl; Wed, 9 Aug 2023 04:03:09 +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 379439g0090143; Wed, 9 Aug 2023 04:03:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 379439Vx090140; Wed, 9 Aug 2023 04:03:09 GMT (envelope-from git) Date: Wed, 9 Aug 2023 04:03:09 GMT Message-Id: <202308090403.379439Vx090140@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 651fdc3d198d - main - Revert "vnode read(2)/write(2): acquire rangelock regardless of do_vn_io_fault()" 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 651fdc3d198d066b18823db3b74cf38a0144dfac Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=651fdc3d198d066b18823db3b74cf38a0144dfac commit 651fdc3d198d066b18823db3b74cf38a0144dfac Author: Konstantin Belousov AuthorDate: 2023-08-06 01:23:42 +0000 Commit: Konstantin Belousov CommitDate: 2023-08-09 03:54:15 +0000 Revert "vnode read(2)/write(2): acquire rangelock regardless of do_vn_io_fault()" This reverts commit 5b353925ff61b9ddb97bb453ba75278b578ed7d9. The reason is the lesser scalability of the vnode' rangelock comparing with the vnode lock. Requested by: mjg Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D41334 --- sys/kern/vfs_vnops.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 306840ff0357..83e95731d7c4 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -1443,7 +1443,6 @@ vn_io_fault(struct file *fp, struct uio *uio, struct ucred *active_cred, void *rl_cookie; struct vn_io_fault_args args; int error; - bool rl_locked; doio = uio->uio_rw == UIO_READ ? vn_read : vn_write; vp = fp->f_vnode; @@ -1466,7 +1465,12 @@ vn_io_fault(struct file *fp, struct uio *uio, struct ucred *active_cred, } foffset_lock_uio(fp, uio, flags); - if (vp->v_type == VREG) { + if (do_vn_io_fault(vp, uio)) { + args.kind = VN_IO_FAULT_FOP; + args.args.fop_args.fp = fp; + args.args.fop_args.doio = doio; + args.cred = active_cred; + args.flags = flags | FOF_OFFSET; if (uio->uio_rw == UIO_READ) { rl_cookie = vn_rangelock_rlock(vp, uio->uio_offset, uio->uio_offset + uio->uio_resid); @@ -1478,22 +1482,11 @@ vn_io_fault(struct file *fp, struct uio *uio, struct ucred *active_cred, rl_cookie = vn_rangelock_wlock(vp, uio->uio_offset, uio->uio_offset + uio->uio_resid); } - rl_locked = true; - } else { - rl_locked = false; - } - if (do_vn_io_fault(vp, uio)) { - args.kind = VN_IO_FAULT_FOP; - args.args.fop_args.fp = fp; - args.args.fop_args.doio = doio; - args.cred = active_cred; - args.flags = flags | FOF_OFFSET; error = vn_io_fault1(vp, uio, &args, td); + vn_rangelock_unlock(vp, rl_cookie); } else { error = doio(fp, uio, active_cred, flags | FOF_OFFSET, td); } - if (rl_locked) - vn_rangelock_unlock(vp, rl_cookie); foffset_unlock_uio(fp, uio, flags); return (error); }