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----------CentOS的一些除了yum安装以外的基本操作命令。

    1.tail -n 5 文件名字    : 查看大型文件的后五行内容      head -n 5 文件名字 : 查看文件的前五行内容   2.ls -lh          可以查看文件大小转换以后 ...

  2. Docker容器和本机之间的文件传输

    docker cp 本地文件路径 ID全称:容器路径

  3. Python 入门知识捡漏

    一.对于变量的作用域,执行申明在内存中存在,该变量就可以在下面的代码中使用(即作用域) if  2==2: name = ‘tony’ print name 下面结论是否正确? 外层变量,可以被内层变 ...

  4. puppeteer(六)启动参数——浏览器扩展应用的添加及应用

    前言 最近再做浏览器的自动化,首页是定制化的,是通过extension(扩展)实现的,由于通过puppeteer默认是以无参(即首次以干净的环境)运行的,导致登录页无法正常显示,首先想当然是直接找扩展 ...

  5. Linux安全之SSH 密钥创建及密钥登录

    1.首先进入Linux系统的用户目录下的.ssh目录下,root用户是/root/.ssh,普通用户是/home/您的用户名/.ssh,我们以root用户为例: cd .ssh #如果没有 自己创建 ...

  6. WCF 重载

    [ServiceContract] public interface IUser { [OperationContract(Name="ByUseId")] User GetUse ...

  7. Entity framework 绑定到Datagridview的添加删除修改

    Entity framework 绑定到Datagridview的添加删除修改 using System; using System.Collections.Generic; using System ...

  8. php 加密解密算法 用于数据传输

    /** * 加密方法 * @param string $data 要加密的字符串 * @param string $key 加密密钥 * @param int $expire 过期时间 (单位:秒) ...

  9. mysqli_query($conn, $sql)的返回值类型

    SQL语句的分类: DDL: Data Define Language,数据定义语言——定义列 CREATE / DROP / ALTER / TRUNCATE DML: Data Manipulat ...

  10. Integer类toString(int i,int radix)方法

    Integer类toString(int i,int radix)方法: 首先抛出java的api中的介绍: public static String toString(int i, int radi ...