setup.sh: modprobe msr if /dev/cpu/0/msr not available

SPDK/DPDK startup time can be very important - especially
in secondary processes.  If DPDK cannot figure out the
TSC via cpuid or rdmsr, it will instead use a 100ms sleep
to calculate the TSC.  On Fedora kernels, the msr module
is linked into the kernel, enabling rdmsr and bypassing
this 100ms sleep.  But on Ubuntu kernels, the user must
explicitly load the msr module, otherwise it will incur
the 100ms sleep.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I779f023bb1681570da81c99cefa66debf3e1adc6
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/465711
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
This commit is contained in:
Jim Harris 2019-08-19 06:43:13 -07:00 committed by Darek Stojaczyk
parent 40b14690db
commit f09be44ee3

View File

@ -401,6 +401,13 @@ function configure_linux {
fi
fi
fi
if [ ! -f /dev/cpu/0/msr ]; then
# Some distros build msr as a module. Make sure it's loaded to ensure
# DPDK can easily figure out the TSC rate rather than relying on 100ms
# sleeps.
modprobe msr || true
fi
}
function reset_linux_pci {