# Linux kernel COW 問題清單
contributed by < [`linD026`](https://github.com/linD026) >
###### tags: `Linux kernel COW` , `linux2021`
---
## 整體篇章
>[name=linD026][time= Sun, Jun 6, 2021]
>- [x] 目前整體書寫的架構以及問題?
>[name=linD026][time= , , 2021]
---
## Part 1 實作機制
>[name=linD026][time= Sun, Jun 6, 2021]
> - [ ] context switch 對於 記憶體的清除以及移入在 COW 上能有改進或使用到?
> - [ ] page table 在 memory region 篇章有提到其他 process 可能會使用到其他 process 的 page table ,什麼樣的情況下會用到?
> - [x] arm 架構的 write 和 read 的權限之間是一體兩面的,其他的是如何?
> * [Permissions attributes](https://developer.arm.com/documentation/102376/0100/Permissions-attributes)
> - [x] node 、 zone 、 pg_data_t 、 mem_section 從程式碼上可以看出有些許關聯性,想問他們之間的關係以及整體 memory model 的架構。
> - [x] 看起來 driver 對記憶體使用的權限以及被管理的方式與一般的有所不同,有什麼有趣的管理機制或是用手段?
>[name=linD026][time=Mon, Jun 28, 2021 5:42 PM]
> - [x] MMU notifier
> [name=linD026][time=Tue, Jul 6, 2021 3:52 AM]
> - [ ] waitqueue - enough to use ?
> * [flush](https://elixir.bootlin.com/linux/v5.10.38/source/mm/filemap.c#L1196)
> [name=linD026][time=Wed, Jul 21, 2021 11:15 PM]
> - [ ] [follow_page_pte](https://elixir.bootlin.com/linux/v5.10.52/source/mm/gup.c#L394) and follow_pte ?
---
## Part 2 Memory Region
>[name=linD026][time= Sun, Jun 6, 2021]
> - [x] lazy TLB 的觀念釐清。
> - [ ] 在 kernel portion only ?
> [name=linD026][time=Tue, Jun 29, 2021 2:48 PM]
> 1. `do_fault` -> `do_cow_fault`
> 2. `do_translation_fault` (hooked, when first level page table doesn't contain a valid address) -> `do_page_fault` -> `handle_mm_fault` -> `handle_pte_fault` -> `do_wp_page`
---
## Part 3 process
>[name=linD026][time= , , 2021]
> - [ ] NULL
---
## Part 4 實驗
>[name=linD026][time= , , 2021]
> - [ ] NULL
---
## Others
> [name=linD026][time=Sat, Jul 3, 2021 6:36 PM]
> - [ ] `wait_on_page` => 全域變數 `page_wait_table` 有 256 entries ,用什麼機制轉換使用?