zoukankan      html  css  js  c++  java
  • 1GB pages can only be allocated at boot time using hugepages= and not freed afterwards

    2018-6-27 9:12:38

    https://stackoverflow.com/questions/26385554/error-setting-nr-hugepages-via-sysfs


    ~ # echo 1 > /sys/devices/system/node/node0/hugepages/hugepages-1048576kB/nr_hugepages
    sh: write error: Invalid argument

    parameter in https://www.kernel.org/doc/Documentation/kernel-parameters.txt
    says that "1GB pages can only be allocated at boot time using hugepages= and not freed afterwards"
    I think this is why I can't decrease number of pages.

    Also, the code in mm/hugetlb.c doesn't allow this operation:

    #if defined(CONFIG_CMA) && defined(CONFIG_X86_64)
    ...
    static inline bool gigantic_page_supported(void) { return true; }
    #else
    static inline bool gigantic_page_supported(void) { return false; }
    ...
    #endif
    ...
    static int hugetlb_sysctl_handler_common(...)
    {
      ...
      if (write && hstate_is_gigantic(h) && !gigantic_page_supported())
              return -EINVAL;
      ...
    }

    So, unless CONFIG_CMA is defined (and in the default kernel configuration shipped with Fedora 20
    this option is disabled), the kernel will always return EINVAL.

  • 相关阅读:
    AVFrame与Mat
    conda警告
    MS COCO数据集格式
    ubuntu卡在工作区切换界面
    C++编程便捷口
    Anaconda相关问题
    处理memory output
    ajax 上传form表单
    元类 metaclass
    小菜一碟
  • 原文地址:https://www.cnblogs.com/mull/p/9232532.html
Copyright © 2011-2022 走看看