From f09be44ee3abdc0cb6126806279ff67670579ff0 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Mon, 19 Aug 2019 06:43:13 -0700 Subject: [PATCH] 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 Change-Id: I779f023bb1681570da81c99cefa66debf3e1adc6 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/465711 Tested-by: SPDK CI Jenkins Reviewed-by: Seth Howell Reviewed-by: Ben Walker Reviewed-by: Shuhei Matsumoto Reviewed-by: Darek Stojaczyk --- scripts/setup.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/setup.sh b/scripts/setup.sh index 3c7205198..b00df8049 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -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 {