linux kernel - is system(const char *command) lead to cpu sys 100% -
i create 1 background thread b,and in func of b, void func() { system('gzip -f text-file'); // size of text-file 100m xxx } i found sometime sys of 1 cpu(my server has more 1 cpu core) 100%. strace progress, found clone syscall consume more 3 seconds, execution time of gzip. **17:46:04.545159** clone(child_stack=0, flags=clone_parent_settid|sigchld, parent_tidptr=0x418dba38) = 39169 **17:46:07.432385** wait4(39169, [{wifexited(s) && wexitstatus(s) == 0}], 0, null) = 39169 so question is, 1. system('gzip -f text-file') lead 100% cpu sys ? 2. root cause sys_clone without clone_mm full copy of virtual memory mapping parent process child process, according https://www.kernel.org/doc/gorman/html/understand/understand021.html 343 allocate new mm 348-350 copy parent mm , initialise process specific mm fields init_mm() 352-353 initialise mmu context architectures not automatically manage mmu 355-357 call dup_mmap() responsible copyin...