NFSv4.2/pnfs: Make the layoutstats timer configurable
Allow advanced users to set the layoutstats timer in order to lengthen or shorten the period between layoutstat transmissions to the server. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
parent
266d12d42e
commit
bbf58bf348
4 changed files with 20 additions and 1 deletions
|
@ -533,14 +533,17 @@ nfs4_ff_layoutstat_start_io(struct nfs4_ff_layout_mirror *mirror,
|
|||
ktime_t now)
|
||||
{
|
||||
static const ktime_t notime = {0};
|
||||
s64 report_interval = FF_LAYOUTSTATS_REPORT_INTERVAL;
|
||||
|
||||
nfs4_ff_start_busy_timer(&layoutstat->busy_timer, now);
|
||||
if (ktime_equal(mirror->start_time, notime))
|
||||
mirror->start_time = now;
|
||||
if (ktime_equal(mirror->last_report_time, notime))
|
||||
mirror->last_report_time = now;
|
||||
if (layoutstats_timer != 0)
|
||||
report_interval = (s64)layoutstats_timer * 1000LL;
|
||||
if (ktime_to_ms(ktime_sub(now, mirror->last_report_time)) >=
|
||||
FF_LAYOUTSTATS_REPORT_INTERVAL) {
|
||||
report_interval) {
|
||||
mirror->last_report_time = now;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -2285,3 +2285,7 @@ out_put:
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(pnfs_report_layoutstat);
|
||||
#endif
|
||||
|
||||
unsigned int layoutstats_timer;
|
||||
module_param(layoutstats_timer, uint, 0644);
|
||||
EXPORT_SYMBOL_GPL(layoutstats_timer);
|
||||
|
|
|
@ -528,12 +528,15 @@ pnfs_use_threshold(struct nfs4_threshold **dst, struct nfs4_threshold *src,
|
|||
nfss->pnfs_curr_ld->id == src->l_type);
|
||||
}
|
||||
|
||||
extern unsigned int layoutstats_timer;
|
||||
|
||||
#ifdef NFS_DEBUG
|
||||
void nfs4_print_deviceid(const struct nfs4_deviceid *dev_id);
|
||||
#else
|
||||
static inline void nfs4_print_deviceid(const struct nfs4_deviceid *dev_id)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* NFS_DEBUG */
|
||||
#else /* CONFIG_NFS_V4_1 */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue