Skip to content

Commit

Permalink
DAOS-16686 dfuse: pick the right eqt for pre-read
Browse files Browse the repository at this point in the history
Pick the right eqt to do progress for pre read and
do not need pre-read if open by O_TRUNC.

Required-githooks: true
Skip-func-test-hw: false
Allow-unstable-test: true
Test-tag: dfuse

Signed-off-by: Di Wang <[email protected]>
  • Loading branch information
wangdi1 committed Jan 12, 2025
1 parent 44550bc commit b665230
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/client/dfuse/ops/open.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright 2016-2024 Intel Corporation.
* (C) Copyright 2016-2025 Intel Corporation.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -76,7 +76,7 @@ dfuse_cb_open(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi)
((ie->ie_dcache_last_update.tv_sec != 0) &&
dfuse_dcache_get_valid(ie, ie->ie_dfs->dfc_data_timeout))) {
fi_out.keep_cache = 1;
} else {
} else if (!(fi->flags & O_TRUNC)) {
D_SPIN_LOCK(&ie->ie_active->lock);
/**
* size > 4M no pre-read
Expand Down
20 changes: 3 additions & 17 deletions src/client/dfuse/ops/read.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright 2016-2024 Intel Corporation.
* (C) Copyright 2016-2025 Intel Corporation.
* (C) Copyright 2025 Google LLC
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
Expand Down Expand Up @@ -513,17 +513,6 @@ chunk_read(fuse_req_t req, size_t len, off_t position, struct dfuse_obj_hdl *oh)
d_slab_release(cd->eqt->de_read_slab, cd->ev);
D_FREE(cd);
}
} else {
struct dfuse_info *dfuse_info = fuse_req_userdata(req);
struct dfuse_eq *eqt;

eqt = pick_eqt(dfuse_info);

/* Send a message to the async thread to wake it up and poll for events */
sem_post(&eqt->de_sem);

/* Now ensure there are more descriptors for the next request */
d_slab_restock(eqt->de_read_slab);
}
}

Expand Down Expand Up @@ -735,14 +724,13 @@ void
dfuse_pre_read_abort(struct dfuse_info *dfuse_info, struct dfuse_obj_hdl *oh,
struct dfuse_event *ev, int rc)
{
struct dfuse_eq *eqt = pick_eqt(dfuse_info);
struct active_inode *active = oh->doh_ie->ie_active;

oh->doh_readahead_inflight = 0;
active->readahead->dra_rc = rc;
if (ev) {
daos_event_fini(&ev->de_ev);
d_slab_release(eqt->de_pre_read_slab, ev);
d_slab_release(ev->de_eqt->de_pre_read_slab, ev);
active->readahead->dra_ev = NULL;
}
active_ie_decref(dfuse_info, oh->doh_ie);
Expand All @@ -752,11 +740,9 @@ dfuse_pre_read_abort(struct dfuse_info *dfuse_info, struct dfuse_obj_hdl *oh,
void
dfuse_pre_read(struct dfuse_info *dfuse_info, struct dfuse_obj_hdl *oh, struct dfuse_event *ev)
{
struct dfuse_eq *eqt;
struct dfuse_eq *eqt = ev->de_eqt;
int rc;

eqt = pick_eqt(dfuse_info);

ev->de_oh = oh;
ev->de_di = dfuse_info;

Expand Down

0 comments on commit b665230

Please sign in to comment.