Skip to content

Commit

Permalink
DAOS-15682 dfuse: Perform reads in larger chunks.
Browse files Browse the repository at this point in the history
When dfuse sees I/O as well-aligned 128k reads then read MB at
a time and cache the result allowing for faster read bandwidth
for well behaved applicaions and large files.

Create a new in-memory descriptor for file contents, pull in a
whole descriptor on first read and perform all other reads from
the same result.

This should give much higher bandwidth for well behaved applications
and should be easy to extend to proper readahead in future.

Test-tag: test_dfuse_caching_check

Signed-off-by: Ashley Pittman <ashley.m.pittman@intel.com>
  • Loading branch information
ashleypittman committed Apr 22, 2024
1 parent cb13dab commit 08120b0
Show file tree
Hide file tree
Showing 4 changed files with 332 additions and 12 deletions.
7 changes: 7 additions & 0 deletions src/client/dfuse/dfuse.h
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ struct dfuse_event {
union {
struct dfuse_obj_hdl *de_oh;
struct dfuse_inode_entry *de_ie;
struct read_chunk_data *de_cd;
};
off_t de_req_position; /**< The file position requested by fuse */
union {
Expand Down Expand Up @@ -1001,6 +1002,8 @@ struct dfuse_inode_entry {

/* Entry on the evict list */
d_list_t ie_evict_entry;

struct read_chunk_core *ie_chunk;
};

/* Flush write-back cache writes to a inode. It does this by waiting for and then releasing an
Expand Down Expand Up @@ -1098,6 +1101,10 @@ dfuse_compute_inode(struct dfuse_cont *dfs,
void
dfuse_cache_evict_dir(struct dfuse_info *dfuse_info, struct dfuse_inode_entry *ie);

/* Free any read chunk data for an inode */
void
read_chunk_close(struct dfuse_inode_entry *ie);

/* Metadata caching functions. */

/* Mark the cache as up-to-date from now */
Expand Down
6 changes: 5 additions & 1 deletion src/client/dfuse/ops/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ dfuse_cb_release(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi)
struct dfuse_obj_hdl *oh = (struct dfuse_obj_hdl *)fi->fh;
struct dfuse_inode_entry *ie = NULL;
int rc;
uint32_t oc;
uint32_t il_calls;

/* Perform the opposite of what the ioctl call does, always change the open handle count
Expand Down Expand Up @@ -204,7 +205,10 @@ dfuse_cb_release(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi)
if (il_calls != 0) {
atomic_fetch_sub_relaxed(&oh->doh_ie->ie_il_count, 1);
}
atomic_fetch_sub_relaxed(&oh->doh_ie->ie_open_count, 1);
oc = atomic_fetch_sub_relaxed(&oh->doh_ie->ie_open_count, 1);
if (oc == 1) {
read_chunk_close(oh->doh_ie);
}

if (oh->doh_evict_on_close) {
ie = oh->doh_ie;
Expand Down
Loading

0 comments on commit 08120b0

Please sign in to comment.