aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2015-08-24 20:39:18 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-08-25 14:40:08 -0400
commitbbf58bf3488e41f346536aa89d62bdf2fe771128 (patch)
treec15f4869e0a3c5b4e1547260b555d863da12c0aa
parent266d12d42ebd2587d3d0e8c4a4e54bfb5ed29543 (diff)
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>
-rw-r--r--Documentation/kernel-parameters.txt9
-rw-r--r--fs/nfs/flexfilelayout/flexfilelayout.c5
-rw-r--r--fs/nfs/pnfs.c4
-rw-r--r--fs/nfs/pnfs.h3
4 files changed, 20 insertions, 1 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 1d6f0459cd7b..30d78b561574 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -2279,6 +2279,15 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
2279 The default parameter value of '0' causes the kernel 2279 The default parameter value of '0' causes the kernel
2280 not to attempt recovery of lost locks. 2280 not to attempt recovery of lost locks.
2281 2281
2282 nfs4.layoutstats_timer =
2283 [NFSv4.2] Change the rate at which the kernel sends
2284 layoutstats to the pNFS metadata server.
2285
2286 Setting this to value to 0 causes the kernel to use
2287 whatever value is the default set by the layout
2288 driver. A non-zero value sets the minimum interval
2289 in seconds between layoutstats transmissions.
2290
2282 nfsd.nfs4_disable_idmapping= 2291 nfsd.nfs4_disable_idmapping=
2283 [NFSv4] When set to the default of '1', the NFSv4 2292 [NFSv4] When set to the default of '1', the NFSv4
2284 server will return only numeric uids and gids to 2293 server will return only numeric uids and gids to
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c
index 0fbf37de2a41..9f6fb8876b3f 100644
--- a/fs/nfs/flexfilelayout/flexfilelayout.c
+++ b/fs/nfs/flexfilelayout/flexfilelayout.c
@@ -533,14 +533,17 @@ nfs4_ff_layoutstat_start_io(struct nfs4_ff_layout_mirror *mirror,
533 ktime_t now) 533 ktime_t now)
534{ 534{
535 static const ktime_t notime = {0}; 535 static const ktime_t notime = {0};
536 s64 report_interval = FF_LAYOUTSTATS_REPORT_INTERVAL;
536 537
537 nfs4_ff_start_busy_timer(&layoutstat->busy_timer, now); 538 nfs4_ff_start_busy_timer(&layoutstat->busy_timer, now);
538 if (ktime_equal(mirror->start_time, notime)) 539 if (ktime_equal(mirror->start_time, notime))
539 mirror->start_time = now; 540 mirror->start_time = now;
540 if (ktime_equal(mirror->last_report_time, notime)) 541 if (ktime_equal(mirror->last_report_time, notime))
541 mirror->last_report_time = now; 542 mirror->last_report_time = now;
543 if (layoutstats_timer != 0)
544 report_interval = (s64)layoutstats_timer * 1000LL;
542 if (ktime_to_ms(ktime_sub(now, mirror->last_report_time)) >= 545 if (ktime_to_ms(ktime_sub(now, mirror->last_report_time)) >=
543 FF_LAYOUTSTATS_REPORT_INTERVAL) { 546 report_interval) {
544 mirror->last_report_time = now; 547 mirror->last_report_time = now;
545 return true; 548 return true;
546 } 549 }
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 247c5a5d2d6b..3530bb703214 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -2285,3 +2285,7 @@ out_put:
2285} 2285}
2286EXPORT_SYMBOL_GPL(pnfs_report_layoutstat); 2286EXPORT_SYMBOL_GPL(pnfs_report_layoutstat);
2287#endif 2287#endif
2288
2289unsigned int layoutstats_timer;
2290module_param(layoutstats_timer, uint, 0644);
2291EXPORT_SYMBOL_GPL(layoutstats_timer);
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index 02c27f93caf1..d3979dd1037a 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -528,12 +528,15 @@ pnfs_use_threshold(struct nfs4_threshold **dst, struct nfs4_threshold *src,
528 nfss->pnfs_curr_ld->id == src->l_type); 528 nfss->pnfs_curr_ld->id == src->l_type);
529} 529}
530 530
531extern unsigned int layoutstats_timer;
532
531#ifdef NFS_DEBUG 533#ifdef NFS_DEBUG
532void nfs4_print_deviceid(const struct nfs4_deviceid *dev_id); 534void nfs4_print_deviceid(const struct nfs4_deviceid *dev_id);
533#else 535#else
534static inline void nfs4_print_deviceid(const struct nfs4_deviceid *dev_id) 536static inline void nfs4_print_deviceid(const struct nfs4_deviceid *dev_id)
535{ 537{
536} 538}
539
537#endif /* NFS_DEBUG */ 540#endif /* NFS_DEBUG */
538#else /* CONFIG_NFS_V4_1 */ 541#else /* CONFIG_NFS_V4_1 */
539 542