Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e03abc0c authored by Eric Van Hensbergen's avatar Eric Van Hensbergen
Browse files

9p: implement optional loose read cache



While cacheing is generally frowned upon in the 9p world, it has its
place -- particularly in situations where the remote file system is
exclusive and/or read-only.  The vacfs views of venti content addressable
store are a real-world instance of such a situation.  To facilitate higher
performance for these workloads (and eventually use the fscache patches),
we have enabled a "loose" cache mode which does not attempt to maintain
any form of consistency on the page-cache or dcache.  This results in over
two orders of magnitude performance improvement for cacheable block reads
in the Bonnie benchmark.  The more aggressive use of the dcache also seems
to improve metadata operational performance.

Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
parent 2c0463a9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -4,6 +4,8 @@ Exporting
	- explanation of how to make filesystems exportable.
Locking
	- info on locking rules as they pertain to Linux VFS.
9p.txt
	- 9p (v9fs) is an implementation of the Plan 9 remote fs protocol.
adfs.txt
	- info and mount options for the Acorn Advanced Disc Filing System.
afs.txt
@@ -82,8 +84,6 @@ udf.txt
	- info and mount options for the UDF filesystem.
ufs.txt
	- info on the ufs filesystem.
v9fs.txt
	- v9fs is a Unix implementation of the Plan 9 9p remote fs protocol.
vfat.txt
	- info on using the VFAT filesystem used in Windows NT and Windows 95
vfs.txt
+4 −0
Original line number Diff line number Diff line
@@ -40,6 +40,10 @@ OPTIONS
  aname=name	aname specifies the file tree to access when the server is
  		offering several exported file systems.

  cache=mode	specifies a cacheing policy.  By default, no caches are used.
			loose = no attempts are made at consistency,
                                intended for exclusive, read-only mounts

  debug=n	specifies debug level.  The debug level is a bitmask.
  			0x01 = display verbose error messages
			0x02 = developer debug (DEBUG_CURRENT)
+2 −1
Original line number Diff line number Diff line
@@ -136,7 +136,8 @@ struct v9fs_fid *v9fs_fid_lookup(struct dentry *dentry)
}

/**
 * v9fs_fid_clone - lookup the fid for a dentry, clone a private copy and release it
 * v9fs_fid_clone - lookup the fid for a dentry, clone a private copy and
 * 			release it
 * @dentry: dentry to look for fid in
 *
 * find a fid in the dentry and then clone to a new private fid
+8 −1
Original line number Diff line number Diff line
@@ -53,6 +53,8 @@ enum {
	Opt_uname, Opt_remotename,
	/* Options that take no arguments */
	Opt_legacy, Opt_nodevmap, Opt_unix, Opt_tcp, Opt_fd,
	/* Cache options */
	Opt_cache_loose,
	/* Error token */
	Opt_err
};
@@ -76,6 +78,8 @@ static match_table_t tokens = {
	{Opt_fd, "fd"},
	{Opt_legacy, "noextend"},
	{Opt_nodevmap, "nodevmap"},
	{Opt_cache_loose, "cache=loose"},
	{Opt_cache_loose, "loose"},
	{Opt_err, NULL}
};

@@ -106,6 +110,7 @@ static void v9fs_parse_options(char *options, struct v9fs_session_info *v9ses)
	v9ses->debug = 0;
	v9ses->rfdno = ~0;
	v9ses->wfdno = ~0;
	v9ses->cache = 0;

	if (!options)
		return;
@@ -121,7 +126,6 @@ static void v9fs_parse_options(char *options, struct v9fs_session_info *v9ses)
					"integer field, but no integer?\n");
				continue;
			}

		}
		switch (token) {
		case Opt_port:
@@ -169,6 +173,9 @@ static void v9fs_parse_options(char *options, struct v9fs_session_info *v9ses)
		case Opt_nodevmap:
			v9ses->nodev = 1;
			break;
		case Opt_cache_loose:
			v9ses->cache = CACHE_LOOSE;
			break;
		default:
			continue;
		}
+8 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ struct v9fs_session_info {
	unsigned int afid;	/* authentication fid */
	unsigned int rfdno;	/* read file descriptor number */
	unsigned int wfdno;	/* write file descriptor number */

	unsigned int cache;	/* cache mode */

	char *name;		/* user name to mount as */
	char *remotename;	/* name of remote hierarchy being mounted */
@@ -73,6 +73,13 @@ enum {
	PROTO_FD,
};

/* possible values of ->cache */
/* eventually support loose, tight, time, session, default always none */
enum {
	CACHE_NONE,		/* default */
	CACHE_LOOSE,		/* no consistency */
};

extern struct dentry *v9fs_debugfs_root;

int v9fs_session_init(struct v9fs_session_info *, const char *, char *);
Loading