summaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
diff options
context:
space:
mode:
authorJian Yu <jian.yu@intel.com>2016-09-18 16:38:01 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-09-19 09:44:03 +0200
commitdf3c30f6e9044fef7a7e508dad940c8e0f3346fa (patch)
treee4c6aaae27323fadb9352853c4bb0abcf92b3b73 /drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
parent3cbbf5eddbf69dffae0e1eba63f2f3eb7fe9f1a1 (diff)
downloadop-kernel-dev-df3c30f6e9044fef7a7e508dad940c8e0f3346fa.zip
op-kernel-dev-df3c30f6e9044fef7a7e508dad940c8e0f3346fa.tar.gz
staging: lustre: replace direct HZ access with kernel APIs
On some customer's systems, kernel was compiled with HZ defined to 100, instead of 1000. This improves performance for HPC applications. However, to use these systems with Lustre, customers have to re-build Lustre for the kernel because Lustre directly uses the defined constant HZ. Since kernel 2.6.21, some non-HZ dependent timing APIs become non- inline functions, which can be used in Lustre codes to replace the direct HZ access. These kernel APIs include: jiffies_to_msecs() jiffies_to_usecs() jiffies_to_timespec() msecs_to_jiffies() usecs_to_jiffies() timespec_to_jiffies() And here are some samples of the replacement: HZ -> msecs_to_jiffies(MSEC_PER_SEC) n * HZ -> msecs_to_jiffies(n * MSEC_PER_SEC) HZ / n -> msecs_to_jiffies(MSEC_PER_SEC / n) n / HZ -> jiffies_to_msecs(n) / MSEC_PER_SEC n / HZ * 1000 -> jiffies_to_msecs(n) This patch replaces the direct HZ access in lustre modules. Signed-off-by: Jian Yu <jian.yu@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5443 Reviewed-on: http://review.whamcloud.com/12052 Reviewed-by: Bob Glossman <bob.glossman@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: James Simmons <uja.ornl@gmail.com> Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lustre/ldlm/ldlm_resource.c')
-rw-r--r--drivers/staging/lustre/lustre/ldlm/ldlm_resource.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
index 912cd68..a09c25a 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
@@ -880,7 +880,8 @@ static int __ldlm_namespace_free(struct ldlm_namespace *ns, int force)
ldlm_ns_name(ns), atomic_read(&ns->ns_bref));
force_wait:
if (force)
- lwi = LWI_TIMEOUT(obd_timeout * HZ / 4, NULL, NULL);
+ lwi = LWI_TIMEOUT(msecs_to_jiffies(obd_timeout *
+ MSEC_PER_SEC) / 4, NULL, NULL);
rc = l_wait_event(ns->ns_waitq,
atomic_read(&ns->ns_bref) == 0, &lwi);
OpenPOWER on IntegriCloud