<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>On Thu, 25 May 2023 05:36:02 +0000<br>
"Lombardo, Ed" <<a href="mailto:Ed.Lombardo@netscout.com" target="_blank">Ed.Lombardo@netscout.com</a>> wrote:<br>
<br>
> Hi,<br>
> I have two DPDK processes in our application, where one process allocates 1024 2MB hugepages and the second process allocates 8 1GB hugepages.<br>
> I am allocating hugepages in a script before the application starts. This is to satisfy different configuration settings and I don't want to write to grub when second DPDK process is enabled or disabled.<br>
> <br>
> Script that preconditions the hugepages:<br>
> Process 1:<br>
> mkdir /mnt/huge<br>
> mount -t hugetlbfs -o pagesize=2M nodev /mnt/huge<br>
> echo 1024 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages<br>
> <br>
> Process 2:<br>
> mkdir /dev/hugepages-1024<br>
> mount -t hugetlbfs -o pagesize=1G none /dev/hugepages-1024<br>
> echo 8 >/sys/devices/system/node/node0/hugepages/hugepages-1048576kB/nr_hugepages<br>
> <br>
> <br>
> Application -<br>
> Process 1 DPDK EAL arguments:<br>
> Const char *argv[] = { "app1", "-c", "7fc", "-n", "4", "--huge-dir", "/dev/hugepages-1024", "--proc-type", "secondary"};<br>
> <br>
> Process 2 DPDK EAL arguments:<br>
> const char *dpdk_argv_2gb[6] = {"app1 ", "-c0x2", "-n4" , "--socket-mem=2048", "--huge-dir /mnt/huge", "--proc-type primary"};<br>
> <br>
> Questions:<br>
> <br>
> 1. Does DPDK support two hugepage sizes (2MB and 1GB) sharing app1?<br>
This is a new scenario. I doubt it.<br>
<br>
It is possible to have two processes an a common hugepage pool.<br>
<br>
<br>
> 2. Do I need to specify -proc-type for each Process shown above for argument to the rte_eal_init()?<br>
The problem is that DPDK uses a runtime directory to communicate.<br>
<br>
If you want two disjoint DPDK primary processes, you need to set the runtime directory.<br>
<br>
> 3. I find the files in /dev/hugpages/rtemap_#s are not present once Process 2 hugepages-1G/nr_hugepages are set to 8, but when set value to 1 the /dev/hugepages/rtemap_# files (1024) are present. I can't see how to resolve this issue. Any suggestions?<br>
> 4. Do I need to set -socket-mem to the total memory of both Processes, or are they separately defined? I have one NUMA node in this VM.<br>
> <br>
> Thanks,<br>
> Ed<br></blockquote><div><br></div><div>To add to what Stephen said, to point to different directories for separate processes use <span style="color:rgb(231,76,60);font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;font-size:12px;white-space:nowrap">--file-prefix</span> </div></div></div>