From nobody Sun May 26 15:05:14 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 4VnMXB6thvz5Lc1K; Sun, 26 May 2024 15:05:14 +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 4VnMXB5zWmz4ptq; Sun, 26 May 2024 15:05:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716735914; 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=vsvRtnSYoLMa7piYs7Et8fdxXyjj5IUWOOJA/jq6/Hc=; b=RW6pnCuFi8HJPNGFaJPR+BlOSlsqOFbPiKU6bkOS4SFFbFhc261+vW5D/bLBXG/3h+fSpe h+lxUmj/Ce8qAsChHwRNCdXXBowFp7oCDgzzYLEt4j6rLvXfJzypUL9Yp3GFQOX/CUYFbE qgUEmo2F6fuK7ihgA8HGQAXCVHl7YqxjQl+XD7qzb7kSuZzXUAoPfjGMVZEtCcn0A8stm0 7kajKU6XL3pTgYMDBiyYB6eJ3jh4Qg6kplc8uwiPsccqZFO8itC402tBQjCkomEWSxnhZt jFtodTdf58PUHDU7x69WUpQFjKvP9ZKla7L6L9yfML1nS9yvG1Hu/AYePALJrw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716735914; a=rsa-sha256; cv=none; b=hqm8x10mdpMgFOiblvhtOMZV52YI+Ogp58Ol6kBE7cWtqEBKYrO0Q9q7oFro1R04mYAdZD tqHXb3FepPxk4ICXbVUM4LksvlRxQ3brpkO/9n3TxoZWsEs0C8RvlsJKmYAUiahuLxCMRS xiVhiTA6Gq7we6Gu0YKi9Re0aPSKyt+uZ/aU8hZagImSLUfX7TQqzMNJoq94KvkzWEQagu lgeWiR/AXo2XsS6S+62/TgFrPgJ7+WyG8w8KN//XtILzUtXK3HCr/ZL5/TY2aTsxxvwPwu D/0GE6H6aZcUDFmU5qytWXr0Uy79y54ri2o0e9HIGg7jynVAnJy+GNMbwkyu3Q== 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=1716735914; 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=vsvRtnSYoLMa7piYs7Et8fdxXyjj5IUWOOJA/jq6/Hc=; b=gEUpb7tZv8dVTWfSWOFWFla28wEg/GBFMrhIGOrnujLLFC+W71Qa8odlv6W01l3lx3DMGP aGmY+aAJn2g7gCLc4r2JZ/rTsjec6447wuFQC/Zjvqt8QjilpJpRefpIj7ozP8E9H0ekkx lJNjioOppCgT7YqDU019IugI1bJbeGvBshrIZU10CGGQugHADMNWksdp/tjH6NffmFxACO M+lj3rfgeYbmM8o3lFP+kLXITABHHf4X54LPpG6HL70umLfYEVl9yBmBdPWYjfW9Wl1wyE MihKkAqzaaq6fsTArq46fIKgW+rFKWFdJeS4JvUJYwCPOnBS78Eqw4+AzAb1Xw== 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 4VnMXB5GnBz14Zn; Sun, 26 May 2024 15:05:14 +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 44QF5Evu023908; Sun, 26 May 2024 15:05:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44QF5Eid023905; Sun, 26 May 2024 15:05:14 GMT (envelope-from git) Date: Sun, 26 May 2024 15:05:14 GMT Message-Id: <202405261505.44QF5Eid023905@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: c68db4608ef6 - main - Revert "nfscl: Do not do readahead for directories" 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: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c68db4608ef63534a001b55de80995e1c3442d2a Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=c68db4608ef63534a001b55de80995e1c3442d2a commit c68db4608ef63534a001b55de80995e1c3442d2a Author: Rick Macklem AuthorDate: 2024-05-26 15:02:30 +0000 Commit: Rick Macklem CommitDate: 2024-05-26 15:02:30 +0000 Revert "nfscl: Do not do readahead for directories" The PR reported hangs that were avoided when this commit was reverted. Since it was only a cleanup, revert it. The LORs in the PR need further investigation, since I think readahead only hides the problem. PR: 279138 This reverts commit fbe965591f8a0a32c805a279a2505d4c20d22d26. --- sys/fs/nfsclient/nfs_clbio.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c index fe2ed0dff0dd..e181bf593e23 100644 --- a/sys/fs/nfsclient/nfs_clbio.c +++ b/sys/fs/nfsclient/nfs_clbio.c @@ -679,6 +679,36 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) goto out; } + /* + * If not eof and read aheads are enabled, start one. + * (You need the current block first, so that you have the + * directory offset cookie of the next block.) + */ + NFSLOCKNODE(np); + if (nmp->nm_readahead > 0 && ncl_bioread_dora(vp) && + (bp->b_flags & B_INVAL) == 0 && + (np->n_direofoffset == 0 || + (lbn + 1) * NFS_DIRBLKSIZ < np->n_direofoffset) && + incore(&vp->v_bufobj, lbn + 1) == NULL) { + NFSUNLOCKNODE(np); + rabp = nfs_getcacheblk(vp, lbn + 1, NFS_DIRBLKSIZ, td); + if (rabp) { + if ((rabp->b_flags & (B_CACHE|B_DELWRI)) == 0) { + rabp->b_flags |= B_ASYNC; + rabp->b_iocmd = BIO_READ; + vfs_busy_pages(rabp, 0); + if (ncl_asyncio(nmp, rabp, cred, td)) { + rabp->b_flags |= B_INVAL; + rabp->b_ioflags |= BIO_ERROR; + vfs_unbusy_pages(rabp); + brelse(rabp); + } + } else { + brelse(rabp); + } + } + NFSLOCKNODE(np); + } /* * Unlike VREG files, whos buffer size ( bp->b_bcount ) is * chopped for the EOF condition, we cannot tell how large @@ -691,7 +721,6 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) * in np->n_direofoffset and chop it off as an extra step * right here. */ - NFSLOCKNODE(np); n = lmin(uio->uio_resid, NFS_DIRBLKSIZ - bp->b_resid - on); if (np->n_direofoffset && n > np->n_direofoffset - uio->uio_offset) n = np->n_direofoffset - uio->uio_offset;