feat(Ansible): 2M and 1G hugepages
[csit.git] / fdio.infra.ansible / roles / performance_tuning / tasks / main.yaml
index b123be0..79fa03f 100644 (file)
   tags:
     - perf-conf-turbo-boost
 
-- name: Conf - Adjust nr_hugepages
-  # change the minimum size of the hugepage pool.
-  # 2G VPP, 4GB per VNF/CNF, 2G reserve
-  sysctl:
-    name: "vm.nr_hugepages"
-    value: "{{ sysctl.vm.nr_hugepages  }}"
-    state: "present"
-    sysctl_file: "/etc/sysctl.d/90-csit.conf"
-    reload: "yes"
-  tags:
-    - perf-conf-sysctl
-
 - name: Conf - Adjust max_map_count
   # this file contains the maximum number of memory map areas a process
   # may have. memory map areas are used as a side-effect of calling
   tags:
     - perf-conf-load-kernel-modules
 
+- name: Conf - Create a directory for 1G HugeTLBs hugepages
+  file:
+    path: "/dev/hugepages1G"
+    state: "directory"
+    mode: 0755
+  tags:
+    - perf-conf-hugepages-1g
+
+- name: Conf - Mount 1G HugeTLBs hugepages
+  mount:
+    path: "/dev/hugepages1G"
+    src: "hugetlbfs"
+    opts: "pagesize=1G"
+    boot: false
+    state: "mounted"
+    fstype: "hugetlbfs"
+  tags:
+    - perf-conf-hugepages-1g
+
+- name: Create a directory if it does not exist
+  file:
+    path: "/dev/hugepages2M"
+    state: "directory"
+    mode: 0755
+  tags:
+    - perf-conf-hugepages-2m
+
+- name: Conf - Create a directory for 2M HugeTLBs hugepages
+  mount:
+    path: "/dev/hugepages2M"
+    src: "hugetlbfs"
+    opts: "pagesize=2M"
+    boot: false
+    state: "mounted"
+    fstype: "hugetlbfs"
+  tags:
+    - perf-conf-hugepages-2m
+
 - meta: flush_handlers