前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >使用 FIO 对 PMEM 设备进行测试;解决问题 fio: engine libpmem not loadable;

使用 FIO 对 PMEM 设备进行测试;解决问题 fio: engine libpmem not loadable;

作者头像
xuyaowen
发布2021-07-08 10:36:36
1.2K0
发布2021-07-08 10:36:36
举报
文章被收录于专栏:XUYAOWEN的专栏XUYAOWEN的专栏

基础知识:

FIO 工具使用:https://cloud.tencent.com/developer/article/1766787

PMEM 模型:https://cloud.tencent.com/developer/article/1843708

博客参考:Running FIO with pmem engines

设备概览:

代码语言:javascript
复制
➜  examples sudo ndctl list -N -D -u --regions -i
{
  "dimms":[
    {
      "dev":"nmem1",
      "id":"8089-a2-1930-000008e9",
      "handle":"0x10",
      "phys_id":"0x45"
    },
    {
      "dev":"nmem3",
      "id":"8089-a2-1930-000011fe",
      "handle":"0x1010",
      "phys_id":"0x51"
    },
    {
      "dev":"nmem0",
      "id":"8089-a2-1930-00000b6f",
      "handle":"0",
      "phys_id":"0x43"
    },
    {
      "dev":"nmem2",
      "id":"8089-a2-1930-00000fc8",
      "handle":"0x1000",
      "phys_id":"0x4f"
    }
  ],
  "regions":[
    {
      "dev":"region1",
      "size":"252.00 GiB (270.58 GB)",
      "available_size":0,
      "type":"pmem",
      "numa_node":1,
      "iset_id":"0xc0f2eeb826532444",
      "mappings":[
        {
          "dimm":"nmem3",
          "offset":"0x10000000",
          "length":"0x1f80000000",
          "position":1
        },
        {
          "dimm":"nmem2",
          "offset":"0x10000000",
          "length":"0x1f80000000",
          "position":0
        }
      ],
      "persistence_domain":"memory_controller",
      "namespaces":[
        {
          "dev":"namespace1.0",
          "mode":"fsdax",
          "map":"dev",
          "size":"248.06 GiB (266.35 GB)",
          "uuid":"a4ec89a0-0b3c-4455-9528-25c73b635a51",
          "raw_uuid":"f42aca99-c2fa-4d4d-af09-95ea3815324e",
          "sector_size":512,
          "blockdev":"pmem1",
          "numa_node":1
        },
        {
          "dev":"namespace1.1",
          "mode":"raw",
          "size":0,
          "uuid":"00000000-0000-0000-0000-000000000000",
          "sector_size":512,
          "state":"disabled",
          "numa_node":1
        }
      ]
    },
    {
      "dev":"region0",
      "size":"252.00 GiB (270.58 GB)",
      "available_size":"252.00 GiB (270.58 GB)",
      "type":"pmem",
      "numa_node":0,
      "iset_id":"0x4840eeb8b8462444",
      "mappings":[
        {
          "dimm":"nmem1",
          "offset":"0x10000000",
          "length":"0x1f80000000",
          "position":1
        },
        {
          "dimm":"nmem0",
          "offset":"0x10000000",
          "length":"0x1f80000000",
          "position":0
        }
      ],
      "persistence_domain":"memory_controller",
      "namespaces":[
        {
          "dev":"namespace0.0",
          "mode":"raw",
          "size":0,
          "uuid":"00000000-0000-0000-0000-000000000000",
          "sector_size":512,
          "state":"disabled",
          "numa_node":0
        }
      ]
    }
  ]
}

JOB文件:修改自 LibpmemSeqR.fio https://github.com/axboe/fio/blob/master/examples/libpmem.fio

代码语言:javascript
复制
#
# run command for this workload:
# numactl -N 1 fio Libpmemjob.fio
# numactl -N 1 fio --output=Libpmemjob.json --output-format=json Libpmemjob.fio
# 
# it binds this FIO workload to CPU 1 only. It should be set according to /dev/pmem1 socket's number
#
[global]
bs=4k
thread
group_reporting
norandommap
overwrite=1
thinktime=0
sync=1
direct=1

ioengine=libpmem
iodepth=1

# by yaowenxu
# Preparing namespace with commands:
# mkfs.ext4 /dev/pmem1
# mount /dev/pmem1 /mnt/pmem/ -o dax
#

directory=/mnt/pmem/yx  # I'm working on directory; each of 'numjobs' gets its own file to work with
size=10GB  # Each file will have this size; so in summary they will fill the whole namespace
unlink=0

time_based
runtime=300
ramp_time=30

[libpmem-seqwrite]
rw=write
stonewall

[libpmem-seqread]
rw=read
stonewall

#[libpmem-randwrite]
#rw=randwrite
#stonewall

#[libpmem-randread]
#rw=randread
#stonewall

FIO版本:(需要对fio重新编译,开启libpmem引擎)

代码语言:javascript
复制
libpmem engine
IO engine that uses libpmem (part of PMDK collection) to write data and libc's memcpy to read. It requires PMDK >= 1.5.

# 编译命令(fio脚本configure文件编写的稍微有些问题,不能正确配置ldflags和cflags,在此处我使用环境变量解决)
yaowen@zju:~/packages/fio-fio-3.27$ export LDFLAGS='-L/home/yaowen/local/lib/'
yaowen@zju:~/packages/fio-fio-3.27$ export CFLAGS='-I/home/yaowen/local/include/'
yaowen@zju:~/packages/fio-fio-3.27$ ./configure --prefix=/home/yaowen/local

# engines展示

测试命令:(针对fsdax模式进行测试)

代码语言:javascript
复制
numactl -N 1 fio --output=Libpmemjob.json --output-format=json Libpmemjob.fio

测试结果:测试数据我就不放了,如果需要技术交流,可以留言。

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2021-07-02 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档