美文网首页
How to emulate Persistent Memory

How to emulate Persistent Memory

作者: Glitter试做一号机 | 来源:发表于2018-08-13 19:34 被阅读0次

    1. 下载内核代码包

    到官网https://www.kernel.org/,下载内核代码包,需要4.2以上的版本

    2. 解压编译内核

    tar -xvf linuxxxx.tar.xz

    yum install ncurses-devel ncurses

    yum install openssl-devel

    make -jx

    编译之前需要根据PMDK的官网的指示,首先通过make nconfig设置几个参数

    分别是

    Device Drivers ---> 
            {*} NVDIMM (Non-Volatile Memory Device) Support --->
                <M>   PMEM: Persistent memory block device support
                <M>   BLK: Block data window (aperture) device
    
    Processor type and features --->
            [*] Support non-standard NVDIMMs and ADR protected memory
            [*] Device memory (pmem, etc...) hotplug support
        File systems --->
            [*] Direct Access (DAX) support 
    

    nconfig依赖于curses包,所以需要安装curses

    然后就可以开始编译内核

    3. 安装内核

    yum install elfutils-libelf-devel

    make install_modules install

    这里需要安装一个libelf包

    4. 设置pmem的内存保留区间并通过grub生成配置,重启即可

    1. 修改grub文件中GRUB_CMDLINE_LINUX="memmap=nn[KMG]!ss[KMG]"

    2. sudo grub2-mkconfig -o /boot/grub2/grub.cfg

    3. 重启之后,fdisk -l就会显示pmem设备

    image

    通过dmesg也可以看到系统内存地址空间中有一段成为了Persistent


    image

    相关文章

      网友评论

          本文标题:How to emulate Persistent Memory

          本文链接:https://www.haomeiwen.com/subject/jztpbftx.html