Advertisement
Querzion

etc-libvirt-hooks-qemu-d-winx-release-end-10-release-hugepages.sh

Apr 5th, 2023
535
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.40 KB | Source Code | 0 0
  1. #!/bin/bash
  2.  
  3. ## Load VM variables
  4. source "/etc/libvirt/hooks/qemu.d/Windows-11/vm-vars.conf"
  5.  
  6. ## Remove Hugepages
  7. echo "Releasing hugepage memory back to the host..."
  8. echo 0 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
  9.  
  10. ## Advise if successful
  11. ALLOC_PAGES=$(cat /proc/sys/vm/nr_hugepages)
  12.  
  13. if [ "$ALLOC_PAGES" -eq 0 ]
  14. then
  15.     echo "Memory successfully released!"
  16. fi
  17.  
  18. sleep 1
  19.  
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement