From owner-dev-commits-src-main@freebsd.org Sun Aug 29 08:26:38 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A581659CBF; Sun, 29 Aug 2021 08:26:38 +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 4Gy64G1P4Kz56pH; Sun, 29 Aug 2021 08:26:38 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 157B12738F; Sun, 29 Aug 2021 08:26:38 +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 17T8QbYg059863; Sun, 29 Aug 2021 08:26:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17T8QbZM059862; Sun, 29 Aug 2021 08:26:37 GMT (envelope-from git) Date: Sun, 29 Aug 2021 08:26:37 GMT Message-Id: <202108290826.17T8QbZM059862@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: a58e222b3bcc - main - vfs: yield in vn_deallocate_impl() loop MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a58e222b3bcc5294ffbff88ff5f4c8d88b9dc324 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Aug 2021 08:26:38 -0000 The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=a58e222b3bcc5294ffbff88ff5f4c8d88b9dc324 commit a58e222b3bcc5294ffbff88ff5f4c8d88b9dc324 Author: Ka Ho Ng AuthorDate: 2021-08-29 08:26:00 +0000 Commit: Ka Ho Ng CommitDate: 2021-08-29 08:26:00 +0000 vfs: yield in vn_deallocate_impl() loop Yield at the end of each loop iteration if there are remaining works as indicated by the value of *len updated by VOP_DEALLOCATE. Without this, when calling vop_stddeallocate to zero a large region, the implementation only zerofills a relatively small chunk and returns. Sponsored by: The FreeBSD Foundation Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D31705 --- sys/kern/vfs_vnops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 3fce590519a8..bd512f73eae5 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -3519,6 +3519,8 @@ vn_deallocate_impl(struct vnode *vp, off_t *offset, off_t *length, int flags, mp = NULL; } } + if (error == 0 && len != 0) + maybe_yield(); } out: if (rl_cookie != NULL)