《Professional Linux Kernel Architecture》读书笔记 (1)

个人觉得读Linux内核架构是理解操作系统最好的方式,于是在实习之余开始读这本书。估计要很久才能读完。这是上周的笔记。

1. 当Linux在中断模式的情况下,内核没有权限访问用户的内存空间。


2. 对于32bit的操作系统,每个进程眼中的虚存都是4G,64位的会小于2的64次方,大约用其中的47位。。。因为用的字长越多,映射寻址时越慢。


3. 虚存往往大于实际内存。虚存和实际内存都切分成很多大小相同的pages。两个进程的虚存可能共享实际内存中的同一个Page。虚存的page中可能有一些没有对应内存中Page。


4. 实际的内存页 也叫 page frames. In contrast, 而虚存的页叫做 page 。


5. 海量数组处理: 如果需要的数组很大,但数组对应的distinct 值却没有那么多,可以把数组切成多个。例如数组长度本为1000,可以切成三层,每层长度为10的三个数组。缺点是访问多级数组比访问一个数组要慢。.


6. 在内核的抢占调度模型中,system call 是不能被一般进程抢占的。但可以被中断暂停。中断具有最高的优先级。


7. Copy on Write方法: 即在需要修改时才进行实际数据的copy。例如Linux 中 在fork时,父进程的所有资源需复制给新建的子进程,而现在linux使用Copy on Write, 即fork时只复制page table(即一张映射表),所以父子进程的page table 指向同一块 physical pages,但只读,当父子进程中的任何一个需要write或update 这块

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Publisher: Wrox Page : 1371 This book discusses the concepts, structure, and implementation of the Linux kernel. In particular, the individual chapters cover the following topics: ❑ Chapter 1 provides an overview of the Linux kernel and describes the big picture that is investigated more closely in the following chapters. ❑ Chapter 2 talks about the basics of multitasking, scheduling, and process management, and investigates how these fundamental techniques and abstractions are implemented. ❑ Chapter 3 discusses how physical memory is managed. Both the interaction with hardware and the in-kernel distribution of RAM via the buddy system and the slab allocator are covered. ❑ Chapter 4 proceeds to describe how userland processes experience virtual memory, and the comprehensive data structures and actions required from the kernel to implement this view. ❑ Chapter 5 introduces the mechanisms required to ensure proper operation of the kernel on multiprocessor systems. Additionally, it covers the related question of how processes can communicate with each other. ❑ Chapter 6 walks you through the means for writing device drivers that are required to add support for new hardware to the kernel. ❑ Chapter 7 explains how modules allow for dynamically adding new functionality to the kernel. ❑ Chapter 8 discusses the virtual filesystem, a generic layer of the kernel that allows for supporting a wide range of different filesystems, both physical and virtual. ❑ Chapter 9 describes the extended filesystem family, that is, the Ext2 and Ext3 filesystems that are the standard workhorses of many Linux installations. ❑ Chapter 10 goes on to discuss procfs and sysfs, two filesystems that are not designed to store information, but to present meta-information about the kernel to userland. Additionally, a number of means to ease writing filesystems are presented. ❑ Chapter 11 shows how extended attributes and access control lists that can help to improve system security are implemented. ❑ Chapter 12 discusses the networking implementation of the kernel, with a specific focus on IPv4, TCP, UDP, and netfilter. ❑ Chapter 13 introduces how systems calls that are the standard way to request a kernel action from userland are implemented. ❑ Chapter 14 analyzes how kernel activities are triggered with interrupts, and presents means of deferring work to a later point in time. ❑ Chapter 15 shows how the kernel handles all time-related requirements, both with low and high resolution. ❑ Chapter 16 talks about speeding up kernel operations with the help of the page and buffer caches. ❑ Chapter 17 discusses how cached data in memory are synchronized with their sources on persistent storage devices. ❑ Chapter 18 introduces how page reclaim and swapping work.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值