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

python源码阅读笔记之GC(一)

python源码阅读: 参考书籍:《python源码剖析》 摘要:写这个系列的目的呢,是想为python的学习画上一个暂时的句号,接下来的重点应该是scala这门语言和其身后的函数式编程思想了。整个文章大概会分为python的对象体系(主要是container对象的字典以及字符串),函数和类的运行机制,模块的动态加载,线程机制,垃圾回收机制。不会做到面面俱到,但是会尽量把底层的代码展现给大家,这次的python的源码使用的是python 2.7.2版本。 一、源码的目录体系和整体架构 File Groups Python Core Runtime Environment Core Modules SCanner Object/Type Structures Library Parser Memory Allocator User-defined Compiler Current State Of Python Modules Code Evauator 简单来说,你可以把python的解释器视为一个优秀的编译原理实践,ANSI C实现的。遵循了最流行的词法分析,解析成token,再语法分析,建立抽象语法树AST,最后compiler根据AST,生成字节码,执行。 目录 概要 Demo python的演示程序,里面包括了CGI,class演示等 Doc python的文档 Grammar python的语法文件 Include python编译时引用的头文件 Lib 标准附加库 Mac Mac用的工具 Misc 各种文件的集合(例如vim) Modules python的C语言扩展 Objects python的对象使用的C语言代码 PC 依存于操作环境 PCbuild 构造win32和x64用的 Parser python用的解析器 Python python的核心

02

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
领券