- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
内存与io访问(Memory and IO access)
内存与io访问(Memory and IO access)
Memory and I/O access
Memory allocation
The kernel provides a unified memory management interface for device drivers, so there is no need for issues such as segmentation and paging. The application memory for memory in the Linux kernel space includes kmalloc (), __get_free_pages (), and vmalloc (). Kmalloc __get_free_pages and () () the application of memory in physical memory mapping area, and on the physical is continuous, they and the real physical addresses only a fixed offset, so there is a simple transformation relationship. And vmalloc () in the virtual memory space is given a piece of contiguous memory space, in essence, the continuous presence in the physical memory in the virtual must not continuous, and vmalloc () the application of virtual memory, and also does not have the simple conversion relations between physical memory.
Kmalloc function inside
Kmalloc is a powerful and fast (unless blocked) tool that is allocated to the existing physical memory and maintains the original data (not clear). Prototype:
# include Linux/slab. H
Void * kmalloc (size_t size, int flags);
The size parameter
The kernel manages the physical memory of the system, and the physical memory can only be allocated according to the page. Kmalloc and typical user space malloc are actually quite different, and the kernel USES special based allocation techniques to best use system RAM.
It is important to note that the kernel can only assign a number of predefined, fixed-size byte arrays. The smallest chunk of memory that kmalloc can handle is 32 or 64 bytes (architecture dependent), and the upper limit of the memory block size varies with the system and kernel configuration. In view of portability, memory should not be greater than 128 KB. If you need more than a few kilobytes of memory, youd better use other methods.
The flags parameter
The memory allocation always ends up calling __get_free_pages for the actual allocation, which is where the GFP_ prefix
您可能关注的文档
- 冒顶及其预兆(The summit and its harbingers).doc
- 冷轧钢板与热轧板的对比(Contrast between cold rolled steel sheet and hot rolled plate).doc
- 净水器招商攻略系列之产品定位(A series of product positioning for the net water purifier).doc
- 冻融破坏(Freeze-thaw damage).doc
- 凉茶和其正正合很难,出奇才能胜!(Cold tea and its positive the match is difficult, surprise ability win!).doc
- 减水性外加剂在施工中的应用方法(The application method of water-reducing admixture in construction).doc
- 几款平民级的国产功放(A few civilian level of domestic amplifier).doc
- 几款较好的网络电视(A few good network TV).doc
- 几种大师的建筑风格001(Architectural style of several masters).doc
- 几种常见建筑给水管材的应用(The application of several common building water pipes).doc
- 内容标签的调用说明(The invocation of the content label).doc
- 内河轮机电气试题精选,专门针对大管轮的(Inland water turbine electric test select, specially for large pipe wheel).doc
- 内科学8风湿性疾病(Internal science 8 rheumatic disease).doc
- 世界风景名胜纵览之巴基斯坦(The world view of Pakistan).doc
- 内科护理学04任务(Department of internal medicine).doc
- 内科护理学模拟试题1(Internal medicine nursing simulation exam 1).doc
- 再见逆转(Goodbye to reverse).doc
- 内科留置导尿患者护理体会(The nursing experience of the patient in internal medicine).doc
- 写字顺序大全(Write in full order).doc
- 写景好段摘抄大全(A good picture of a good time).doc
最近下载
- 大学有机化学第1章绪论ppt课件.pptx VIP
- Unit 1 Happy Holiday Section B 1a-1d(学案)2025-2026学年人教版英语(2024)八年级上册.docx VIP
- 医美抗衰美容干细胞抗衰产品项目知识课件.pptx VIP
- 合肥市残疾人证课件.ppt VIP
- 牛津译林版初中英语新教材七年级上册全册单词表.xlsx VIP
- 《企业数字化转型之课件解决方案》课件.ppt VIP
- 工程临时用电施工组织设计.doc VIP
- 欧科PT300变频器说明书.pdf
- 2025年广东南粤集团有限公司招聘笔试备考试题及答案解析.docx VIP
- 飞行器总体设计.pptx VIP
文档评论(0)