summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ed9b653)
Currently cl_io_read_ahead() can not return locks
that cross stripe boundary at one time, thus readahead
will stop because of this reason.
This is really bad, as we will stop readahead every
time we hit stripe boundary, for example default stripe
size is 1M, this could hurt performances very much
especially with async readahead introduced.
So try to use existed locks aggressivly if there is no
lock contention, otherwise lock should be not
less than requested extent.
Change-Id: I8b2dcd0e80138ea530272cab6a665981aa00cca8
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-on: https://review.whamcloud.com/35438
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Li Xi <lixi@ddn.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
void (*cra_release)(const struct lu_env *env, void *cbdata);
/* Callback data for cra_release routine */
void *cra_cbdata;
void (*cra_release)(const struct lu_env *env, void *cbdata);
/* Callback data for cra_release routine */
void *cra_cbdata;
+ /* whether lock is in contention */
+ bool cra_contention;
};
static inline void cl_read_ahead_release(const struct lu_env *env,
};
static inline void cl_read_ahead_release(const struct lu_env *env,
+ /* Do not shrink the ria_end at any case until
+ * the minimum end of current read is covered.
+ * And only shrink the ria_end if the matched
+ * LDLM lock doesn't cover more. */
+ if (page_idx > ra.cra_end ||
+ (ra.cra_contention &&
+ page_idx > ria->ria_end_min)) {
+ ria->ria_end = ra.cra_end;
+ break;
+ }
+
CDEBUG(D_READA, "idx: %lu, ra: %lu, rpc: %lu\n",
page_idx, ra.cra_end, ra.cra_rpc_size);
LASSERTF(ra.cra_end >= page_idx,
CDEBUG(D_READA, "idx: %lu, ra: %lu, rpc: %lu\n",
page_idx, ra.cra_end, ra.cra_rpc_size);
LASSERTF(ra.cra_end >= page_idx,
ria->ria_end = end - 1;
if (ria->ria_end < ria->ria_end_min)
ria->ria_end = ria->ria_end_min;
ria->ria_end = end - 1;
if (ria->ria_end < ria->ria_end_min)
ria->ria_end = ria->ria_end_min;
- if (ria->ria_end > ra.cra_end)
- ria->ria_end = ra.cra_end;
}
if (page_idx > ria->ria_end)
break;
}
if (page_idx > ria->ria_end)
break;
dlmlock->l_policy_data.l_extent.end);
ra->cra_release = osc_read_ahead_release;
ra->cra_cbdata = dlmlock;
dlmlock->l_policy_data.l_extent.end);
ra->cra_release = osc_read_ahead_release;
ra->cra_cbdata = dlmlock;
+ if (ra->cra_end != CL_PAGE_EOF)
+ ra->cra_contention = true;