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.

1GB pages can only be allocated at boot time using hugepages= and not freed afterwards的更多相关文章

  1. grub paramiter & menu.list

    在Linux中,给kernel传递参数以控制其行为总共有三种方法: 1.build kernel之时的各个configuration选项. 2.当kernel启动之时,可以参数在kernel被GRUB ...

  2. linux内核可以接受的参数 | Linux kernel启动参数 | 通过grub给内核传递参数

    在Linux中,给kernel传递参数以控制其行为总共有三种方法: 1.build kernel之时的各个configuration选项. 2.当kernel启动之时,可以参数在kernel被GRUB ...

  3. Linux传统Huge Pages与Transparent Huge Pages再次学习总结

      Linux下的大页分为两种类型:标准大页(Huge Pages)和透明大页(Transparent Huge Pages).Huge Pages有时候也翻译成大页/标准大页/传统大页,它们都是Hu ...

  4. Examining Huge Pages or Transparent Huge Pages performance

    Posted by William Cohen on March 10, 2014 All modern processors use page-based mechanisms to transla ...

  5. spring boot 开静态资源访问,配置视图解析器

    配置视图解析器spring.mvc.view.prefix=/pages/spring.mvc.view.suffiix= spring boot 开静态资源访问application.proerti ...

  6. kernel feature collection

    Fault injection http://lwn.net/Articles/209257/ The framework can cause memory allocation failures a ...

  7. linux hugepage

    The intent of this file is to give a brief summary of hugetlbpage support inthe Linux kernel.  This ...

  8. 戴文的Linux内核专题:08内核配置(4)

    转自Linux中国 这个第四部分里,我们将继续配置更多的设置和特性. 这里我们被问及关于"IBM Calgary IOMMU support (CALGARY_IOMMU)".这个 ...

  9. [自制操作系统] 连续页分配释放&kmalloc/kfree

    本文将在JOS上实现连续内存.释放,提供内核的kmalloc与kfree,并在分配frambuffer的时候进行测试. Github : https://github.com/He11oLiu/JOS ...

随机推荐

  1. Linux 7.x 防火墙&端口

    Linux 7.x 防火墙&端口 查看当前防火墙的状态: # firewall-cmd --state 也可以使用指令:systemctl status firewall.service 启动 ...

  2. (.NET高级课程笔记)反射总结

    反射总结 1.dll-IL-matadata-反射 2.反射加载dll,获取module.类.方法.特性 3.反射创建对象:反射+简单工厂+配置文件 4.反射调用实例方法.静态方法.重载方法.私有方法 ...

  3. python之xml模块

    # XML 模块的操作参考链接 # http://www.cnblogs.com/yuanchenqi/articles/5732581.html

  4. 使用Shader制作loading旋转动画

    效果图: 1.绕Z轴旋转的旋转矩阵 2.UV旋转的步骤 (1) 由于旋转矩阵是绕原点旋转的,要把要旋转的UV坐标平移到原点 i.uv -= float2(0.5, 0.5); float2 tempU ...

  5. css基础面试题

    1 介绍一下标准的CSS的盒子模型?与低版本IE的盒子模型有什么不同的? 标准盒子模型:宽度=内容的宽度(content)+ border + padding + margin低版本IE盒子模型:宽度 ...

  6. docker tmpfs 的测试结果

    创建 2G 内存的 Container 使用tmpfs挂载到 /tmp docker run --rm -it --memory 2g --mount type=tmpfs,destination=/ ...

  7. LeetCode Weekly Contest 121

    上周因为感冒没有刷题,两个星期没有刷题,没手感了,思维也没有那么活跃了,只刷了一道,下个星期努力. 984. String Without AAA or BBB Given two integers  ...

  8. java0425 wen IO

  9. windows下手动安装composer并配置环境变量

    windows下手动安装composer并配置环境变量   转载地址: https://my.oschina.net/7sites/blog/209997 之前发表过一篇如何为composer设置代理 ...

  10. python多态和规范

    python规范(接口类) 接口类可以规范代码,但接口类本身是不实现的 class Payment: def pay(self,money): raise Notlmplemented class W ...