Whamcloud - gitweb
LU-5443 ldiskfs: replace direct HZ access with kernel APIs 79/12779/2
authorJian Yu <jian.yu@intel.com>
Wed, 19 Nov 2014 02:36:32 +0000 (18:36 -0800)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 9 Dec 2014 08:10:20 +0000 (08:10 +0000)
commitad06e5506388a02ee388fe47bbf8e8bc048d705e
tree8e98c1a948b5cbc1d34c8d804259d3c402514b51
parentfeaeafe8186fafa4cb0c8180bd9746c4a7af809f
LU-5443 ldiskfs: 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 ldiskfs module.

Test-Parameters: alwaysuploadlogs envdefinitions=SLOW=yes,MMP_EXCEPT=5 \
mdtfilesystemtype=ldiskfs mdsfilesystemtype=ldiskfs ostfilesystemtype=ldiskfs \
clientcount=4 osscount=2 mdscount=2 austeroptions=-R failover=true iscsi=1 \
testlist=mmp

Signed-off-by: Jian Yu <jian.yu@intel.com>
Change-Id: Ic111360083bd6d8973e47767cb1b291915613727
Reviewed-on: http://review.whamcloud.com/12779
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
ldiskfs/kernel_patches/patches/rhel6.3/ext4-mmp.patch
ldiskfs/kernel_patches/patches/rhel6.4/ext4-mmp.patch