Hi GENI Users,
This started out as a question, but has turned into an informative post :)
I'm doing an experiment with
DPDK (Data Plane Dev Kit) which can greatly accelerate network processing when used with memory
hugepages.
Hugepages can actually improve performance on many types of workloads, especially those that are memory intensive and will swap pages frequently when they are 4k.
They can be configured in a few different sizes, depending on the architecture. Intel systems can usually use up to 1GB superpages.
I've modified my kernel configuration to support hugepages and added the correct kernel parameters to support them: default_hugepagesz=2M hugepagesz=2M hugepages=4096
So, it seems that, if I configure the kernel properly with kernel parameters, I can get the number of hugepages that I need:
mattwel@node-0:~$ cat /proc/meminfo | grep Huge
HugePages_Total: 4096
HugePages_Free: 4096
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kBMy concern was that I don't appear to be able to change them (in the manner I was used to) in a running system and get the following error:
mattwel@node-0:~$ sudo echo 2048 > /proc/sys/vm/nr_hugepages
-bash: /proc/sys/vm/nr_hugepages: Permission deniedMy solution is this: use sysctl!
mattwel@node-0:~$ sudo sysctl -w vm.nr_hugepages=2048
vm.nr_hugepages = 2048
mattwel@node-0:~$ cat /proc/meminfo | grep Huge
HugePages_Total: 2048
HugePages_Free: 2048
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kBSo sysctl allowed me to change hugepages, but writing to the procfs directly doesn't - no problem!
I hope that my hugepage adventure will help someone improve their application performance!
Cheers,
Matt Welch