<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Os_kernel on Yuchen You</title>
    <link>https://www.whoami-wesleyyou.top/tags/os_kernel/</link>
    <description>Recent content in Os_kernel on Yuchen You</description>
    <generator>Hugo</generator>
    <language>zh-CN</language>
    <lastBuildDate>Tue, 30 Sep 2025 21:23:07 +0800</lastBuildDate>
    <atom:link href="https://www.whoami-wesleyyou.top/tags/os_kernel/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>19. Scheduler Activations: Effective Kernel Support  for the User-Level Management of Parallelism</title>
      <link>https://www.whoami-wesleyyou.top/2025/09/30/computer_system_basics/os/historical/19.scheduler_activation/</link>
      <pubDate>Tue, 30 Sep 2025 21:23:07 +0800</pubDate>
      <guid>https://www.whoami-wesleyyou.top/2025/09/30/computer_system_basics/os/historical/19.scheduler_activation/</guid>
      <description>&lt;h2 id=&#34;背景&#34;&gt;背景&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;并行计算的效果, 取决于创建和管理并行的开销; 开销大的话即使 coarse grained parallelism 也不划算; 开销小的话, 即使 fine grained parallelism 也划算;&lt;/li&gt;
&lt;li&gt;传统 UNIX 进程 = 单地址空间 + 单执行流;&lt;/li&gt;
&lt;li&gt;设计目标是单核多道程序环境(multiprogramming), 适合粗粒度并行, 不适合细粒度并行;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;线程支持的两种方式&#34;&gt;线程支持的两种方式&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;用户级线程 (User-level threads)&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;通过 runtime library 库实现(不改内核);&lt;/li&gt;
&lt;li&gt;优点:
&lt;ul&gt;
&lt;li&gt;性能好: 上下文切换, 创建销毁的代价接近过程调用;&lt;/li&gt;
&lt;li&gt;灵活: 可以按语言/应用需求定制;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;缺点:
&lt;ul&gt;
&lt;li&gt;内核对线程不可见, 仍然只认识&amp;quot;进程&amp;quot;;&lt;/li&gt;
&lt;li&gt;进程就像虚拟 CPU, 被内核调度到物理 CPU 上;&lt;/li&gt;
&lt;li&gt;遇到 I/O 阻塞, 页面缺页, 多道并发 时, 线程库感知不到真实 CPU 情况, 导致性能下降甚至错误;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;ol start=&#34;2&#34;&gt;
&lt;li&gt;内核级线程 (Kernel threads)&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;内核直接提供多线程支持, 每个线程对内核可见, 内核负责调度;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;优点:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;与系统资源和调度机制直接集成, 没有&amp;quot;virtual/real processor 错位&amp;quot;的问题;&lt;/li&gt;
&lt;li&gt;不会出现用户级线程那种 &amp;ldquo;一挂全挂&amp;rdquo;(比如一个线程阻塞整个进程);&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;缺点:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;内核操作比用户空间 heavyweight 得多;&lt;/li&gt;
&lt;li&gt;性能明显比用户级线程差 (通常差一个数量级);&lt;/li&gt;
&lt;li&gt;对于很多并行程序仍然&amp;quot;太重&amp;quot;;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;ULT 库会在程序启动时调用内核 API(比如现代系统里 pthread_create())来创建一批内核线程;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;数量一般与物理 CPU 数接近, 用来&amp;quot;占位&amp;quot;, 相当于&amp;quot;虚拟 CPU 池&amp;quot;;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;ULT 线程 &lt;strong&gt;绑定&lt;/strong&gt; 在这些 KLT 上运行&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;每个内核线程里跑的是用户线程库的调度循环;&lt;/li&gt;
&lt;li&gt;库自己决定哪个用户线程在这个内核线程里执行;&lt;/li&gt;
&lt;li&gt;所以用户线程确实是基于内核线程执行的;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;</description>
    </item>
    <item>
      <title>My VM is Lighter (and Safer) than your Container</title>
      <link>https://www.whoami-wesleyyou.top/2025/09/23/computer_system_basics/os/historical/15.vm_lighter_than_container/</link>
      <pubDate>Tue, 23 Sep 2025 19:03:49 +0800</pubDate>
      <guid>https://www.whoami-wesleyyou.top/2025/09/23/computer_system_basics/os/historical/15.vm_lighter_than_container/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;背景&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;容器(Docker/LXC)在工业界广泛应用: Google, AWS, Azure, GCP 都依赖容器;&lt;/li&gt;
&lt;li&gt;容器优势:
&lt;ul&gt;
&lt;li&gt;快速实例化(毫秒~百毫秒)&lt;/li&gt;
&lt;li&gt;高密度运行(单机可数千~上万实例)&lt;/li&gt;
&lt;li&gt;内存占用小, 镜像体积小&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;问题&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;安全性不足:
&lt;ul&gt;
&lt;li&gt;容器暴露 &lt;strong&gt;400+ syscalls&lt;/strong&gt;, 内核攻击面巨大;&lt;/li&gt;
&lt;li&gt;隔离性不如 VM, 常需要&amp;quot;容器运行在 VM 内&amp;quot;来补强;&lt;/li&gt;
&lt;li&gt;资源滥用(fork bomb, 文件描述符耗尽)可导致宿主机 DoS;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;目标&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;结合容器的轻量性与 VM 的强隔离;&lt;/li&gt;
&lt;li&gt;需求:
&lt;ul&gt;
&lt;li&gt;毫秒级实例化&lt;/li&gt;
&lt;li&gt;高密度运行&lt;/li&gt;
&lt;li&gt;小镜像/低内存占用&lt;/li&gt;
&lt;li&gt;快速挂起/恢复&lt;/li&gt;
&lt;li&gt;保持 VM 的硬件隔离安全性&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;贡献&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;分析 Xen 性能瓶颈, 重构控制面:
&lt;ul&gt;
&lt;li&gt;移除 XenStore (&lt;strong&gt;noxs&lt;/strong&gt;), 消除中心化瓶颈;&lt;/li&gt;
&lt;li&gt;新工具链 &lt;strong&gt;chaos/libchaos&lt;/strong&gt; + &lt;strong&gt;split toolstack&lt;/strong&gt;;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;提出 &lt;strong&gt;Tinyx&lt;/strong&gt; 工具, 生成极小 Linux VM; 支持 unikernel;&lt;/li&gt;
&lt;li&gt;实现 &lt;strong&gt;LightVM&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;</description>
    </item>
    <item>
      <title>The Turtles Project: Design and Implementation of Nested Virtualization</title>
      <link>https://www.whoami-wesleyyou.top/2025/09/22/computer_system_basics/os/historical/14.turtle_IBM/</link>
      <pubDate>Mon, 22 Sep 2025 12:50:08 +0800</pubDate>
      <guid>https://www.whoami-wesleyyou.top/2025/09/22/computer_system_basics/os/historical/14.turtle_IBM/</guid>
      <description>&lt;p&gt;Authors: Muli Ben-Yehuda et al., IBM Research / IBM Linux Technology Center&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;1-背景与动机&#34;&gt;1. 背景与动机&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;传统虚拟化 (single-level)&lt;/strong&gt;: 一个 hypervisor (L0) 管理多个 VM, 每个 VM 运行 OS;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;嵌套虚拟化 (nested virtualization)&lt;/strong&gt;: 允许一个 hypervisor (L1) 作为 guest 运行, 并且还能继续运行自己的 VM (L2);&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;需求来源&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;现代操作系统自带虚拟化功能&lt;/strong&gt;(Windows XP mode in Win7, Linux 内置 KVM);&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;IaaS 场景&lt;/strong&gt;: 云提供商 (L0) 希望用户能运行自己的 hypervisor (L1), 自己管理 VM (L2);&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;研究和测试&lt;/strong&gt;: 嵌套虚拟化方便调试/benchmark hypervisor;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;安全性&lt;/strong&gt;: 可以研究/防御 hypervisor-level rootkit;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;iaas-infrastructure-as-a-service&#34;&gt;IaaS (Infrastructure as a Service)&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;云计算三层服务之一: IaaS / PaaS / SaaS;&lt;/li&gt;
&lt;li&gt;IaaS = 提供虚拟化的计算资源(VM, 存储, 网络);&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;例子&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;AWS EC2: 创业公司快速租用 VM, 按需扩展;&lt;/li&gt;
&lt;li&gt;Google Cloud GPU: 科研人员租用 A100 GPU VM;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;与论文关系: 云提供商必须支持 nested virtualization, 才能让用户在 VM 内运行自己的 hypervisor;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id=&#34;2-虚拟化理论基础&#34;&gt;2. 虚拟化理论基础&lt;/h2&gt;
&lt;h3 id=&#34;popekgoldberg-1974&#34;&gt;Popek–Goldberg (1974)&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;三大条件&lt;/strong&gt;: 等价性 (equivalence), 资源控制 (resource control), 效率 (efficiency);&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;定理&lt;/strong&gt;: 如果架构中所有 &lt;strong&gt;sensitive 指令&lt;/strong&gt; 都是 &lt;strong&gt;privileged 指令&lt;/strong&gt;, 则该架构是可虚拟化的;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;影响&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;解释了早期 x86 &lt;strong&gt;不可完全虚拟化&lt;/strong&gt; $\rightarrow$ VMware 使用二进制翻译绕过;&lt;/li&gt;
&lt;li&gt;推动了 Intel/AMD 添加 VT-x / SVM 硬件扩展;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id=&#34;3-两种嵌套虚拟化模型&#34;&gt;3. 两种嵌套虚拟化模型&lt;/h2&gt;
&lt;h3 id=&#34;1-multi-level-support&#34;&gt;1) Multi-level support&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;硬件直接支持多层 hypervisor;&lt;/li&gt;
&lt;li&gt;Trap 从 L2 直接交给 L1;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;例子&lt;/strong&gt;: IBM System z;&lt;/li&gt;
&lt;li&gt;高效, 但硬件设计复杂; 且一般多层的支持都是有限的, 如只支持两层, 这篇论文是在理论上支持任意层数的嵌套虚拟化, 因此更高层的虚拟化实际上还是依赖于单层虚拟化的软件支持逻辑: &lt;strong&gt;compress&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;2-single-level-support&#34;&gt;2) Single-level support&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;硬件只有一层 root mode (L0);&lt;/li&gt;
&lt;li&gt;所有 trap(无论来自 L1, L2, L3)&lt;strong&gt;都掉到 L0&lt;/strong&gt;;&lt;/li&gt;
&lt;li&gt;L0 决定是否转发给 L1;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;例子&lt;/strong&gt;: x86 的 Intel VT-x (VMX), AMD SVM;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Multiplexing single-level&lt;/strong&gt;: L0 将唯一的一层虚拟化能力&amp;quot;复用&amp;quot;, 对上层 L1/L2 进行模拟;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id=&#34;4-cpu-虚拟化-vmx&#34;&gt;4. CPU 虚拟化 (VMX)&lt;/h2&gt;
&lt;h3 id=&#34;vmx--l0&#34;&gt;VMX &amp;amp; L0&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;VMX&lt;/strong&gt; = Intel VT-x 的指令扩展集;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;L0&lt;/strong&gt; = 唯一运行在 VMX root mode 的 hypervisor;&lt;/li&gt;
&lt;li&gt;所有 VMExit/VMEntry 都必须经过 L0;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Trap 流程&lt;/strong&gt;: Single-level support: L2 trap $\rightarrow$ L0 trap handler $\rightarrow$ L0 转发给 L1;&lt;/p&gt;</description>
    </item>
    <item>
      <title>A Comparison of Software and Hardware Techniques for x86 Virtualization</title>
      <link>https://www.whoami-wesleyyou.top/2025/09/21/computer_system_basics/os/historical/13.x86virt_comp/</link>
      <pubDate>Sun, 21 Sep 2025 20:22:43 +0800</pubDate>
      <guid>https://www.whoami-wesleyyou.top/2025/09/21/computer_system_basics/os/historical/13.x86virt_comp/</guid>
      <description>&lt;p&gt;The main technical contributions of this paper are:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;a review of VMware Workstation&amp;rsquo;s software VMM, focusing on performance properties of the virtual instruction execution engine;&lt;/li&gt;
&lt;li&gt;a review of the emerging hardware support, identifying performance trade-offs;&lt;/li&gt;
&lt;li&gt;a quantitative performance comparison of a software and a hardware VMM.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Establishes &lt;strong&gt;three essential characteristics&lt;/strong&gt; for system software to be considered a VMM&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Fidelity(保真性)&lt;/strong&gt; Software on the VMM executes identically to its execution on hardware, barring timing effects.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Performance(高性能)&lt;/strong&gt; An overwhelming majority of guest instructions are executed by the hardware without the intervention of the VMM.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Safety(安全性)&lt;/strong&gt; The VMM manages all hardware resources.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;1-基础概念&#34;&gt;1. 基础概念&lt;/h2&gt;
&lt;h3 id=&#34;vmm-vs-hypervisor&#34;&gt;VMM vs Hypervisor&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;VMM (Virtual Machine Monitor)&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;来自 Popek &amp;amp; Goldberg (1974), 强调核心虚拟化功能(trap &amp;amp; emulate, BT, shadow structures);&lt;/li&gt;
&lt;li&gt;负责虚拟机执行控制;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Hypervisor&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;工程上更常用的术语, 指整个虚拟化层;&lt;/li&gt;
&lt;li&gt;包含 VMM, 同时提供调度, 资源分配, 设备模型, 管理接口;&lt;/li&gt;
&lt;li&gt;Type 1(bare-metal, 如 Xen, ESXi), Type 2(hosted, 如 VMware Workstation);&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;</description>
    </item>
    <item>
      <title>Disco: Running Commodity Operating Systems on Scalable Multiprocessors</title>
      <link>https://www.whoami-wesleyyou.top/2025/09/15/computer_system_basics/os/historical/11.disco/</link>
      <pubDate>Mon, 15 Sep 2025 13:17:28 +0800</pubDate>
      <guid>https://www.whoami-wesleyyou.top/2025/09/15/computer_system_basics/os/historical/11.disco/</guid>
      <description>&lt;p&gt;这篇论文是 VMware 的基石论文&lt;/p&gt;
&lt;h2 id=&#34;历史背景和硬件&#34;&gt;历史背景和硬件&lt;/h2&gt;
&lt;p&gt;在上世纪 90 年代, 硬件设计已经非常厉害了, 但是多个商业系统跑在一个硬件机器上非常困难, 因此这篇论文设计了一个模式:&lt;br&gt;
在 hardware 和 os 之间添加一个中间层, &lt;strong&gt;类似&lt;/strong&gt; 于一个 vmm 来进行隔离&lt;/p&gt;
&lt;p&gt;这里的硬件背景:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Stanford FLASH shared memory multiprocessor&lt;/li&gt;
&lt;li&gt;experimental cache coherent non-uniform memory architecture (ccNUMA)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;传统的不足&#34;&gt;传统的不足&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;硬件的革新需要 significant OS changes&lt;/li&gt;
&lt;li&gt;OS 本体代码量过大并不适合修改来适配硬件&lt;/li&gt;
&lt;li&gt;buggy/incompatible system software can significantly impact the success of such machines&lt;/li&gt;
&lt;li&gt;commodity OS system software 具有 constraints + inflexibility 的缺点&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;关键词&#34;&gt;关键词&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;scalable&lt;/strong&gt;: 设计的系统可以适配不同的(未来的)硬件
&lt;ul&gt;
&lt;li&gt;意味着系统设计能随着处理器数量的增加(几十到几百个 CPU)依然保持良好性能&lt;/li&gt;
&lt;li&gt;传统系统只有少量 cpu 并且用一条总线通信, 但是随着 cpu 数量增加, 总线会成为瓶颈&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;UMA&lt;/strong&gt;: 统一内存访问, 所有 cpu 访问内存的速度相同, 也就是用上文的总线通信, 随着 cpu 数量增加, 总线压力增大, 性能下降&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;NUMA&lt;/strong&gt;: 非统一内存访问, 每个 cpu 有自己的本地内存, 访问本地内存速度快, 访问其他 cpu 的内存速度慢, 这样随着 cpu 数量增加, 性能下降不明显&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ccNUMA 的 cc&lt;/strong&gt;: cache-coherent, 每个 cpu 有自己的缓存, 但是缓存之间需要保持一致性, 这样可以提高性能,但是也增加了复杂度
&lt;ul&gt;
&lt;li&gt;常见方式是 &lt;strong&gt;目录协议 (directory-based coherence)&lt;/strong&gt;, 每个内存块有一个目录记录谁缓存了它, 当有更新时通知或失效这些缓存&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;flexible&lt;/strong&gt;: 可以适配不同的 OS (注意 scalable 强调的是硬件的多样性, flexible 强调的是软件的多样性)
&lt;ul&gt;
&lt;li&gt;系统能支持多样化的使用场景, 工作负载和配置, 而不是只能针对单一情况优化&lt;/li&gt;
&lt;li&gt;这里着重强调对 variety of workloads 的支持, 例如 cpu 密集型, io 密集型, 内存密集型等&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;commodity OS&lt;/strong&gt;: 现成的, 广泛使用的操作系统, 例如 Linux, Windows, 能应对各种应用场景, 但缺乏针对特定硬件的优化&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;specialized OS&lt;/strong&gt;: 针对特定硬件或应用场景优化的操作系统, 例如实时操作系统, 嵌入式系统, 但缺乏通用性&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;shared memory multiprocessor&lt;/strong&gt;: 多个处理器可以访问同一块内存
&lt;ul&gt;
&lt;li&gt;所有处理器访问 同一个全局内存地址空间(不像分布式系统那样各有独立内存);
&lt;ul&gt;
&lt;li&gt;好处: 编程模型更简单(多个 CPU 看起来就像在同一个大内存上操作);&lt;/li&gt;
&lt;li&gt;问题: 容易出现 内存访问冲突 和 一致性问题;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;FLASH 硬件&lt;/strong&gt;: 多个节点, 每个节点有 CPU, 内存和 I/O, 通过高速互连组成; 采用目录协议保持缓存一致性, 因此对软件呈现的是一个 共享内存多处理器, 带有 NUMA 特性&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;vm-方案的缺点&#34;&gt;VM 方案的缺点&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Overheads(性能开销)&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;需要软件模拟特权指令, 虚拟化 I/O, 带来额外异常处理和执行开销;&lt;/li&gt;
&lt;li&gt;每个 VM 都要复制 OS 和应用的代码/数据, 还会重复维护大内存结构(如文件系统 buffer cache), 导致内存浪费;&lt;/li&gt;
&lt;/ul&gt;
&lt;ol start=&#34;2&#34;&gt;
&lt;li&gt;Resource Management (资源管理问题)&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;VMM 缺乏操作系统的高层语义, 只能&amp;quot;盲目&amp;quot;调度;&lt;/li&gt;
&lt;li&gt;例如无法区分 idle loop (busy waiting 对 vmm 层透明) 与有效计算, 可能浪费 CPU 时间; 也无法知道某页内存是否已不再使用, 导致内存分配效率低;&lt;/li&gt;
&lt;/ul&gt;
&lt;ol start=&#34;3&#34;&gt;
&lt;li&gt;Communication and Sharing(通信与共享困难)&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;不同 VM 之间的文件, 磁盘, 应用难以共享;&lt;/li&gt;
&lt;li&gt;例如在 VM/370 上, 一个用户的虚拟磁盘若被一个 VM 占用, 另一个 VM 无法访问;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;作者观点: 虽然这些缺点依然存在, 但通过结合现代操作系统对分布式环境的支持, 以及 VMM 的新设计技巧, 它们的影响可以大大减轻;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Mach: A New Kernel Foundation For UNIX Development</title>
      <link>https://www.whoami-wesleyyou.top/2025/09/13/computer_system_basics/os/historical/6.Mach/</link>
      <pubDate>Sat, 13 Sep 2025 16:04:59 +0800</pubDate>
      <guid>https://www.whoami-wesleyyou.top/2025/09/13/computer_system_basics/os/historical/6.Mach/</guid>
      <description>&lt;h2 id=&#34;mach-system&#34;&gt;Mach System&lt;/h2&gt;
&lt;h3 id=&#34;硬件平台-hardware&#34;&gt;硬件平台 (Hardware)&lt;/h3&gt;
&lt;p&gt;Mach 最初运行在 DEC VAX 系列机器上, 后来被移植到 IBM RT PC, Sun-3 (68k), Encore Multimax, Sequent Symmetry 等多处理器系统;&lt;br&gt;
这些平台通常配备 &lt;strong&gt;数 MB 到数十 MB 的内存 (RAM)&lt;/strong&gt;, &lt;strong&gt;数百 MB 到数 GB 的磁盘存储&lt;/strong&gt;, 以当时标准算是中高端配置;&lt;br&gt;
通过这些硬件, Mach 展示了良好的可移植性和对对称多处理器 (SMP) 的支持, 并能在有限资源下探索虚拟内存与分布式操作系统的先进机制;&lt;/p&gt;</description>
    </item>
    <item>
      <title>On μ-Kernel Construction</title>
      <link>https://www.whoami-wesleyyou.top/2025/09/13/computer_system_basics/os/historical/7.micro-Kernel/</link>
      <pubDate>Sat, 13 Sep 2025 16:04:51 +0800</pubDate>
      <guid>https://www.whoami-wesleyyou.top/2025/09/13/computer_system_basics/os/historical/7.micro-Kernel/</guid>
      <description>&lt;h2 id=&#34;on--kernel-construction&#34;&gt;On $\mu$-Kernel Construction&lt;/h2&gt;
&lt;p&gt;传统观点是, 微内核是 &lt;em&gt;inefficient&lt;/em&gt; 和 &lt;em&gt;not sufficiently flexible&lt;/em&gt; 的, 但是本文说明相反观点, 并展示微内核可以达到 macro kernel 的 efficiency&lt;br&gt;
以及为什么当前已有的 measurement 很难说明这一点&lt;/p&gt;
&lt;h3 id=&#34;设计目标&#34;&gt;设计目标&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;微内核支持 modular&lt;/li&gt;
&lt;li&gt;外部系统可以使用 micro kernel 提供的 mechanism&lt;/li&gt;
&lt;li&gt;微内核系统更加 flexible 和 tailorable&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;明确-target&#34;&gt;明确 target&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;决定整个 $\mu$-kernel 的能力的不应该是 performance, 而应该是 functionality&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;也就是说尽量不要把指令放进内核, 除非纯外部执行无法完成指定任务&lt;/li&gt;
&lt;/ul&gt;
&lt;ol start=&#34;2&#34;&gt;
&lt;li&gt;系统应该能支持 protection&lt;/li&gt;
&lt;li&gt;independence principle: 不同 sub system 之间不应该有任何互相影响和 corruption&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;这里的子系统指的是进程, 也就是用户态的资源分割单位&lt;/li&gt;
&lt;/ul&gt;
&lt;ol start=&#34;4&#34;&gt;
&lt;li&gt;integrity principle: 不同子系统之间应该有 address 联系, 也就是进程能通过地址来互相通信&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;address-space&#34;&gt;Address Space&lt;/h3&gt;
&lt;p&gt;从硬件来看地址空间就是 virtual addr 到 physical addr 的映射, 这是通过 TLB 和 page table 来实现的&lt;/p&gt;</description>
    </item>
    <item>
      <title>Exokernel: An Operating System Architecture for Application-Level Resource Management</title>
      <link>https://www.whoami-wesleyyou.top/2025/09/13/computer_system_basics/os/historical/9.exokernel/</link>
      <pubDate>Sat, 13 Sep 2025 16:04:42 +0800</pubDate>
      <guid>https://www.whoami-wesleyyou.top/2025/09/13/computer_system_basics/os/historical/9.exokernel/</guid>
      <description>&lt;h1 id=&#34;exokernel-an-operating-system-architecture-for-application-level-resource-management&#34;&gt;Exokernel: An Operating System Architecture for Application-Level Resource Management&lt;/h1&gt;
&lt;p&gt;“Dawson R. Engler, M. Frans Kaashoek, and James O’Toole Jr. M.I.T. Laboratory for Computer Science” (&lt;a href=&#34;#ZgotmplZ&#34;&gt;Engler 等, p. 251&lt;/a&gt;) (&lt;a href=&#34;#ZgotmplZ&#34;&gt;pdf&lt;/a&gt;)&lt;/p&gt;
&lt;h2 id=&#34;motivation&#34;&gt;Motivation&lt;/h2&gt;
&lt;p&gt;传统的 general OS kernel 只能提供给最广泛的用户态程序一个中庸的最优解，然而随着软件界的发展，越来越需要一种对各种不同的软件有各自 customized 方案的特殊化优化&lt;/p&gt;</description>
    </item>
    <item>
      <title>Plan 9 from Bell Labs</title>
      <link>https://www.whoami-wesleyyou.top/2025/09/13/computer_system_basics/os/historical/5.Plan9_9P/</link>
      <pubDate>Sat, 13 Sep 2025 16:04:35 +0800</pubDate>
      <guid>https://www.whoami-wesleyyou.top/2025/09/13/computer_system_basics/os/historical/5.Plan9_9P/</guid>
      <description>&lt;h2 id=&#34;plan-9-system-bell-lab&#34;&gt;Plan 9 System (Bell Lab)&lt;/h2&gt;
&lt;h3 id=&#34;硬件设备&#34;&gt;硬件设备&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;目标环境: 便宜的小型机(办公室个人使用)+ 集中管理的大型服务器(file server, cpu server)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;分布式环境设计, 强调网络互联和资源共享&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;UTF-8&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;/proc&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;rfork&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;&lt;p&gt;硬件存储抽象&lt;br&gt;
软件文件系统抽象&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;包括网络的分布式一致性&lt;br&gt;
创新点&lt;/p&gt;
&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;h3 id=&#34;设计目标&#34;&gt;设计目标&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;maintainence: 分布式的个人 pc 进行 administer 一个系统的开销太大太困难了&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;也就是通过 centralized administration 来实现集中管理&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;统一接口: 一切皆文件, 通过 9P 协议访问&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;每个进程拥有独立的命名空间, 可通过 &lt;code&gt;bind&lt;/code&gt; 和 &lt;code&gt;mount&lt;/code&gt; 重新组合&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;支持透明分布式: 远程资源与本地资源无差别&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;简洁内核, 核心任务是 9P 消息的 &lt;strong&gt;multiplex/demultiplex&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description>
    </item>
    <item>
      <title>The Performance of μ-Kernel-Based Systems</title>
      <link>https://www.whoami-wesleyyou.top/2025/09/08/computer_system_basics/os/historical/8.L4/</link>
      <pubDate>Mon, 08 Sep 2025 16:30:05 +0800</pubDate>
      <guid>https://www.whoami-wesleyyou.top/2025/09/08/computer_system_basics/os/historical/8.L4/</guid>
      <description>&lt;h2 id=&#34;motivation-和论文目标&#34;&gt;Motivation 和论文目标&lt;/h2&gt;
&lt;p&gt;守旧派往往认为, 第一代 $\mu$-kernel  微内核具有非常低的 performance/flexibility, 但是本文希望能测试第二代微内核的性能和灵活性, 实验手段是测试一些老的系统性能测试以及加上一些新的有针对的测试&lt;/p&gt;
&lt;p&gt;微内核的优点之一是, 内核小巧, 部件坏的概率小&lt;/p&gt;
&lt;p&gt;微内核只提供 mechanism 但是不提供 policy, 但是也需要上面一层安全控制的 pager, FS 等资源, 这些往往依赖于 UNIX Server 实现&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
