Issue with Hugepage reservation in linux

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite
1












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:



  1. 43 hugepages are free , who requested 21 hugepages allocation out of 64.

  2. 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









share|improve this question















migrated from stackoverflow.com Feb 3 '14 at 22:12


This question came from our site for professional and enthusiast programmers.














  • Please fix the format... Oh, god! my eyes!
    – opalenzuela
    Jan 29 '14 at 14:50










  • i am able to read ... please let me know which line needs fix ??
    – user3249302
    Jan 30 '14 at 6:30










  • Marc B already did the fixing...
    – opalenzuela
    Jan 30 '14 at 8:42














up vote
0
down vote

favorite
1












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:



  1. 43 hugepages are free , who requested 21 hugepages allocation out of 64.

  2. 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









share|improve this question















migrated from stackoverflow.com Feb 3 '14 at 22:12


This question came from our site for professional and enthusiast programmers.














  • Please fix the format... Oh, god! my eyes!
    – opalenzuela
    Jan 29 '14 at 14:50










  • i am able to read ... please let me know which line needs fix ??
    – user3249302
    Jan 30 '14 at 6:30










  • Marc B already did the fixing...
    – opalenzuela
    Jan 30 '14 at 8:42












up vote
0
down vote

favorite
1









up vote
0
down vote

favorite
1






1





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:



  1. 43 hugepages are free , who requested 21 hugepages allocation out of 64.

  2. 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









share|improve this question















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:



  1. 43 hugepages are free , who requested 21 hugepages allocation out of 64.

  2. 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






linux linux-kernel






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 8 '14 at 7:27









Timo

4,6951726




4,6951726










asked Jan 29 '14 at 14:49









Sharath

12




12




migrated from stackoverflow.com Feb 3 '14 at 22:12


This question came from our site for professional and enthusiast programmers.






migrated from stackoverflow.com Feb 3 '14 at 22:12


This question came from our site for professional and enthusiast programmers.













  • Please fix the format... Oh, god! my eyes!
    – opalenzuela
    Jan 29 '14 at 14:50










  • i am able to read ... please let me know which line needs fix ??
    – user3249302
    Jan 30 '14 at 6:30










  • Marc B already did the fixing...
    – opalenzuela
    Jan 30 '14 at 8:42
















  • Please fix the format... Oh, god! my eyes!
    – opalenzuela
    Jan 29 '14 at 14:50










  • i am able to read ... please let me know which line needs fix ??
    – user3249302
    Jan 30 '14 at 6:30










  • Marc B already did the fixing...
    – opalenzuela
    Jan 30 '14 at 8:42















Please fix the format... Oh, god! my eyes!
– opalenzuela
Jan 29 '14 at 14:50




Please fix the format... Oh, god! my eyes!
– opalenzuela
Jan 29 '14 at 14:50












i am able to read ... please let me know which line needs fix ??
– user3249302
Jan 30 '14 at 6:30




i am able to read ... please let me know which line needs fix ??
– user3249302
Jan 30 '14 at 6:30












Marc B already did the fixing...
– opalenzuela
Jan 30 '14 at 8:42




Marc B already did the fixing...
– opalenzuela
Jan 30 '14 at 8:42










1 Answer
1






active

oldest

votes

















up vote
0
down vote













I haven't found a perfect answer to this problem but you can obtain usable space using the following



#!/bin/sh
#
echo "Re-establishing and defragmenting hugepages "
sysctl -p
hugeadm --pool-pages-min=DEFAULT:+[page-count] –add-temp-swap=400
echo “ “
echo “Updated hugepages “
cat /proc/meminfo |grep HugePage


This will consolidate the reserved pages into one place using a swap file of 400 pages (in this case) and attempt to ensure / append the required number available pages specified in [page-count]. The script assumes you have defined the desired number of initial pages in /etc/sysctl.conf
More information in the manual entry for hugeadm






share|improve this answer






















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f112372%2fissue-with-hugepage-reservation-in-linux%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    I haven't found a perfect answer to this problem but you can obtain usable space using the following



    #!/bin/sh
    #
    echo "Re-establishing and defragmenting hugepages "
    sysctl -p
    hugeadm --pool-pages-min=DEFAULT:+[page-count] –add-temp-swap=400
    echo “ “
    echo “Updated hugepages “
    cat /proc/meminfo |grep HugePage


    This will consolidate the reserved pages into one place using a swap file of 400 pages (in this case) and attempt to ensure / append the required number available pages specified in [page-count]. The script assumes you have defined the desired number of initial pages in /etc/sysctl.conf
    More information in the manual entry for hugeadm






    share|improve this answer


























      up vote
      0
      down vote













      I haven't found a perfect answer to this problem but you can obtain usable space using the following



      #!/bin/sh
      #
      echo "Re-establishing and defragmenting hugepages "
      sysctl -p
      hugeadm --pool-pages-min=DEFAULT:+[page-count] –add-temp-swap=400
      echo “ “
      echo “Updated hugepages “
      cat /proc/meminfo |grep HugePage


      This will consolidate the reserved pages into one place using a swap file of 400 pages (in this case) and attempt to ensure / append the required number available pages specified in [page-count]. The script assumes you have defined the desired number of initial pages in /etc/sysctl.conf
      More information in the manual entry for hugeadm






      share|improve this answer
























        up vote
        0
        down vote










        up vote
        0
        down vote









        I haven't found a perfect answer to this problem but you can obtain usable space using the following



        #!/bin/sh
        #
        echo "Re-establishing and defragmenting hugepages "
        sysctl -p
        hugeadm --pool-pages-min=DEFAULT:+[page-count] –add-temp-swap=400
        echo “ “
        echo “Updated hugepages “
        cat /proc/meminfo |grep HugePage


        This will consolidate the reserved pages into one place using a swap file of 400 pages (in this case) and attempt to ensure / append the required number available pages specified in [page-count]. The script assumes you have defined the desired number of initial pages in /etc/sysctl.conf
        More information in the manual entry for hugeadm






        share|improve this answer














        I haven't found a perfect answer to this problem but you can obtain usable space using the following



        #!/bin/sh
        #
        echo "Re-establishing and defragmenting hugepages "
        sysctl -p
        hugeadm --pool-pages-min=DEFAULT:+[page-count] –add-temp-swap=400
        echo “ “
        echo “Updated hugepages “
        cat /proc/meminfo |grep HugePage


        This will consolidate the reserved pages into one place using a swap file of 400 pages (in this case) and attempt to ensure / append the required number available pages specified in [page-count]. The script assumes you have defined the desired number of initial pages in /etc/sysctl.conf
        More information in the manual entry for hugeadm







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Sep 25 '14 at 2:05









        HalosGhost

        3,57792035




        3,57792035










        answered Sep 25 '14 at 1:59









        redger

        1




        1



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f112372%2fissue-with-hugepage-reservation-in-linux%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            Peggy Mitchell

            Palaiologos

            The Forum (Inglewood, California)