numam-spdk/lib/blobfs
Jim Harris cdd089a8c5 blobfs: don't flush a partial buffer with no sync pending
We flush a cache buffer once it's filled.  When the write
for that cache buffer has completed, we look to see if
there's more data to flush.  Currently if there's *any*
more data to flush, we will flush it, even if it's not
a full buffer.

That can hurt performance though.  Ideally we only want
to flush a partial buffer if there's been an explicit
sync operation that requires that partial buffer to be
flushed.  Otherwise we will end up writing the partial
buffer to disk, and then come back and write that data
again later when the buffer is full.

Add a new unit test to test for this condition.  This
patch breaks one of the existing unit tests which was
designed specifically around a RocksDB failure condition.
Change that file_length unit test to now write exactly
one CACHE_BUFFER, which still tests the general logic
making sure that we don't confuse the amount of data
flushed with the value written to the file's length
xattr.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I83795fb45afe854b38648d0e0c1a7928219307a2

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455698
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-05-27 06:45:41 +00:00
..
blobfs_internal.h blobfs: separate cache tree related definitions into tree.h 2017-05-04 09:11:28 -07:00
blobfs.c blobfs: don't flush a partial buffer with no sync pending 2019-05-27 06:45:41 +00:00
Makefile blobfs: Add a lightweight filesystem built on the blobstore 2017-03-24 14:15:45 -07:00
tree.c blobfs: Add conf parse for blobfs. 2017-11-15 18:03:00 -05:00
tree.h blobfs: Add conf parse for blobfs. 2017-11-15 18:03:00 -05:00