From nobody Wed Aug 16 09:17:33 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 4RQjG64zfDz4qS5P; Wed, 16 Aug 2023 09:17:34 +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 4RQjG55pG2z4FHS; Wed, 16 Aug 2023 09:17:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692177453; 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=fjPdlh0wXyP22A9Kyv/oxrrEjvBt+dTRzVKU3KD/8uY=; b=xEB1IYIM4YqkcVE1NHRzNg8RMGLRkWiE3en84a9OLzvQpXNrEfEpf7X1I6RGovWIC2DdNj RAhpV+IpHXVlyg9hO8gAF5sMkWeKWFzhIrW5pMrrFRtSJG6PRqc2vjbpcJdAaC9mcGy7ST twz+Vb1Zk8pQk6/kO3fBty2V7sN5pkP1xTLv4pIQJJ/2gsglzm9rW+UcWViFJR5YOx4chX A026rSLNTZ5XjQ+54MDXKo/Tw+Ws9tn8yt0mHWoK/BO2Dz8rxOBJrpPVMH1p1eha4xuhWX HgLPk4UvTFp9NhcgpVS2BmtCzcmvdUturAcZhMgwC/GF00GolelzCbII/uv2+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692177453; 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=fjPdlh0wXyP22A9Kyv/oxrrEjvBt+dTRzVKU3KD/8uY=; b=YQlNaLIpdd4I4veRXQ2rd+tAgVq7T66tXvJrp9uikkcj1XStc+cIzRiHSI/qvOmsK8Pf+W yOPwkJJs7sG9ZPmBrlw/crkqoMnFQj9BL/W85WftXKuOqsX2VVvE+JzPJG2zVcEmdjTcfU PejyeTc9zoXcRRP+wniqL4OPeK/EDZPGgjvpoLl6Ku2GKvXR6Ymo2C0JRlr7hDUDpUerN3 q8nAtV7x3FiyOi2KA6gyLodRqtzfCKX1OoBjVCkhIRf44A1OnRWx1VkGIwF77re25i1gh8 c+l1lLw6aeTIggXwFqYCGIi/i7c4t+bkLsF3Wa/7Xvv3Muuq+hBnZh5wjy0f5Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692177453; a=rsa-sha256; cv=none; b=MU5NwtbROlKCV6vlXzzrUQ+8MJYTbSzP334lvl8AJeaVh+ER1bgDCuYuH9ayTlnqMKrenr GrK8UP8jr6yTJD9PytdY4hsUFvmnqKrVvCgKBHAcwXjoK3X8BZlbnqDZnqoaISQCoRqcTy OF4QSxQfIdwUnVmAdgAah0abwfi6WpLJnfeDtRdrSXLZOio5Edj67Cm3zXVQASBqRmi9Hr JelinOp1mytcMqmV1fT4Uk6FusXMMs4XnCz4qf94L8hXbCV8XYsTdF7imenta8HTctUbGl 1swsYBlJBj3qw4+NthzWm5/7dkBSa7yqD9/MhKayJAgK2bI5Cu/rmJpYbo+WLA== 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 4RQjG54YMRzm0M; Wed, 16 Aug 2023 09:17:33 +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 37G9HX5h093775; Wed, 16 Aug 2023 09:17:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37G9HXEm093772; Wed, 16 Aug 2023 09:17:33 GMT (envelope-from git) Date: Wed, 16 Aug 2023 09:17:33 GMT Message-Id: <202308160917.37G9HXEm093772@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 14e8b328e324 - stable/13 - tmpfs: add a knob to enable pgcache read for mount 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 14e8b328e3245d9260212ec9e108f7fe23158cd8 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=14e8b328e3245d9260212ec9e108f7fe23158cd8 commit 14e8b328e3245d9260212ec9e108f7fe23158cd8 Author: Konstantin Belousov AuthorDate: 2023-08-06 01:35:36 +0000 Commit: Konstantin Belousov CommitDate: 2023-08-16 09:16:09 +0000 tmpfs: add a knob to enable pgcache read for mount (cherry picked from commit 0f613ab85e5a5274704d179f39fb15163d46e7c4) --- sys/fs/tmpfs/tmpfs.h | 3 +++ sys/fs/tmpfs/tmpfs_subr.c | 2 +- sys/fs/tmpfs/tmpfs_vfsops.c | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs.h b/sys/fs/tmpfs/tmpfs.h index 8d2ec4354d3e..a56fdfa6c408 100644 --- a/sys/fs/tmpfs/tmpfs.h +++ b/sys/fs/tmpfs/tmpfs.h @@ -405,6 +405,9 @@ struct tmpfs_mount { bool tm_nonc; /* Do not update mtime on writes through mmaped areas. */ bool tm_nomtime; + + /* Read from page cache directly. */ + bool tm_pgread; }; #define TMPFS_LOCK(tm) mtx_lock(&(tm)->tm_allnode_lock) #define TMPFS_UNLOCK(tm) mtx_unlock(&(tm)->tm_allnode_lock) diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 49c1b729d753..98f28ead23e6 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -1069,7 +1069,7 @@ loop: VI_LOCK(vp); KASSERT(vp->v_object == NULL, ("Not NULL v_object in tmpfs")); vp->v_object = object; - vn_irflag_set_locked(vp, VIRF_PGREAD); + vn_irflag_set_locked(vp, (tm->tm_pgread ? VIRF_PGREAD : 0)); VI_UNLOCK(vp); VM_OBJECT_WUNLOCK(object); break; diff --git a/sys/fs/tmpfs/tmpfs_vfsops.c b/sys/fs/tmpfs/tmpfs_vfsops.c index 32c26823efc1..9a9c3f4570de 100644 --- a/sys/fs/tmpfs/tmpfs_vfsops.c +++ b/sys/fs/tmpfs/tmpfs_vfsops.c @@ -329,7 +329,7 @@ tmpfs_mount(struct mount *mp) struct tmpfs_mount *tmp; struct tmpfs_node *root; int error; - bool nomtime, nonc; + bool nomtime, nonc, pgread; /* Size counters. */ u_quad_t pages; off_t nodes_max, size_max, maxfilesize; @@ -407,6 +407,7 @@ tmpfs_mount(struct mount *mp) maxfilesize = 0; nonc = vfs_getopt(mp->mnt_optnew, "nonc", NULL, NULL) == 0; nomtime = vfs_getopt(mp->mnt_optnew, "nomtime", NULL, NULL) == 0; + pgread = vfs_getopt(mp->mnt_optnew, "pgread", NULL, NULL) == 0; /* Do not allow mounts if we do not have enough memory to preserve * the minimum reserved pages. */ @@ -454,6 +455,7 @@ tmpfs_mount(struct mount *mp) tmp->tm_ronly = (mp->mnt_flag & MNT_RDONLY) != 0; tmp->tm_nonc = nonc; tmp->tm_nomtime = nomtime; + tmp->tm_pgread = pgread; /* Allocate the root node. */ error = tmpfs_alloc_node(mp, tmp, VDIR, root_uid, root_gid,