Linux??????????????????
???????????? ???????[ 2016/11/9 10:11:41 ] ?????????????? Linux
???????????????alloc_pid???????????????????????kernel.pid_max??????
??????????????100000????????С?
???????????strace???????η????????????mprotect????
????????????????????????mmap???????????????vm.max_map_count??????
??????????????100000????????У?????????????????
????????????滹?????????kernel.threads-max???????????????????????????800000???????????????????????????б????????
???????????????????????????ó?800000??????????????????????????????
????3.3 ???????
??????????copy_process????
????copy_process
????3.3.1 ???????
????dup_task_struct–>alloc_task_struct_node/alloc_thread_info_node/arch_dup_task_struct–>kmme_cache_alloc_node(slub.c)–>slab_alloc_node–>
????“CONFIG_MEMCG_KMEM” //?????????????docker???????cgroup?????????????????????slub????æ²»???ó??????????
???????庯????
????alloc_pages—->__memcg_kmem_newpage_charge–>memcg_charge_kmem–>__res_counter_charge–>res_counter_charge_locked
????3.3.2 Threads-max????????
????if (nr_threads >= max_threads) // threads-max ???????
????3.3.3 Pid_max????????
????alloc_pid–>alloc_pidmap //pid_max???????
????3.3.4 ?????????????
??????????????????????????vm.max_map_count????
????4. ???
????/proc/sys/kernel/pid_max #???????????????
????/proc/sys/kernel/thread-max #???????????
????max_user_process??ulimit -u?? #???????????????????ж??????????
????/proc/sys/vm/max_map_count #??????mmap???????????????????????????
????/sys/fs/cgroup/memory/${cgroup}/memory.kmem #????docker ???????????????????task_struct??slab?????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11