The Design Of Unix Operating System (4) Buffer cache
来源:互联网 发布:我是大主宰升阶数据 编辑:程序博客网 时间:2024/06/10 00:13
- A logical disk block should not be mapped to two buffers.
- Each buffer contains a buffer header, which include fileds: the logic device number, logic block number, the status of the buffer, and two sets of pointers to data arrays.
device number
block number
status
pointer to data area
pointer to next buffer on hash queue
pointer to previous buffer on hash queue
pointer to next buffer on free list
pointer to previous buffer on free list
buffer header
- The kernel uses Least Recently Used algorithm to allocate a buffer to the data block.
- The kernal maints a double linked list of free buffers, and in the mean while it uses a hash queue to organise the buffers allocated to the device blocks, as shown below, which will help to find the blocks ASAP. The hash is calculated with device number and block number. A buffer might be contained in both the free list and the hass queue list.blockno 0 mod 4 | pointer to buff queue blockno 1 mod 4 | pointer to buff queue blockno 2 mod 4 | pointer to buff queue blockno3 mode 4| pointer to buff queue buffers on the hash queues
- The user programs do Not need to care about data alignment in his program(not a network communication program), because the kernel will copy the data from user buffer to kernel buffer, and the kernel will handle data alignemtn subsequently.
- The Design Of Unix Operating System (4) Buffer cache
- The Design of Unix Operating System (2) kernel
- The design of Unix Operating System (1) overview of System V
- The Design of Unix Operating System (5) the internal presentation of file
- History of Unix operating system
- /LGC设计模式/The Design of a cache buffer
- Migrating to the Solaris Operating System: The Discipline of UNIX-to-UNIX Migrations
- 《Learning the UNIX Operating System》 第一章:入门
- POSIX——Portable Operating System Interface of UNIX
- 从软件设计角度下的操作系统发展轨迹——From the perspective of the software design of operating system course
- Notes of operating system
- Tuning the Operating System
- Use of Common Dialogs (offered by the operating system)
- Chapter 9 The Development of Computer Operating System
- 操作系统概述操——Summary of the operating system
- 揭秘UNIX文件缓存(the buffer cache)(理论篇)
- 揭秘UNIX文件缓存(the buffer cache)(实战篇)
- Describe the process of opening a file in Linux system, what actions the operating system w
- hibernate 的hbm.xml配置
- 快速生成树之时间信息
- 此域的推荐安全级别是“安全级-高
- 续IIS烦人的那些事之完美代替IIS6的小软件
- 线程锁的是对象(线程) synchronized 通过锁对象来锁代码
- The Design Of Unix Operating System (4) Buffer cache
- little endian VS big endian
- Java初级练习--读入txt中字符串个数统计
- C# Stream 和 byte[] 之间的转换
- LINQ 学习(二)
- java虚拟机CVM到ARM平台
- uCOS-II的任务控制块
- 给思想一缕阳光,送心情几只贝壳
- DCD DSR DTR RTS CTS表示什么意思