Skip to content

Commit 6ab4e1f

Browse files
committed
add slab & mem page related questions
1 parent e38c774 commit 6ab4e1f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

kernel.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@
268268
9、buddy system 分配的是物理内存还是虚拟内存?
269269

270270
10、简单解释下slab着色?
271+
(tips:通过计算slab各个object在缓存行的偏移来避免在cache line被换出时,
272+
影响其他object的cache 命中率)
271273

272274
11、匿名页面和文件缓冲页面有什么区别?
273275

@@ -582,6 +584,11 @@
582584
major page fault表示数据页需要从磁盘等设备中读取
583585
一般,major page fault出现的数量太多,表示频繁的读取磁盘)
584586

587+
107、为什么采用分页模式起来管理内存?
588+
(tips:分段方式没有内碎片,但是因为各个段的长度不能严格保证是2的整数次幂,
589+
会造成内存的外碎片,导致数据访问效率降低,分页模式则没有这个问题,
590+
另一方面,在真正使用内存之前,有可能不知道数据的长度,所以段的长度不定)
591+
585592

586593

587594
// 其他

0 commit comments

Comments
 (0)