I have reserved hugepages for my process using below commands:#echo 64 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages#mkdir -p /mnt/huge  && mount -t hugetlbfs nodev /mnt/huge .And I have placed it in rc.local file.After machine reboot, huge pages reserved successfully and /mnt/huge created.But before my process startups, I could see 21 hugepages are not available for reservation.Below command output:# cat /proc/meminfo | grep Huge HugePages_Total: 64 HugePages_Free: 43 HugePages_Rsvd: 43 HugePages_Surp: 0 Hugepagesize: 2048 kB And no results for the below commands: # lsof |grep /mnt/huge [root@CLA-0(11) /root] Then I tried to free hugepages ... # echo 0 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages No error message displayed. But below command output tells no change .. # cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages  0 But I could see if we echo > 64 it updates nr_hugepages. Also tested with other numbers, it only updates if value is greater then current value in nr_hugepages. I am looking  for below clarification in this site:43 hugepages are free , who requested 21 hugepages allocation out of 64. Why echo 0 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepage is not updating nr_hugepages Linux Kernel # cat /proc/version Linux version 2.6.34.13-WR4.3.x86_64_fbsa_standard-00038-gc4b8cb8 (gcc version 4.4.1 (Wind River Linux Sourcery G++ 4.4a-431) ) #1 SMP Wed Jan 8 20:40:41 EET 2014
Issue with Hugepage reservation in linux
linux;linux kernel