首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
  • 您找到你想要的搜索结果了吗?
    是的
    没有找到

    fio基础15

    iomem=str mem=str Fio can use various types of memory as the io unit buffer. The allowed values are: malloc Use memory from malloc(3) as the buffers. shm Use shared memory as the buffers. Allocated through shmget(2). shmhuge Same as shm, but use huge pages as backing. mmap Use mmap to allocate buffers. May either be anonymous memory, or can be file backed if a filename is given after the option. The format is mem=mmap:/path/to/file. mmaphuge Use a memory mapped huge file as the buffer backing. Append filename after mmaphuge, ala mem=mmaphuge:/hugetlbfs/file mmapshared Same as mmap, but use a MMAP_SHARED mapping. The area allocated is a function of the maximum allowed bs size for the job, multiplied by the io depth given. Note that for shmhuge and mmaphuge to work, the system must have free huge pages allocated. This can normally be checked and set by reading/writing /proc/sys/vm/nr_hugepages on a Linux system. Fio assumes a huge page is 4MB in size. So to calculate the number of huge pages you need for a given job file, add up the io depth of all jobs (normally one unless iodepth= is used) and multiply by the maximum bs set. Then divide that number by the huge page size. You can see the size of the huge pages in /proc/meminfo. If no huge pages are allocated by having a non-zero number in nr_hugepages, using mmaphuge or shmhuge will fail. Also see hugepage-size. mmaphuge also needs to have hugetlbfs mounted and the file location should point there. So if it'smountedin/huge,youwouldusemem=mmaphuge:/huge/somefile.iomem_align=intThisindiciatesthememoryalignmentoftheIOmemorybuffers.NotethatthegivenalignmentisappliedtothefirstIOunitbuffer,ifusingiodepththealignmentofthefollowingbuffersaregivenbythebsused.Inotherwords,ifusingabsthatisamultipleofthepagesizedinthesystem,allbufferswillbealignedtothisvalue.Ifusingabsthatisnotpagealigned,thealignmentofsubsequentIOmemorybuffersisthesumoftheiomem_alignandbsused.hugepage-size=intDefinesthesiz

    05

    Linux进程间通信(四) - 共享内存

    共享内存的优势 采用共享内存通信的一个显而易见的好处是效率高,因为进程可以直接读写内存,而不需要任何数据的拷贝。对于像管道和消息队列等通信方式,则需要在内核和用户空间进行四次的数据拷贝,而共享内存则只拷贝两次数据:一次从输入文件到共享内存区,另一次从共享内存区到输出文件。实际上,进程之间在共享内存时,并不总是读写少量数据后就解除映射,有新的通信时,再重新建立共享内存区域。而是保持共享区域,直到通信完毕为止,这样,数据内容一直保存在共享内存中,并没有写回文件。共享内存中的内容往往是在解除映射时才写回文件的。因

    06
    领券