mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-08-23 08:21:15 +00:00
tests: integration: Use hugepage size to calculate the number of pages
The tests require a fixed amount of huge page memory to run, rather than encode that as fixed number of huge pages it should be calculated from the size of memory required and the huge page size Signed-off-by: Dom <peng6662001@163.com>
This commit is contained in:
parent
961319d8ad
commit
b35a94d83c
@ -240,7 +240,9 @@ sudo bash -c "echo 10 > /sys/kernel/mm/ksm/sleep_millisecs"
|
|||||||
sudo bash -c "echo 1 > /sys/kernel/mm/ksm/run"
|
sudo bash -c "echo 1 > /sys/kernel/mm/ksm/run"
|
||||||
|
|
||||||
# Both test_vfio and ovs-dpdk rely on hugepages
|
# Both test_vfio and ovs-dpdk rely on hugepages
|
||||||
echo 6144 | sudo tee /proc/sys/vm/nr_hugepages
|
HUGEPAGESIZE=`grep Hugepagesize /proc/meminfo | awk '{print $2}'`
|
||||||
|
PAGE_NUM=`echo $((12288 * 1024 / $HUGEPAGESIZE))`
|
||||||
|
echo $PAGE_NUM | sudo tee /proc/sys/vm/nr_hugepages
|
||||||
sudo chmod a+rwX /dev/hugepages
|
sudo chmod a+rwX /dev/hugepages
|
||||||
|
|
||||||
# Run all direct kernel boot (Device Tree) test cases in mod `parallel`
|
# Run all direct kernel boot (Device Tree) test cases in mod `parallel`
|
||||||
|
@ -89,7 +89,9 @@ fi
|
|||||||
cargo build --no-default-features --features "kvm,mshv" --all --release --target $BUILD_TARGET
|
cargo build --no-default-features --features "kvm,mshv" --all --release --target $BUILD_TARGET
|
||||||
|
|
||||||
# Test ovs-dpdk relies on hugepages
|
# Test ovs-dpdk relies on hugepages
|
||||||
echo 6144 | sudo tee /proc/sys/vm/nr_hugepages
|
HUGEPAGESIZE=`grep Hugepagesize /proc/meminfo | awk '{print $2}'`
|
||||||
|
PAGE_NUM=`echo $((12288 * 1024 / $HUGEPAGESIZE))`
|
||||||
|
echo $PAGE_NUM | sudo tee /proc/sys/vm/nr_hugepages
|
||||||
sudo chmod a+rwX /dev/hugepages
|
sudo chmod a+rwX /dev/hugepages
|
||||||
|
|
||||||
export RUST_BACKTRACE=1
|
export RUST_BACKTRACE=1
|
||||||
|
@ -52,7 +52,9 @@ cp target/$BUILD_TARGET/release/cloud-hypervisor $VFIO_DIR
|
|||||||
cp target/$BUILD_TARGET/release/ch-remote $VFIO_DIR
|
cp target/$BUILD_TARGET/release/ch-remote $VFIO_DIR
|
||||||
|
|
||||||
# test_vfio rely on hugepages
|
# test_vfio rely on hugepages
|
||||||
echo 6144 | sudo tee /proc/sys/vm/nr_hugepages
|
HUGEPAGESIZE=`grep Hugepagesize /proc/meminfo | awk '{print $2}'`
|
||||||
|
PAGE_NUM=`echo $((12288 * 1024 / $HUGEPAGESIZE))`
|
||||||
|
echo $PAGE_NUM | sudo tee /proc/sys/vm/nr_hugepages
|
||||||
sudo chmod a+rwX /dev/hugepages
|
sudo chmod a+rwX /dev/hugepages
|
||||||
|
|
||||||
export RUST_BACKTRACE=1
|
export RUST_BACKTRACE=1
|
||||||
|
@ -169,7 +169,9 @@ sudo bash -c "echo 10 > /sys/kernel/mm/ksm/sleep_millisecs"
|
|||||||
sudo bash -c "echo 1 > /sys/kernel/mm/ksm/run"
|
sudo bash -c "echo 1 > /sys/kernel/mm/ksm/run"
|
||||||
|
|
||||||
# Both test_vfio, ovs-dpdk and vDPA tests rely on hugepages
|
# Both test_vfio, ovs-dpdk and vDPA tests rely on hugepages
|
||||||
echo 6144 | sudo tee /proc/sys/vm/nr_hugepages
|
HUGEPAGESIZE=`grep Hugepagesize /proc/meminfo | awk '{print $2}'`
|
||||||
|
PAGE_NUM=`echo $((12288 * 1024 / $HUGEPAGESIZE))`
|
||||||
|
echo $PAGE_NUM | sudo tee /proc/sys/vm/nr_hugepages
|
||||||
sudo chmod a+rwX /dev/hugepages
|
sudo chmod a+rwX /dev/hugepages
|
||||||
|
|
||||||
# Update max locked memory to 'unlimited' to avoid issues with vDPA
|
# Update max locked memory to 'unlimited' to avoid issues with vDPA
|
||||||
|
@ -95,7 +95,9 @@ fi
|
|||||||
cargo build --no-default-features --features "kvm,mshv" --all --release --target $BUILD_TARGET
|
cargo build --no-default-features --features "kvm,mshv" --all --release --target $BUILD_TARGET
|
||||||
|
|
||||||
# setup hugepages
|
# setup hugepages
|
||||||
echo 6144 | sudo tee /proc/sys/vm/nr_hugepages
|
HUGEPAGESIZE=`grep Hugepagesize /proc/meminfo | awk '{print $2}'`
|
||||||
|
PAGE_NUM=`echo $((12288 * 1024 / $HUGEPAGESIZE))`
|
||||||
|
echo $PAGE_NUM | sudo tee /proc/sys/vm/nr_hugepages
|
||||||
sudo chmod a+rwX /dev/hugepages
|
sudo chmod a+rwX /dev/hugepages
|
||||||
|
|
||||||
if [ -n "$test_filter" ]; then
|
if [ -n "$test_filter" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user