Commit 89b09abb authored by Tigran Mkrtchyan's avatar Tigran Mkrtchyan
Browse files

flexfiles: make rsize/wsize configurable

Motivation:
The read/write buffer size between a and the data server is offered by
MDS. Currently, this value is hard coded to 64k, which is not optimal
value for modern hardware.

Modification:
Allow mds to specify preferred IO size for DS. Though this value can be
different for each data server, we use a single buffer size by assuming
that in typical installation data servers have a similar IO
capabilities.

As Linux client uses single value for rsize and wsize, we use (for
pragmatic reasons) a single value as well.

Result:
The IO size between clients and the server can be configured.

Acked-by: Paul Millar
Target: master
parent 80a42a1a
Pipeline #416 passed with stage
in 1 minute and 10 seconds
...@@ -84,6 +84,13 @@ public class FlexFileLayoutDriver implements LayoutDriver { ...@@ -84,6 +84,13 @@ public class FlexFileLayoutDriver implements LayoutDriver {
*/ */
private final uint32_t layoutFlags; private final uint32_t layoutFlags;
/**
* The data transfer buffer size used for READ and WRITE operations.
*
* REVISIT: for now, we assume that all data server prefer the same rsize/wsize.
*/
private final uint32_t ioBufferSize;
/** /**
* Create new FlexFile layout driver with. The @code nfsVersion} and * Create new FlexFile layout driver with. The @code nfsVersion} and
* {@code nfsMinorVersion} represent the protocol to be used to access the * {@code nfsMinorVersion} represent the protocol to be used to access the
...@@ -93,20 +100,22 @@ public class FlexFileLayoutDriver implements LayoutDriver { ...@@ -93,20 +100,22 @@ public class FlexFileLayoutDriver implements LayoutDriver {
* @param nfsVersion nfs version to use * @param nfsVersion nfs version to use
* @param nfsMinorVersion nfs minor version to use. * @param nfsMinorVersion nfs minor version to use.
* @param flags layout flags. * @param flags layout flags.
* @param ioBufferSize the data transfer buffer size used for READ or WRITE.
* @param userPrincipal user principal to be used by client * @param userPrincipal user principal to be used by client
* @param groupPrincipal group principal to be used by client * @param groupPrincipal group principal to be used by client
* @param layoutReturnConsumer consumer which accepts data provided on layout return. * @param layoutReturnConsumer consumer which accepts data provided on layout return.
*/ */
public FlexFileLayoutDriver(int nfsVersion, int nfsMinorVersion, int flags, public FlexFileLayoutDriver(int nfsVersion, int nfsMinorVersion, int flags, int ioBufferSize,
utf8str_mixed userPrincipal, utf8str_mixed groupPrincipal, utf8str_mixed userPrincipal, utf8str_mixed groupPrincipal,
BiConsumer<CompoundContext, ff_layoutreturn4> layoutReturnConsumer) { BiConsumer<CompoundContext, ff_layoutreturn4> layoutReturnConsumer) {
checkArgument((flags & ~flex_files_prot.FF_FLAGS_MASK) == 0, "Invalid flex files layout flag");
this.nfsVersion = nfsVersion; this.nfsVersion = nfsVersion;
this.nfsMinorVersion = nfsMinorVersion; this.nfsMinorVersion = nfsMinorVersion;
this.userPrincipal = new fattr4_owner(userPrincipal); this.userPrincipal = new fattr4_owner(userPrincipal);
this.groupPrincipal = new fattr4_owner_group(groupPrincipal); this.groupPrincipal = new fattr4_owner_group(groupPrincipal);
this.layoutReturnConsumer = layoutReturnConsumer; this.layoutReturnConsumer = layoutReturnConsumer;
this.ioBufferSize = new uint32_t(ioBufferSize);
checkArgument((flags & ~flex_files_prot.FF_FLAGS_MASK) == 0, "Invalid flex files layout flag");
this.layoutFlags = new uint32_t(flags); this.layoutFlags = new uint32_t(flags);
} }
...@@ -124,8 +133,8 @@ public class FlexFileLayoutDriver implements LayoutDriver { ...@@ -124,8 +133,8 @@ public class FlexFileLayoutDriver implements LayoutDriver {
flexfile_type.ffda_versions[0] = new ff_device_versions4(); flexfile_type.ffda_versions[0] = new ff_device_versions4();
flexfile_type.ffda_versions[0].ffdv_version = new uint32_t(nfsVersion); flexfile_type.ffda_versions[0].ffdv_version = new uint32_t(nfsVersion);
flexfile_type.ffda_versions[0].ffdv_minorversion = new uint32_t(nfsMinorVersion); flexfile_type.ffda_versions[0].ffdv_minorversion = new uint32_t(nfsMinorVersion);
flexfile_type.ffda_versions[0].ffdv_rsize = new uint32_t(64 * 1024); flexfile_type.ffda_versions[0].ffdv_rsize = ioBufferSize;
flexfile_type.ffda_versions[0].ffdv_wsize = new uint32_t(64 * 1024); flexfile_type.ffda_versions[0].ffdv_wsize = ioBufferSize;
flexfile_type.ffda_versions[0].ffdv_tightly_coupled = true; flexfile_type.ffda_versions[0].ffdv_tightly_coupled = true;
flexfile_type.ffda_netaddrs = new multipath_list4(); flexfile_type.ffda_netaddrs = new multipath_list4();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment