Skip to content

Commit

Permalink
DAOS-15682 dfuse: Perform reads in larger chunks. (#14212)
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.

Signed-off-by: Ashley Pittman <ashley.m.pittman@intel.com>
  • Loading branch information
ashleypittman authored Sep 26, 2024
1 parent 590bb3f commit c757af5
Show file tree
Hide file tree
Showing 3 changed files with 348 additions and 8 deletions.
10 changes: 10 additions & 0 deletions src/client/dfuse/dfuse.h
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,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 @@ -1011,6 +1012,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 @@ -1108,6 +1111,13 @@ 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.
*
* Returns true if feature was used.
*/
bool
read_chunk_close(struct dfuse_inode_entry *ie);

/* Metadata caching functions. */

/* Mark the cache as up-to-date from now */
Expand Down
7 changes: 6 additions & 1 deletion src/client/dfuse/ops/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,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 @@ -206,7 +207,11 @@ 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) {
if (read_chunk_close(oh->doh_ie))
oh->doh_linear_read = true;
}

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

0 comments on commit c757af5

Please sign in to comment.