optimize(bpf): Delete tgid_pname_map#839
optimize(bpf): Delete tgid_pname_map#839jschwinger233 wants to merge 5 commits intodaeuniverse:mainfrom
Conversation
|
求更新 |
Note The following content has been translated from its original language using an automated process powered by a proprietary API. Segments originally written in English have been preserved, while non-English portions have been machine-translated for readability. Please be aware that minor inaccuracies may exist due to the automated nature of the translation. Requesting an update. |
|
更新啥 没人review 😢 |
Note The following content has been translated from its original language using an automated process powered by a proprietary API. Segments originally written in English have been preserved, while non-English portions have been machine-translated for readability. Please be aware that minor inaccuracies may exist due to the automated nature of the translation. Update what? No one reviews 😢 |
|
我的理解仅仅是 前面的 |
Background
tgid_pname_map 只是用在 cookie_pid_map update 失败时的 fallback:
_update_map_elem_by_cookie()里 tgid_pname_map[pid] = val 再在上层函数update_map_elem_by_cookie()里读 tgid_pname_map[pid] 也是多此一举,一个指针传递就行了,无需用 map。这个 PR 直接删去了 cookie_pid_map 同时维持了 fallback 逻辑,减小了内核内存消耗,整整 8192 * (4 + 16) = 163840 bytes = 0.16384 Mb 呢!同时省去了 wan 代理时对每个 socket 的一次 map 操作,提升全局性能。
Checklist
Full Changelogs
Issue Reference
Closes #[issue number]
Test Result