description/memory: PCP v2

This commit is contained in:
Cheng Jian committed 2022-04-10 09:58:35 +08:00
1 parent 997e6354f2
commit 9ce4e0e93b
3 files changed
+49 -9

No files matched your search

+42 -8
View File
@@ -963,7 +963,6 @@ void free_hot_cold_page(struct page *page, bool cold)
| 时间 | 作者 | 特性 | 描述 | 是否合入主线 | 链接 |
|:----:|:----:|:---:|:----:|:---------:|:----:|
| 2017/10/18 | Mel Gorman <mgorman@techsingularity.net> | [mm: remove `__GFP_COLD`](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=453f85d43fa9ee243f0fc3ac4e1be45615301e3f) | [Follow-up for speed up page cache truncation v2](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=453f85d43fa9ee243f0fc3ac4e1be45615301e3f) 的其中一个补丁. | v2 ☑ 4.15-rc1 | [PatchwWork v2](https://lore.kernel.org/lkml/20171018075952.10627-1-mgorman@techsingularity.net) |
| 2020/11/11 | Vlastimil Babka <vbabka@suse.cz> | [disable pcplists during memory offline](https://lore.kernel.org/patchwork/patch/1336780) | 当内存下线的时候, 禁用 PCP | v3 ☑ [5.11-rc1](https://kernelnewbies.org/Linux_5.11#Memory_management) | [v4](https://lore.kernel.org/patchwork/patch/1336780) |
#### 2.2.5.2 Drain PCP
@@ -1004,7 +1003,8 @@ PCP 页面对内存碎片可能有潜在的冲击, 它可能会意外导致碎
| 2017/03/07 | Michal Hocko <mhocko@kernel.org> | [mm: move pcp and lru-pcp drainging into single wq](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ce612879ddc78ea7e4de4be80cba4ebf9caa07ee) | 引入一个统一名为 mm_percpu_wq 的 WQ_MEM_RECLAIM workqueue 来接管当前 MM 下存在的 vmstat_work, lru_add_drain_per_cpu 和 drain_local_pages_wq. | v1 ☑✓ 4.11-rc6 | [LORE RFC](https://lore.kernel.org/all/20170207210908.530-1-mhocko@kernel.org)<br>*-*-*-*-*-*-*-* <br>[LORE v1](https://lore.kernel.org/all/20170307131751.24936-1-mhocko@kernel.org) |
#### 2.2.5.2 [Bulk memory allocation](https://lwn.net/Articles/711075)
#### 2.2.5.3 [Bulk memory allocation](https://lwn.net/Articles/711075)
-------
* Order-0 批量页面分配器
@@ -1024,7 +1024,6 @@ Mel Gorman 认为最好基于现有的 Per CPU Allocator/PCP 针对这种情况
|:----:|:----:|:---:|:----:|:---------:|:----:|
| 2017/01/09 | Mel Gorman | [Fast noirq bulk page allocator](https://lore.kernel.org/patchwork/patch/747351) | 中断安全的批量内存分配器, RFC 补丁, 最终 Mel Gorman 为了完成这组优化做了大量的重构和准备工作. | v5 ☐ | [2017/01/04 LORE RFC,0/4](https://lore.kernel.org/lkml/20170104111049.15501-1-mgorman@techsingularity.net)<br>*-*-*-*-*-*-*-* <br>[2017/01/09 LORE RFC,v2r7](https://lore.kernel.org/lkml/20170109163518.6001-1-mgorman@techsingularity.net) |
| 2017/01/23 | Mel Gorman | [Use per-cpu allocator for !irq requests and prepare for a bulk allocator v5](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=374ad05ab64d696303cec5cc8ec3a65d457b7b1c) | 重构了 Per CPU Allocation(PCP), 只有 IRQ 安全分配请求能够使用 Per CPU Allocation(PCP), 这将减少大约 30% 的分配/释放开销. 这是完成 Bulk memory allocation 工作的第一步. 许多分配页面的工作负载一次都不会处理中断. 由于分配请求可能来自 IRQ 上下文, 因此页面分配和释放时需要频繁的开关中断, 比如页面分配 buffered_rmqueue() 时[禁用/启用 IRQ](https://elixir.bootlin.com/linux/v4.10/source/mm/page_alloc.c#L2622), 页面释放时 Order-0 页面 [free_hot_cold_page()](https://elixir.bootlin.com/linux/v4.10/source/mm/page_alloc.c#L2456) 以及其他 Order 页面释放 [`__free_pages_ok()`](https://elixir.bootlin.com/linux/v4.10/source/mm/page_alloc.c#L1247) 中. 这一成本占释放路径的大部分, 但也占分配路径的很大一部分. 对性能的影响和开销比较大. 这组补丁先进行了一些清理操作<br>1. [commit1](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=066b23935578d3913c2df9bed7addbcdf4711f1a) 从 buffered_rmqueue() 中拆解出 rmqueue_pcplist() 用于从 PCP 中分配, 并将 buffered_rmqueue() 重命名为 rmqueue().<br>2. [commit2](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9cd7555875bb09dad875e89a76f41f576e11c638) 从 `__alloc_pages_nodemask()` 中拆解出 prepare_alloc_pages(), 因为这个准备工作会在批处理分配中多次调用<br>3. [commit3](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0ccce3b924212e121503619df97cc0f17189b77b) 将 drain_local_pages_wq() 将 drain_local_pages() 放到 WORK 中去完成.<br>接着最重要的改动是改变了锁定和检查, 使得只有 IRQ 安全分配请求使用 Per CPU Allocation(PCP). 所有其他的分配请求从伙伴系统中器获得 irq 安全区 -> 锁定和分配. 它依靠禁用抢占来安全访问 PCP 结构. 这种修改可能会略微降低 IRQ 上下文中的分配速度, 但 Per CPU Allocation(PCP) 的主要好处是, 它可以更好地扩展来自多个上下文的分配. 有一个隐含的假设, 即从 IRQ 上下文在单个 NUMA NODE 的多个 CPU 上进行密集地分配是非常罕见的, 而且大多数扩展问题都是在 !IRQ 上下文, 例如 Page Fault 等. 其实批量页面分配器不需要此修补程序, 但它显著降低了开销.<br>不过这个最关键的 [commit d34b0733b452 ("Revert "mm, page_alloc: only use per-cpu allocator for irq-safe requests")](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d34b0733b452ca3ef1dee36436dab08b8aa6a85c) 很快被 revert. | v5 ☑ 4.11-rc1 | [LORE 0/3](https://lore.kernel.org/all/20170112104300.24345-1-mgorman@techsingularity.net)<br>*-*-*-*-*-*-*-* <br>[LORE v4,0/4](https://lore.kernel.org/all/20170117092954.15413-1-mgorman@techsingularity.net)<br>*-*-*-*-*-*-*-* <br>[LORE v5,0/4](https://lore.kernel.org/all/20170123153906.3122-1-mgorman@techsingularity.net) |
| 2017/01/25 | Mel Gorman | [mm, page_alloc: Use static global work_struct for draining per-cpu pages](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bd233f538d51c2cae6f0bfc2cf7f0960e1683b8a) | 正如 Vlastimil Babka 和 Tejun Heo 所建议的, 这个补丁使用一个静态 work_struct 来协调 Per CPU Pages 在工作队列上的排泄. 一次只能有一个任务耗尽, 但这比以前允许多个任务同时发送IPIs的方案要好. 一个需要考虑的问题是并行请求是否应该彼此同步. | v5 ☑ 4.11-rc1 | [LORE](https://lore.kernel.org/lkml/20170125083038.rzb5f43nptmk7aed@techsingularity.net) |
* 再次尝试
@@ -1037,7 +1036,7 @@ Mel Gorman 认为最好基于现有的 Per CPU Allocator/PCP 针对这种情况
#### 2.2.5.3 High Order PCP
#### 2.2.5.4 High Order PCP
-------
很长一段时间以来, SLUB 一直是默认的小型内核对象分配器, 但由于性能问题和对高阶页面的依赖, 它并不是普遍使用的. 高阶关注点有两个主要组件——高阶页面并不总是可用, 高阶页面分配可能会在 zone->lock 上发生冲突.
@@ -1057,7 +1056,7 @@ Mel Gorman 认为最好基于现有的 Per CPU Allocator/PCP 针对这种情况
| 2022/03/10 | Mel Gorman <mgorman@techsingularity.net> | [mm/page_alloc: check high-order pages for corruption during PCP operations](https://patchwork.kernel.org/project/linux-mm/patch/20220310092456.GJ15701@techsingularity.net) | Eric Dumazet 指出, [commit 44042b449872 ("mm/page_alloc: allow high-order pages to storage to the per-cpu list")](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=44042b4498728f4376e84bae1ac8016d146d850b) 仅在 PCP 重新填充和分配操作期间检查首页. 这是一个疏忽, 所有页面都应该检查. 这将导致一个小的性能损失, 但这对正确性是必要的. | v1 ☑ | [LORE v1,0/1](https://lore.kernel.org/r/20220310092456.GJ15701@techsingularity.net) |
#### 2.2.5.4 Adjust PCP high and batch
#### 2.2.5.5 Adjust PCP high and batch
-------
percpu 页分配器(PCP)旨在减少对区域锁的争用, 但是 PCP 中的页面数量也要有限制. 因此 PCP 引入了 high 和 batch 来控制 pcplist 中的页面大小. 当 PCP 中的页面超过了 pcp->high 的时候, 则会释放 batch 的页面回到 BUDDY 中.
@@ -1073,10 +1072,10 @@ Mel Gorman 发现了这一问题, 开发了 [Calculate pcp->high based on zone s
|:----:|:----:|:---:|:----:|:---------:|:----:|
| 2005/12/09 | Rohit Seth <rohit.seth@intel.com> | [Making high and batch sizes of per_cpu_pagelists configurable](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=8ad4b1fb8205340dba16b63467bb23efc27264d6) | 引入了 percpu_pagelist_fraction 来调整各个 zone PCP 的 high, 同时将 batch 值设置为 min(high / 4, PAGE_SHIFT * 8). | v1 ☑ 2.6.16-rc1 | [LORE](https://lore.kernel.org/patchwork/patch/47659), [commit](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8ad4b1fb8205340dba16b63467bb23efc27264d6) |
| 2017/01/25 | Mel Gorman | [Recalculate per-cpu page allocator batch and high limits after deferred meminit](https://lore.kernel.org/patchwork/patch/1141598) | 由于 PCP(Per CPU Page) Allocation 中不正确的高限制导致的高阶区域 zone->lock 的竞争, 在初始化阶段, 但是在初始化结束之前, PCP 分配器会计算分批分配/释放的页面数量, 以及 Per CPU 列表上允许的最大页面数量. 由于 zone->managed_pages 还不是最新的, pcp 初始化计算不适当的低批量和高值. 在某些情况下, 这会严重增加区域锁争用, 严重程度取决于共享一个本地区域的cpu数量和区域的大小. 这个问题导致了构建内核的时间比预期的长得多时, AMD epyc2 机器上的系统 CPU 消耗也过多. 这组补丁修复了这个问题 | v5 ☑ 4.11-rc1 | [PatchWork v5](https://lore.kernel.org/patchwork/patch/1141598) |
| 2021/05/25 | Mel Gorman <mgorman@techsingularity.net> | [Calculate pcp->high based on zone sizes and active CPUs](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=74f44822097c665041010994502b5971d6cd9f04) | pcp->high 和 pcp->batch 根据 zone 内内存的大小进行调整. 移除了不适用的 vm.percpu_pagelist_fraction 参数. | v2 ☑ 5.14-rc1 | [PatchWork v2,0/6](https://lore.kernel.org/lkml/20210525080119.5455-1-mgorman@techsingularity.net) |
| 2021/05/25 | Mel Gorman <mgorman@techsingularity.net> | [Calculate pcp->high based on zone sizes and active CPUs](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=74f44822097c665041010994502b5971d6cd9f04) | pcp->high 和 pcp->batch 根据 zone 内内存的大小进行调整. 移除了不适用的 vm.percpu_pagelist_fraction 参数. | v2 ☑ 5.14-rc1 | [LORE v1,0/6](https://lore.kernel.org/all/20210521102826.28552-1-mgorman@techsingularity.net)<br>*-*-*-*-*-*-*-* <br>[LORE v2,0/6](https://lore.kernel.org/lkml/20210525080119.5455-1-mgorman@techsingularity.net) |
#### 2.2.5.5 Remote per-cpu cache access
#### 2.2.5.6 Remote per-cpu cache access
-------
最初释放 PCP 是通过 IPI 来完成的, 并且经历了不断的修正和优化, 参见 v2.6.24-rc1 的 [Drain per-cpu lists when high-order allocations fail](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e2c55dc87f4a398b9c4dcc702dbc23a07fe14e23), v2.6.25-rc1 的 [Page allocator: clean up pcp draining functions](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9f8f2172537de7af0b0fbd33502d18d52b1339bc), v3.4-rc1 的 [mm: only IPI CPUs to drain local pages if they exist](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=74046494ea68676d29ef6501a4bd950f08112a2c). 以及 v4.11-rc1 的 [mm, page_alloc: drain per-cpu pages from workqueue context](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0ccce3b924212e121503619df97cc0f17189b77b).
@@ -1098,6 +1097,40 @@ Mel Gorman 发现了这一问题, 开发了 [Calculate pcp->high based on zone s
| 2022/02/24 | Suren Baghdasaryan <surenb@google.com> | [mm: page_alloc: replace mm_percpu_wq with kthreads in drain_all_pages](https://lore.kernel.org/all/20220225012819.1807147-1-surenb@google.com) | 20220225012819.1807147-1-surenb@google.com | v1 ☐☑✓ | [LORE v1,0/1](https://lore.kernel.org/all/20220225012819.1807147-1-surenb@google.com) |
#### 2.2.5.7 PCP 分配器框架变更与优化时间线(总结)
-------
[commit e7c8d5c9955a ("a206231bbe6f ("hot-n-cold pages: page allocator core")](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=a206231bbe6ffb988cdf9fcbdfd98e49abaf4819) 引入了 PCP 最早的框架, 其中 per_cpu_pages 维护了 PCP 的基础结构, per_cpu_pageset 包含了 per_cpu_pages 的数组 pcp[2](0: hot. 1: cold), 每个 zone 中都包含了 per_cpu_pageset 的数组 pageset[NR_CPUS], 维护了 zone 下所有 CPU 的 PCP 页面.
之前的版本每个 zone 都有 PCP 的页面集阵列 struct per_cpu_pageset pageset[NR_CPUS]. 这样 NUMA 系统下, 任何特定的 CPU 在每个 zone 结构中都有一些属于它自己的内存, 即使 CPU 不是该区域的本地 CPU. 因此 v2.6.13-rc1 实现了 NUMA 感知的 PCP, 修改了 NUMA 系统下 struct zone 中 PCP 页面集的管理方式.这个版本, NUMA 系统下, zone->pageset 成为一个数组指针 `*pageset[NR_CPUS]`, 然后使用 process_zones() 通过 kmalloc 来动态分配指定 CPU 的 zone->pageset[cpu] 空间. 其中 boot CPU(CPU 0) 的 PCP pageset 在 start_kernel()-=>setup_per_cpu_pageset() 中完成, 并注册 register_cpu_notifier(&pageset_notifier), 而非 boot CPU 的 PCP pageset, 就通过注册 pageset_notifier 的 CallBack 函数 pageset_cpuup_callback 来完成. 但是这样依旧有一些问题, 在 zone 初始化阶段 free_area_init_core() 中, SLAB 分配器还没有初始化, 因此在这个阶段先使用了静态 boot_pageset(曾经叫 pageset_table) 完成启动阶段的初始化. 这个静态变量被标记为 `__initdata`, 在系统启动后会其空间将被释放掉. 参见 [commit e7c8d5c9955a ("node local per-cpu-pages](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e7c8d5c9955a4d2e88e36b640563f5d6d5aba48a) 和 [Reduce size of huge boot per_cpu_pageset, 0/2](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=2caaad41e4aa8f5dd999695b4ddeaa0e7f3912a4), [commit b7c84c6ada2b ("boot_pageset must not be freed")](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=b7c84c6ada2be942eca6722edb2cfaad412cd5de)
v2.6.16-rc1 时 pcp->low 水线貌似并没有什么太大的用处, 直接被干掉. [commit e7c8d5c9955a ("a206231bbe6f ("mm: remove pcp low")](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=2d92c5c9150a2a9ca3dc25da58d5042e17a96b6a).
v2.6.25-rc1, PCP 不再明确用 2 个数组区分冷热页, 而是使用单一列表管理. 参见 [Page allocator: get rid of the list of cold pages](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3dfa5721f12c3d5a441448086bee156887daa961), 此时 struct per_cpu_pageset 结构中 struct per_cpu_pages pcp[2] 变成 pcp.
v2.6.32-rc1, [commit 5f8dcc21211a ("page-allocator: split per-cpu list into one-list-per-migrate-type")](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=5f8dcc21211a3d4e3a7a5ca366b469fb88117f61), 此时 per_cpu_pages 中维护 PCP 页面的 list 演变为 lists[MIGRATE_PCPTYPES].
v2.6.34-rc1, [commit 99dcc3e5a94e ("this_cpu: Page allocator conversion")](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=99dcc3e5a94ed491fbef402831d8c0bbb267f995) 开始使用了 PER CPU 变量替代 NR_CPUS 的数组. 于是 boot_pageset 被定义为 DEFINE_PER_CPU, zone->pageset 变成了一个指针, 而是用 alloc_percpu() 来分配. 然后直接使用 per_cpu_ptr(zone->pageset, cpu) 访问指定的 PCP 页面集. 以及 [commit](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=43cf38eb5cea91245502df3fcee4dbfc1c74dd1c).
| 时间 | 作者 | 特性 | 描述 | 是否合入主线 | 链接 |
|:-----:|:----:|:---:|:---:|:----------:|:----:|
| 2005/06/21 | Christoph Lameter <christoph@lameter.com> | [node local per-cpu-pages](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e7c8d5c9955a4d2e88e36b640563f5d6d5aba48a) | TODO | v1 ☑✓ v2.6.13-rc1 | [LORE](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e7c8d5c9955a4d2e88e36b640563f5d6d5aba48a) |
| 2009/08/28 | Mel Gorman <mel@csn.ul.ie> | [page-allocator: split per-cpu list into one-list-per-migrate-type](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5f8dcc21211a3d4e3a7a5ca366b469fb88117f61) | [Reduce searching in the page allocator fast-path](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=a6f9edd65beaef24836e8934c8912c1e974dd45c) 的其中一个补丁. | v1 ☑✓ 2.6.32-rc1 | [LORE RFC,0/3](https://lore.kernel.org/lkml/1250594162-17322-1-git-send-email-mel@csn.ul.ie)<br>*-*-*-*-*-*-*-* <br>[LORE 0/3](https://lore.kernel.org/lkml/1251449067-3109-1-git-send-email-mel@csn.ul.ie) |
| 2007/11/19 | clameter@sgi.com <clameter@sgi.com> | [this_cpu: Page allocator conversion](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=99dcc3e5a94ed491fbef402831d8c0bbb267f995) | [CPU ops and a rework of per cpu data handling on x86_64](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=dbfc196a3cc1a2514ad0737a82f764de23bd65e6) 的其中一个补丁. PCP 代码中使用 PER CPU 变量替代 NR_CPUS 的数组. | v1 ☑✓ 2.6.34-rc | [LORE RFC,00/45](https://lore.kernel.org/lkml/20071120011132.143632442@sgi.com)<br>*-*-*-*-*-*-*-* <br>[LORE v2,00/30](https://lore.kernel.org/lkml/20071116230920.278761667@sgi.com) |
page offline 期间存在一个竞争, 可能会导致无限循环. 造成这个问题的原因是: 这会造成这些页面永远不会出现在好友列表中, offline_pages() 会不断重试, 或者直到收到终止信号.
| 时间 | 作者 | 特性 | 描述 | 是否合入主线 | 链接 |
|:-----:|:----:|:---:|:---:|:----------:|:----:|
| 2020/09/03 | Pavel Tatashin <pasha.tatashin@soleen.com> | [mm/memory_hotplug: drain per-cpu pages again during memory offline](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9683182612214aa5f5e709fad49444b847cd866a) | 20200903140032.380431-1-pasha.tatashin@soleen.com | v2 ☑✓ 5.9-rc6 | [LORE v1](https://lore.kernel.org/linux-mm/20200901124615.137200-1-pasha.tatashin@soleen.com)<br>*-*-*-*-*-*-*-* <br>[LORE v2](https://lore.kernel.org/all/20200903140032.380431-1-pasha.tatashin@soleen.com) |
| 2020/09/07 | Vlastimil Babka <vbabka@suse.cz> | [disable pcplists during page isolation](https://lore.kernel.org/all/20200907163628.26495-1-vbabka@suse.cz) | 页面隔离应该禁用 pcplists, 以避免页面释放过程中的竞争. | v1 ☐☑✓ | [LORE v1,0/5](https://lore.kernel.org/all/20200907163628.26495-1-vbabka@suse.cz) |
| 2020/11/11 | Vlastimil Babka <vbabka@suse.cz> | [disable pcplists during memory offline](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=ec6e8c7e03147c65380e6c04c4cf4290e96280b6) | 当内存下线的时候, 禁用 PCP | v3 ☑ [5.11-rc1](https://kernelnewbies.org/Linux_5.11#Memory_management) | [LORE RFC,0/5](https://lore.kernel.org/lkml/20200907163628.26495-1-vbabka@suse.cz)<br>*-*-*-*-*-*-*-* <br>[LORE 0/9](https://lore.kernel.org/lkml/20200922143712.12048-1-vbabka@suse.cz)<br>*-*-*-*-*-*-*-* <br>[LORE v2,0/7](https://lore.kernel.org/lkml/20201008114201.18824-1-vbabka@suse.cz)<br>*-*-*-*-*-*-*-* <br>[LORE v3,0/7](https://lore.kernel.org/lkml/20201111092812.11329-1-vbabka@suse.cz) |
| 2021/05/12 | Mel Gorman <mgorman@techsingularity.net> | [Use local_lock for pcp protection and reduce stat overhead](https://lore.kernel.org/all/20210512095458.30632-1-mgorman@techsingularity.net) | 20210512095458.30632-1-mgorman@techsingularity.net | v6 ☐☑✓ | [LORE v6,0/9](https://lore.kernel.org/all/20210512095458.30632-1-mgorman@techsingularity.net) |
### 2.2.6 ALLOC_NOFRAGMENT 优化
-------
@@ -1729,7 +1762,7 @@ gpu 和高吞吐量设备在 TLB 丢失和随后的页表遍行情况下, 与 CP
| 时间 | 作者 | 特性 | 描述 | 是否合入主线 | 链接 |
|:----:|:----:|:---:|:----:|:---------:|:----:|
| 2007/09/10 | Mel Gorman <mel@csn.ul.ie> | [Reduce external fragmentation by grouping pages by mobility v30](https://lore.kernel.org/patchwork/patch/75208) | 基于页面可移动性的页面聚类来抗(外部)碎片化. 引入 CONFIG_PAGE_GROUP_BY_MOBILITY 控制 | v28 ☑ 2.6.24-rc1 | [2006/11/01 PatchWork v26,0/11](https://lore.kernel.org/patchwork/patch/67812)<br>*-*-*-*-*-*-*-* <br>[2006/11/21 PatchWork v27,0/11](https://lore.kernel.org/patchwork/patch/68969)<br>*-*-*-*-*-*-*-* <br>[Patchwork v28,0/12](https://lore.kernel.org/patchwork/patch/75208)<br>*-*-*-*-*-*-*-* <br>[Patchwork v30,0/13](https://lore.kernel.org/patchwork/patch/91119) |
| 2007/09/10 | Mel Gorman <mel@csn.ul.ie> | [Reduce external fragmentation by grouping pages by mobility v30](https://lore.kernel.org/patchwork/patch/75208) | 基于页面可移动性的页面聚类来抗(外部)碎片化. 引入 CONFIG_PAGE_GROUP_BY_MOBILITY 控制 | v28 ☑ 2.6.24-rc1 | [2006/11/01 PatchWork v26,0/11](https://lore.kernel.org/patchwork/patch/67812)<br>*-*-*-*-*-*-*-* <br>[2006/11/21 PatchWork v27,0/11](https://lore.kernel.org/patchwork/patch/68969)<br>*-*-*-*-*-*-*-* <br>[Patchwork v28,0/12](https://lore.kernel.org/patchwork/patch/75208)<br>*-*-*-*-*-*-*-* <br>[Patchwork v30,0/13](https://lore.kernel.org/lkml/20070910112011.3097.8438.sendpatchset@skynet.skynet.ie) |
| 2007/03/01 | Mel Gorman <mel@csn.ul.ie> | [Create optional ZONE_MOVABLE to partition memory between movable and non-movable pages v2](https://lore.kernel.org/patchwork/patch/75221) | NA | v2 ☑ 2.6.23-rc1 | [PatchWork v2](https://lore.kernel.org/patchwork/patch/75221) |
| 2007/04/24 | Mel Gorman <mel@csn.ul.ie> | [Fix two boot problems related to ZONE_MOVABLE sizing](https://lore.kernel.org/patchwork/patch/79220) | NA | v1 ☐ | [PatchWork 0/2](https://lore.kernel.org/patchwork/patch/79220) |
| 2007/05/17 | Mel Gorman <mel@csn.ul.ie> | [Annotation fixes for grouping pages by mobility v2](https://lore.kernel.org/patchwork/patch/81511) | NA | v1 ☐ | [PatchWork 0/5](https://lore.kernel.org/patchwork/patch/81511) |
@@ -3569,6 +3602,7 @@ swappiness 参数值可设置范围在 `0~100` 之间.
[浅谈 Linux Kernel 的预读算法](http://www.caturra.cc/2021/08/31/浅谈linux-kernel的预读算法) 基于 Linux 4.18.20 对预读进行了
[LWN: Readahead: the documentation I wanted to read](https://lwn.net/Articles/888715)
kai_ding 的 [Linux 文件系统预读](https://blog.csdn.net/kai_ding/article/details/17322787) 以三个实际读取的实例程序讲解了 linux-3.12 的预读算法. [Linux 文件系统预读 (一)](https://blog.csdn.net/kai_ding/article/details/17322787) 讲解了单进程规则顺序读时预读算法的工作. [Linux 文件系统预读 (二)](https://blog.csdn.net/kai_ding/article/details/19957763) 讲解了单进程不规则顺序读(一共进行了三次读, 顺序读, 且读的大小不定, 有超过最大预读量的, 也有低于最大预读量的)下预读的工作行为. [Linux 文件系统预读 (三)](https://blog.csdn.net/kai_ding/article/details/20112753) 讲解了多进程交织顺序读行为下的预读是如何处理的.
+5
View File
@@ -164,6 +164,11 @@ RRZE-HPC 的 [likwid(Like I knew what I am doing):Performance monitoring and ben
[netem](https://wiki.linuxfoundation.org/networking/netem)
## 2.9 耗时分析
-------
# 3 安全
-------
+2 -1
View File
@@ -147,7 +147,8 @@ jeremy很早就写了一个pv ticketlock, 原理大概就是vcpu在拿锁了一
| 时间 | 作者 | 特性 | 描述 | 是否合入主线 | 链接 |
|:----:|:----:|:---:|:----:|:---------:|:----:|
| 2021/10/05 | David Hildenbrand <david@redhat.com> | [proc/vmcore: sanitize access to virtio-mem memory](https://patchwork.kernel.org/project/linux-mm/cover/20211005121430.30136-1-david@redhat.com) | NA | v2 ☑ 4.19-rc1 | [PatchWork v2,0/9](https://patchwork.kernel.org/project/linux-mm/cover/20211005121430.30136-1-david@redhat.com) |
| 2021/11/11 | Chao Peng <chao.p.peng@linux.intel.com> | [KVM: mm: fd-based approach for supporting KVM guest private memory](https://patchwork.kernel.org/project/linux-mm/cover/20211111141352.26311-1-chao.p.peng@linux.intel.com) | NA | RFC ☐ | [PatchWork RFC,0/6](https://patchwork.kernel.org/project/linux-mm/cover/20211111141352.26311-1-chao.p.peng@linux.intel.com) |
| 2021/11/11 | Chao Peng <chao.p.peng@linux.intel.com> | [KVM: mm: fd-based approach for supporting KVM guest private memory](https://patchwork.kernel.org/project/linux-mm/cover/20211111141352.26311-1-chao.p.peng@linux.intel.com) | [Private memory for KVM guests
](https://lwn.net/Articles/890224) | RFC ☐ | [LORE RFC,0/6](https://patchwork.kernel.org/project/linux-mm/cover/20211111141352.26311-1-chao.p.peng@linux.intel.com)<br>*-*-*-*-*-*-*-* <br>[LORE v5,00/13](https://lore.kernel.org/lkml/20220310140911.50924-1-chao.p.peng@linux.intel.com) |