博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Hugepages
阅读量:6090 次
发布时间:2019-06-20

本文共 1711 字,大约阅读时间需要 5 分钟。

hot3.png

Why Hugepages?

As we known, the default page size is 4k. It is not enough for the new big-memory system. Since the process address space are virtual, the CPU and the operating system have to remember which page belong to which process, and where it is stored. Obviously, the more pages you have, the more time it takes to find where the memory is mapped.

Most current CPU architectures support bigger pages.those are named Hugepages.Through the Hugepage, the pages can be cutted down and fewer translations requiring fewer cycles to accses the memory.  A less obvious benefit is that address translation information is typically stored in the L2 cache. With huge pages, more cache space is available for application data means that fewer cycles are spent accessing main memory.

How to enable Hugepages?

  1.             Check the hugepage size.

#cat /proc/meminfo

The output of "cat /proc/meminfo" will have lines like:

.....

HugePages_Total: vvv

HugePages_Free:  www

HugePages_Rsvd:  xxx

HugePages_Surp:  yyy

Hugepagesize:    zzz kB

 

where:

HugePages_Total  is the size of the pool of huge pages.

HugePages_Free  is the number of huge pages in the pool that are not yet      allocated.

Hugepagesize    is the size of each page, can be 2M, 4M and so on in different artchitectures.

/proc/sys/vm/nr_hugepages indicates the current number of configured hugetlb pages(HugePages_Total) in the kernel.

 

Use the following command to dynamically allocate/deallocate default sized

huge pages:

 

            echo 20 > /proc/sys/vm/nr_hugepages

So the total hugepage memory is  HugePages_Total* Hugepagesize

 

  1. Mount the hugepage filesystem and set page num

mount -t hugetlbfs nodev  /mnt/huge

echo xx > /proc/sys/vm/nr_hugepages

转载于:https://my.oschina.net/u/238880/blog/95410

你可能感兴趣的文章
ECSHOP登录注册信息提示页面的跳转时间设置
查看>>
【转】优化Web程序的最佳实践
查看>>
[转载]灵动思绪EF(Entity FrameWork)
查看>>
如何使用开源库,吐在VS2013发布之前,顺便介绍下VS2013的新特性"Bootstrap"
查看>>
黑马程序员_正则表达式
查看>>
使用Java、Matlab画多边形闭合折线图
查看>>
前端修炼之路:无需一行代码,教你手写克劳德
查看>>
Android防止内存溢出浅析
查看>>
【编程珠玑】读书笔记 第十二章 取样问题
查看>>
Linq 更改主键值
查看>>
Java多线程-并发协作(生产者消费者模型)
查看>>
dp之背包总结篇
查看>>
【进程】进程通信-信号量(信号灯)
查看>>
Oracle Locks之DML锁
查看>>
配置 SQL Server Email 发送以及 Job 的 Notification通知功能
查看>>
Three Families
查看>>
Fiddler教程(转)
查看>>
(面试题)有关Integer
查看>>
移动OA,致我们终将逝去的青春(程序员版)[转]
查看>>
数据库整理
查看>>