From b346507975d519be31b4a92a80958a1673a98f8b Mon Sep 17 00:00:00 2001 From: XMRig Date: Sun, 15 Dec 2019 03:13:52 +0700 Subject: [PATCH] Added enable_1gb_pages.sh --- scripts/enable_1gb_pages.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 scripts/enable_1gb_pages.sh diff --git a/scripts/enable_1gb_pages.sh b/scripts/enable_1gb_pages.sh new file mode 100755 index 00000000..16d889f1 --- /dev/null +++ b/scripts/enable_1gb_pages.sh @@ -0,0 +1,12 @@ +#!/bin/bash -e + +# https://xmrig.com/docs/miner/hugepages#onegb-huge-pages + +sysctl -w vm.nr_hugepages=$(nproc) + +for i in $(find /sys/devices/system/node/node* -maxdepth 0 -type d); +do + echo 3 > "$i/hugepages/hugepages-1048576kB/nr_hugepages"; +done + +echo "1GB pages successfully enabled" \ No newline at end of file