{"id":362604,"date":"2024-05-21T01:38:35","date_gmt":"2024-05-21T01:38:35","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=362604"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=362604","title":{"rendered":"<span>\u041e\u0442\u043b\u0430\u0434\u043a\u0430 \u0434\u0435\u0434\u043b\u043e\u043a\u0430 FUSE \u0432 \u044f\u0434\u0440\u0435 Linux<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041d\u0430\u0448\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 Netflix (Compute team) \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 AWS, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0437\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u0412 \u043c\u043e\u0438 \u043e\u0431\u044f\u0437\u0430\u043d\u043d\u043e\u0441\u0442\u0438 \u0432\u0445\u043e\u0434\u0438\u0442 \u0440\u0430\u0437\u0431\u043e\u0440 \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0430\u044e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438.<\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u0430\u044f \u0434\u0430\u043b\u0435\u0435, \u0431\u044b\u043b\u0430 \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 <a href=\"https:\/\/netflixtechblog.com\/netflix-drive-a607538c3055\"><u>ndrive<\/u><\/a> \u2014 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 <a href=\"https:\/\/www.kernel.org\/doc\/html\/latest\/filesystems\/fuse.html\"><u>\u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e FUSE<\/u><\/a>. \u042f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u044f \u043a\u043e\u043f\u0430\u043b\u0441\u044f \u0432 \/proc \u0432 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u043f\u0440\u0438\u0447\u0438\u043d\u044b, \u0438 \u0443\u0437\u043d\u0430\u043b, \u043a\u0430\u043a \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 wait \u0432 \u044f\u0434\u0440\u0435.<\/p>\n<h2>\u0417\u0430\u0432\u0438\u0441\u0430\u043d\u0438\u0435 Docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 kill \u0438 \u0437\u043e\u043c\u0431\u0438-\u043f\u0440\u043e\u0446\u0435\u0441\u0441<\/h2>\n<p>\u041c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u0437\u0430\u0432\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 API \u0434\u043e\u043a\u0435\u0440\u0430:<\/p>\n<pre><code>goroutine 146 [select, 8817 minutes]: net\/http.(*persistConn).roundTrip(0xc000658fc0, 0xc0003fc080, 0x0, 0x0, 0x0)         \/usr\/local\/go\/src\/net\/http\/transport.go:2610 +0x765 net\/http.(*Transport).roundTrip(0xc000420140, 0xc000966200, 0x30, 0x1366f20, 0x162)         \/usr\/local\/go\/src\/net\/http\/transport.go:592 +0xacb net\/http.(*Transport).RoundTrip(0xc000420140, 0xc000966200, 0xc000420140, 0x0, 0x0)         \/usr\/local\/go\/src\/net\/http\/roundtrip.go:17 +0x35 net\/http.send(0xc000966200, 0x161eba0, 0xc000420140, 0x0, 0x0, 0x0, 0xc00000e050, 0x3, 0x1, 0x0)         \/usr\/local\/go\/src\/net\/http\/client.go:251 +0x454 net\/http.(*Client).send(0xc000438480, 0xc000966200, 0x0, 0x0, 0x0, 0xc00000e050, 0x0, 0x1, 0x10000168e)         \/usr\/local\/go\/src\/net\/http\/client.go:175 +0xff net\/http.(*Client).do(0xc000438480, 0xc000966200, 0x0, 0x0, 0x0)         \/usr\/local\/go\/src\/net\/http\/client.go:717 +0x45f net\/http.(*Client).Do(...)         \/usr\/local\/go\/src\/net\/http\/client.go:585 golang.org\/x\/net\/context\/ctxhttp.Do(0x163bd48, 0xc000044090, 0xc000438480, 0xc000966100, 0x0, 0x0, 0x0)         \/go\/pkg\/mod\/golang.org\/x\/net@v0.0.0-20211209124913-491a49abca63\/context\/ctxhttp\/ctxhttp.go:27 +0x10f github.com\/docker\/docker\/client.(*Client).doRequest(0xc0001a8200, 0x163bd48, 0xc000044090, 0xc000966100, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)         \/go\/pkg\/mod\/github.com\/moby\/moby@v0.0.0-20190408150954-50ebe4562dfc\/client\/request.go:132 +0xbe github.com\/docker\/docker\/client.(*Client).sendRequest(0xc0001a8200, 0x163bd48, 0xc000044090, 0x13d8643, 0x3, 0xc00079a720, 0x51, 0x0, 0x0, 0x0, ...)         \/go\/pkg\/mod\/github.com\/moby\/moby@v0.0.0-20190408150954-50ebe4562dfc\/client\/request.go:122 +0x156 github.com\/docker\/docker\/client.(*Client).get(...)         \/go\/pkg\/mod\/github.com\/moby\/moby@v0.0.0-20190408150954-50ebe4562dfc\/client\/request.go:37 github.com\/docker\/docker\/client.(*Client).ContainerInspect(0xc0001a8200, 0x163bd48, 0xc000044090, 0xc0006a01c0, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, ...)         \/go\/pkg\/mod\/github.com\/moby\/moby@v0.0.0-20190408150954-50ebe4562dfc\/client\/container_inspect.go:18 +0x128 github.com\/Netflix\/titus-executor\/executor\/runtime\/docker.(*DockerRuntime).Kill(0xc000215180, 0x163bdb8, 0xc000938600, 0x1, 0x0, 0x0)         \/var\/lib\/buildkite-agent\/builds\/ip-192-168-1-90-1\/netflix\/titus-executor\/executor\/runtime\/docker\/docker.go:2835 +0x310 github.com\/Netflix\/titus-executor\/executor\/runner.(*Runner).doShutdown(0xc000432dc0, 0x163bd10, 0xc000938390, 0x1, 0xc000b821e0, 0x1d, 0xc0005e4710)         \/var\/lib\/buildkite-agent\/builds\/ip-192-168-1-90-1\/netflix\/titus-executor\/executor\/runner\/runner.go:326 +0x4f4 github.com\/Netflix\/titus-executor\/executor\/runner.(*Runner).startRunner(0xc000432dc0, 0x163bdb8, 0xc00071e0c0, 0xc0a502e28c08b488, 0x24572b8, 0x1df5980)         \/var\/lib\/buildkite-agent\/builds\/ip-192-168-1-90-1\/netflix\/titus-executor\/executor\/runner\/runner.go:122 +0x391 created by github.com\/Netflix\/titus-executor\/executor\/runner.StartTaskWithRuntime         \/var\/lib\/buildkite-agent\/builds\/ip-192-168-1-90-1\/netflix\/titus-executor\/executor\/runner\/runner.go:81 +0x411<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0438\u0441 (management engine) \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 HTTP-\u0432\u044b\u0437\u043e\u0432 \u043a unix-\u0441\u043e\u043a\u0435\u0442\u0443 Docker API \u0441 \u043f\u0440\u043e\u0441\u044c\u0431\u043e\u0439 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0438\u0442\u044c (<code>kill<\/code>) \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440. \u041d\u0430\u0448\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u043d\u0430 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 SIGKILL. \u041d\u043e kill (<code>SIGKILL<\/code>) \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0444\u0430\u0442\u0430\u043b\u044c\u043d\u044b\u043c, \u0430 \u0437\u0434\u0435\u0441\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0447\u0442\u043e-\u0442\u043e \u0435\u0449\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c?<\/p>\n<pre><code>$ docker exec -it 6643cd073492 bash OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: process_linux.go:130: executing setns process caused: exit status 1: unknown<\/code><\/pre>\n<p>\u0421\u0442\u0440\u0430\u043d\u043d\u043e. \u0412\u0440\u043e\u0434\u0435 \u0431\u044b \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0435\u0449\u0435 \u0436\u0438\u0432, \u043d\u043e <code>setns(2)<\/code> \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u043e\u0439. \u0427\u0442\u043e \u0436\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442? \u0415\u0441\u043b\u0438 \u043c\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0434\u0435\u0440\u0435\u0432\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 <code>ps awwfux<\/code>, \u0442\u043e \u0443\u0432\u0438\u0434\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code>\\_ containerd-shim -namespace moby -workdir \/var\/lib\/containerd\/io.containerd.runtime.v1.linux\/moby\/6643cd073492ba9166100ed30dbe389ff1caef0dc3d35 |  \\_ [docker-init] |      \\_ [ndrive] &lt;defunct><\/code><\/pre>\n<p>\u0418\u0442\u0430\u043a, \u043f\u0440\u043e\u0446\u0435\u0441\u0441 init \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432\u0441\u0435 \u0435\u0449\u0435 \u0436\u0438\u0432, \u043d\u043e \u0443 \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u044c \u043e\u0434\u0438\u043d \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0439 \u0437\u043e\u043c\u0431\u0438. \u0427\u0435\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043d\u044f\u0442 init \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430?<\/p>\n<pre><code># cat \/proc\/1528591\/stack [&lt;0>] do_wait+0x156\/0x2f0 [&lt;0>] kernel_wait4+0x8d\/0x140 [&lt;0>] zap_pid_ns_processes+0x104\/0x180 [&lt;0>] do_exit+0xa41\/0xb80 [&lt;0>] do_group_exit+0x3a\/0xa0 [&lt;0>] __x64_sys_exit_group+0x14\/0x20 [&lt;0>] do_syscall_64+0x37\/0xb0 [&lt;0>] entry_SYSCALL_64_after_hwframe+0x44\/0xae<\/code><\/pre>\n<p>\u041e\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f, \u043d\u043e, \u043f\u043e\u0445\u043e\u0436\u0435, \u0437\u0430\u0432\u0438\u0441, \u0438 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 ndrive \u2014 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 Z (&#171;\u0437\u043e\u043c\u0431\u0438&#187;). \u0417\u043e\u043c\u0431\u0438 \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0438\u0441\u044c \u0438 \u043e\u0436\u0438\u0434\u0430\u044e\u0442, \u043a\u043e\u0433\u0434\u0430 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0438\u0445 \u043a\u043e\u0434 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 <code>wait()<\/code>. \u041d\u043e \u043a\u0430\u043a \u0436\u0435 \u044f\u0434\u0440\u043e \u043c\u043e\u0433\u043b\u043e \u0437\u0430\u0441\u0442\u0440\u044f\u0442\u044c \u0432 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0438 \u0437\u043e\u043c\u0431\u0438?<\/p>\n<pre><code># ls \/proc\/1544450\/task 1544450  1544574<\/code><\/pre>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e. \u0412 \u0433\u0440\u0443\u043f\u043f\u0435 \u043f\u043e\u0442\u043e\u043a\u0430 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043f\u043e\u0442\u043e\u043a\u0430. \u041e\u0434\u0438\u043d \u0438\u0437 \u043d\u0438\u0445 \u0437\u043e\u043c\u0431\u0438, \u0430 \u0434\u0440\u0443\u0433\u043e\u0439, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043d\u0435\u0442:<\/p>\n<pre><code># cat \/proc\/1544574\/stack [&lt;0>] request_wait_answer+0x12f\/0x210 [&lt;0>] fuse_simple_request+0x109\/0x2c0 [&lt;0>] fuse_flush+0x16f\/0x1b0 [&lt;0>] filp_close+0x27\/0x70 [&lt;0>] put_files_struct+0x6b\/0xc0 [&lt;0>] do_exit+0x360\/0xb80 [&lt;0>] do_group_exit+0x3a\/0xa0 [&lt;0>] get_signal+0x140\/0x870 [&lt;0>] arch_do_signal_or_restart+0xae\/0x7c0 [&lt;0>] exit_to_user_mode_prepare+0x10f\/0x1c0 [&lt;0>] syscall_exit_to_user_mode+0x26\/0x40 [&lt;0>] do_syscall_64+0x46\/0xb0 [&lt;0>] entry_SYSCALL_64_after_hwframe+0x44\/0xae<\/code><\/pre>\n<p>\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0432\u0442\u043e\u0440\u043e\u0439 \u2014 \u043d\u0435 \u0437\u043e\u043c\u0431\u0438. \u041d\u043e \u043e\u043d \u0438\u0437\u043e \u0432\u0441\u0435\u0445 \u0441\u0438\u043b \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0438\u043c \u0441\u0442\u0430\u0442\u044c, \u0438 \u043f\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435, \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 FUSE. \u0427\u0442\u043e\u0431\u044b \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c \u043f\u0440\u0438\u0447\u0438\u043d\u0443, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u043a\u043e\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/git.kernel.org\/pub\/scm\/linux\/kernel\/git\/torvalds\/linux.git\/tree\/kernel\/pid_namespace.c?h=v5.19#n166\"><u>zap_pid_ns_processes()<\/u><\/a>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0438 \u0437\u0430\u0441\u0442\u0440\u044f\u043b\u0438:<\/p>\n<pre><code>\/*  * Reap the EXIT_ZOMBIE children we had before we ignored SIGCHLD.  * kernel_wait4() will also block until our children traced from the  * parent namespace are detached and become EXIT_DEAD.  *\/ do {         clear_thread_flag(TIF_SIGPENDING);         rc = kernel_wait4(-1, NULL, __WALL, NULL); } while (rc != -ECHILD);<\/code><\/pre>\n<p>\u041d\u043e \u043f\u0435\u0440\u0435\u0434 \u044d\u0442\u0438\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f:<\/p>\n<pre><code>\/* Don't allow any more processes into the pid namespace *\/ disable_pid_allocation(pid_ns);<\/code><\/pre>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u043a\u0435\u0440 \u0438 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c <code>setns()<\/code>, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0435\u043d (namespace) \u2014 \u0437\u043e\u043c\u0431\u0438. \u0425\u043e\u0440\u043e\u0448\u043e, \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c <code>setns(2)<\/code>, \u043d\u043e \u043f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u0437\u0430\u0441\u0442\u0440\u044f\u043b\u0438 \u0432 <code>kernel_wait4()<\/code>? \u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u043f\u0440\u0438\u0447\u0438\u043d\u0443, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u043b \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0442\u043e\u043a \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <a href=\"https:\/\/git.kernel.org\/pub\/scm\/linux\/kernel\/git\/torvalds\/linux.git\/tree\/fs\/fuse\/dev.c?h=v5.19#n407\"><u>request_wait_answer()<\/u><\/a> FUSE:<\/p>\n<pre><code>\/*  * Either request is already in userspace, or it was forced.  * Wait it out.  *\/ wait_event(req->waitq, test_bit(FR_FINISHED, &amp;req->flags));<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0436\u0434\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f (\u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u0432\u0435\u0442\u0430 \u0438\u0437 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u043e\u0431 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441\u0431\u0440\u043e\u0441\u0430 \u043d\u0430 \u0434\u0438\u0441\u043a (flush) \u043e\u0442 FUSE). \u041d\u043e <code>zap_pid_ns_processes()<\/code> \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b <code>SIGKILL<\/code>! \u0421\u0438\u0433\u043d\u0430\u043b <code>SIGKILL<\/code> \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0444\u0430\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u0434\u043b\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u0415\u0441\u043b\u0438 \u043c\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043e\u0436\u0438\u0434\u0430\u044e\u0449\u0438\u0439 (pending) \u0441\u0438\u0433\u043d\u0430\u043b <code>SIGKILL<\/code>:<\/p>\n<pre><code># grep Pnd \/proc\/1544574\/status SigPnd: 0000000000000000 ShdPnd: 0000000000000100<\/code><\/pre>\n<p>\u0412 ShdPnd \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c 0x100 (\u0442. \u0435. \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d 9-\u0439 \u0431\u0438\u0442), \u0447\u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 SIGKILL.\u00a0<\/p>\n<p>\u041e\u0436\u0438\u0434\u0430\u044e\u0449\u0438\u0435 (pending) \u0441\u0438\u0433\u043d\u0430\u043b\u044b \u2014 \u044d\u0442\u043e \u0441\u0438\u0433\u043d\u0430\u043b\u044b, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u044f\u0434\u0440\u043e\u043c, \u043d\u043e \u0435\u0449\u0435 \u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e. \u0421\u0438\u0433\u043d\u0430\u043b\u044b \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0432\u0445\u043e\u0434\u0435 \u0438\u043b\u0438 \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u0438\u043b\u0438 \u043f\u0440\u0438 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439. \u0415\u0441\u043b\u0438 \u044f\u0434\u0440\u043e \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0447\u0435\u043c-\u0442\u043e \u0437\u0430\u043d\u044f\u0442\u043e, \u0441\u0438\u0433\u043d\u0430\u043b \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0438 (pending). \u0422\u0430\u043a\u0436\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0437\u0430\u0434\u0430\u0447\u0435\u0439, \u0438 \u043e\u043d\u0438 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b. \u0417\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u044b \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043d\u0430\u0431\u043e\u0440\u0430\u0445. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 man 7 signal \u0441\u043a\u0430\u0437\u0430\u043d\u043e: &#171;\u0421\u0438\u0433\u043d\u0430\u043b\u044b <code>SIGKILL<\/code> \u0438 <code>SIGSTOP<\/code> \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u0439\u043c\u0430\u043d\u044b, \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0438\u043b\u0438 \u043f\u0440\u043e\u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b&#187;. \u041d\u043e \u0437\u0434\u0435\u0441\u044c \u044f\u0434\u0440\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043e\u0436\u0438\u0434\u0430\u044e\u0449\u0438\u0439 \u0441\u0438\u0433\u043d\u0430\u043b <code>SIGKILL<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0434\u0430\u0436\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438!<\/p>\n<h2>\u041b\u043e\u0436\u043d\u044b\u0439 \u0441\u043b\u0435\u0434: \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441\u0438\u0433\u043d\u0430\u043b\u044b?<\/h2>\n<p>\u0412\u0441\u0435 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0441\u0442\u0440\u0430\u043d\u043d\u043e, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e wait (\u0442. \u0435. <code>include\/linux\/wait.h<\/code>) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u044f\u0434\u0440\u0435 \u043f\u043e\u0432\u0441\u044e\u0434\u0443: \u0441\u0435\u043c\u0430\u0444\u043e\u0440\u044b, \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f, \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0438 \u0442. \u0434. \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u043e\u043d \u0437\u043d\u0430\u0435\u0442 \u043e <code>SIGKILL<\/code>. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0436\u0435 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 <code>wait_event()<\/code>? \u041f\u043e\u043a\u043e\u043f\u0430\u0432\u0448\u0438\u0441\u044c \u0432 \u043a\u043e\u0434\u0435, \u044f \u043d\u0430\u0448\u0435\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"python\">#define ___wait_event(wq_head, condition, state, exclusive, ret, cmd)           \\ ({                                                                              \\         __label__ __out;                                                        \\         struct wait_queue_entry __wq_entry;                                     \\         long __ret = ret;       \/* explicit shadow *\/                           \\                                                                                 \\         init_wait_entry(&amp;__wq_entry, exclusive ? WQ_FLAG_EXCLUSIVE : 0);        \\         for (;;) {                                                              \\                 long __int = prepare_to_wait_event(&amp;wq_head, &amp;__wq_entry, state);\\                                                                                 \\                 if (condition)                                                  \\                         break;                                                  \\                                                                                 \\                 if (___wait_is_interruptible(state) &amp;&amp; __int) {                 \\                         __ret = __int;                                          \\                         goto __out;                                             \\                 }                                                               \\                                                                                 \\                 cmd;                                                            \\         }                                                                       \\         finish_wait(&amp;wq_head, &amp;__wq_entry);                                     \\ __out:  __ret;                                                                  \\ })<\/code><\/pre>\n<p>\u0412 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f <code>prepare_to_wait_event()<\/code>, \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f <code>condition<\/code>, \u0430 \u043f\u043e\u0441\u043b\u0435 \u2014 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u043b\u0438 \u043c\u044b \u043f\u0440\u0435\u0440\u0432\u0430\u0442\u044c\u0441\u044f. \u041f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f <code>cmd<\/code>, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <code>schedule()<\/code>, \u0442.\u0435. &#171;\u0437\u0430\u0439\u043c\u0438\u0441\u044c \u0447\u0435\u043c-\u043d\u0438\u0431\u0443\u0434\u044c \u0434\u0440\u0443\u0433\u0438\u043c \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f&#187;. \u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>prepare_to_wait_event()<\/code> \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"python\">long prepare_to_wait_event(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int state) {         unsigned long flags;         long ret = 0;          spin_lock_irqsave(&amp;wq_head->lock, flags);         if (signal_pending_state(state, current)) {                 \/*                  * Exclusive waiter must not fail if it was selected by wakeup,                  * it should \"consume\" the condition we were waiting for.                  *                  * The caller will recheck the condition and return success if                  * we were already woken up, we can not miss the event because                  * wakeup locks\/unlocks the same wq_head->lock.                  *                  * But we need to ensure that set-condition + wakeup after that                  * can't see us, it should wake up another exclusive waiter if                  * we fail.                  *\/                 list_del_init(&amp;wq_entry->entry);                 ret = -ERESTARTSYS;         } else {                 if (list_empty(&amp;wq_entry->entry)) {                         if (wq_entry->flags &amp; WQ_FLAG_EXCLUSIVE)                                 __add_wait_queue_entry_tail(wq_head, wq_entry);                         else                                 __add_wait_queue(wq_head, wq_entry);                 }                 set_current_state(state);         }         spin_unlock_irqrestore(&amp;wq_head->lock, flags);          return ret; } EXPORT_SYMBOL(prepare_to_wait_event);<\/code><\/pre>\n<p>\u041f\u043e\u0445\u043e\u0436\u0435, \u0447\u0442\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0432\u044b\u0445\u043e\u0434 \u0438\u0437 \u044d\u0442\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0441 \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 \u2014 \u0435\u0441\u043b\u0438 <code>signal_pending_state()<\/code> \u0431\u0443\u0434\u0435\u0442 <code>true<\/code>. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0434\u0430\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432\u044b\u0437\u0432\u0430\u043b\u0438 \u0438\u0437 <code>wait_event()<\/code>, \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0437\u0434\u0435\u0441\u044c <code>TASK_UNINTERRUPTIBLE<\/code>. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 <code>signal_pending_state()<\/code> \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"python\">static inline int signal_pending_state(unsigned int state, struct task_struct *p) {         if (!(state &amp; (TASK_INTERRUPTIBLE | TASK_WAKEKILL)))                 return 0;         if (!signal_pending(p))                 return 0;          return (state &amp; TASK_INTERRUPTIBLE) || __fatal_signal_pending(p); }<\/code><\/pre>\n<p>\u041d\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u0430\u0435\u043c\u0430\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0432\u044b\u0439 <code>if<\/code> \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041e\u0434\u043d\u0430\u043a\u043e \u0443 \u043d\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043e\u0436\u0438\u0434\u0430\u044e\u0449\u0438\u0439 \u0441\u0438\u0433\u043d\u0430\u043b, \u0432\u0435\u0440\u043d\u043e?<\/p>\n<pre><code class=\"python\">static inline int signal_pending(struct task_struct *p) {         \/*          * TIF_NOTIFY_SIGNAL isn't really a signal, but it requires the same          * behavior in terms of ensuring that we break out of wait loops          * so that notify signal callbacks can be processed.          *\/         if (unlikely(test_tsk_thread_flag(p, TIF_NOTIFY_SIGNAL)))                 return 1;         return task_sigpending(p); }<\/code><\/pre>\n<p>\u041a\u0430\u043a \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043e \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, <code>TIF_NOTIFY_SIGNAL<\/code> \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u0432\u0430\u0436\u0435\u043d \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0441\u0432\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 <code>task_sigpending()<\/code>:<\/p>\n<pre><code class=\"python\">static inline int task_sigpending(struct task_struct *p) {         return unlikely(test_tsk_thread_flag(p,TIF_SIGPENDING)); }<\/code><\/pre>\n<p>\u0425\u043c. \u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u044d\u0442\u043e\u0442 \u0444\u043b\u0430\u0433 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d, \u0432\u0435\u0440\u043d\u043e? \u0427\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0430 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432. \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0435\u043d <code>pid<\/code> \u0432 <code>zap_pid_ns_processes()<\/code>, \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"python\">group_send_sig_info(SIGKILL, SEND_SIG_PRIV, task, PIDTYPE_MAX);<\/code><\/pre>\n<p>\u0427\u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>__send_signal_locked()<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0435\u0441\u0442\u044c:<\/p>\n<pre><code class=\"python\">pending = (type != PIDTYPE_PID) ? &amp;t->signal->shared_pending : &amp;t->pending; ... sigaddset(&amp;pending->signal, sig); ... complete_signal(sig, t, type);<\/code><\/pre>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0442\u0438\u043f\u0430 <code>PIDTYPE_MAX<\/code> \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u043e, \u043d\u043e, \u043f\u043e \u0441\u0443\u0442\u0438, \u0437\u0434\u0435\u0441\u044c \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f: &#171;\u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u044f\u0434\u0440\u0430, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0430\u044f \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u0438\u0433\u043d\u0430\u043b, \u0438 \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0435\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c&#187;. \u0417\u0434\u0435\u0441\u044c \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0435\u0435\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e <code>__send_signal_locked()<\/code> \u0432 \u0438\u0442\u043e\u0433\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 <code>SIGKILL<\/code> \u0432 \u043e\u0431\u0449\u0438\u0439 \u043d\u0430\u0431\u043e\u0440 (shared set), \u0430 \u043d\u0435 \u0432 \u043d\u0430\u0431\u043e\u0440 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. \u0418 \u0435\u0441\u043b\u0438 \u043c\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043a\u043e\u0434 <code>__fatal_signal_pending()<\/code>, \u0442\u043e \u0443\u0432\u0438\u0434\u0438\u043c:<\/p>\n<pre><code class=\"python\">static inline int __fatal_signal_pending(struct task_struct *p) {         return unlikely(sigismember(&amp;p->pending.signal, SIGKILL)); }<\/code><\/pre>\n<p>\u042d\u0442\u043e \u043b\u043e\u0436\u043d\u044b\u0439 \u0441\u043b\u0435\u0434 (<a href=\"https:\/\/lore.kernel.org\/all\/YuGUyayVWDB7R89i@tycho.pizza\/\"><u>\u043d\u043e<\/u><\/a> <a href=\"https:\/\/lore.kernel.org\/all\/20220728091220.GA11207@redhat.com\/\"><u>\u043c\u043d\u0435<\/u><\/a> <a href=\"https:\/\/lore.kernel.org\/all\/871qu6bjp3.fsf@email.froward.int.ebiederm.org\/\"><u>\u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c<\/u><\/a> <a href=\"https:\/\/lore.kernel.org\/all\/8735elhy4u.fsf@email.froward.int.ebiederm.org\/\"><u>\u0432\u0440\u0435\u043c\u044f<\/u><\/a>, \u0447\u0442\u043e\u0431\u044b <a href=\"https:\/\/lore.kernel.org\/all\/87pmhofr1q.fsf@email.froward.int.ebiederm.org\/\"><u>\u043f\u043e\u043d\u044f\u0442\u044c<\/u><\/a> \u044d\u0442\u043e).<\/p>\n<h2>\u041a\u0430\u043a \u0441\u0438\u0433\u043d\u0430\u043b\u044b \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0443<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u043d\u0443\u0436\u043d\u043e \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>complete_signal()<\/code>, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d\u0430 \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 SIGKILL \u0432 \u043d\u0430\u0431\u043e\u0440 \u043e\u0436\u0438\u0434\u0430\u044e\u0449\u0438\u0445 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u0437\u0430\u0434\u0430\u0447\u0438 (task\u2019s pending set):<\/p>\n<pre><code class=\"python\">sigaddset(&amp;t->pending.signal, SIGKILL);<\/code><\/pre>\n<p>\u041d\u043e \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442? \u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0435\u0441\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"python\">\/*  * Now find a thread we can wake up to take the signal off the queue.  *  * If the main thread wants the signal, it gets first crack.  * Probably the least surprising to the average bear.  *\/ if (wants_signal(sig, p))         t = p; else if ((type == PIDTYPE_PID) || thread_group_empty(p))         \/*          * There is just one thread and it does not need to be woken.          * It will dequeue unblocked signals before it runs again.          *\/         return;<\/code><\/pre>\n<p>\u041a\u0430\u043a <a href=\"https:\/\/lore.kernel.org\/all\/877d4jbabb.fsf@email.froward.int.ebiederm.org\/\"><u>\u043f\u043e\u044f\u0441\u043d\u0438\u043b \u042d\u0440\u0438\u043a \u0411\u0438\u0434\u0435\u0440\u043c\u0430\u043d (Eric Biederman)<\/u><\/a>, \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c SIGKILL \u0432 \u043b\u044e\u0431\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u0412\u043e\u0442 \u043a\u043e\u0434 <code>wants_signal()<\/code>:<\/p>\n<pre><code class=\"python\">static inline bool wants_signal(int sig, struct task_struct *p) {         if (sigismember(&amp;p->blocked, sig))                 return false;          if (p->flags &amp; PF_EXITING)                 return false;          if (sig == SIGKILL)                 return true;          if (task_is_stopped_or_traced(p))                 return false;          return task_curr(p) || !task_sigpending(p); }<\/code><\/pre>\n<p>\u0418\u0442\u0430\u043a\u2026 \u0435\u0441\u043b\u0438 \u043f\u043e\u0442\u043e\u043a \u0443\u0436\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f (\u0442. \u0435. \u0443 \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u044c <code>PF_EXITING<\/code>), \u0435\u043c\u0443 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0441\u0438\u0433\u043d\u0430\u043b \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f.\u00a0<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u0439:<\/p>\n<p>1. \u0417\u0430\u0434\u0430\u0447\u0430 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0444\u0430\u0439\u043b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <code>FUSE<\/code>, \u043d\u0435 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0435\u0433\u043e, \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443. \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u044f\u0434\u0440\u043e \u043f\u043e\u0441\u043b\u0443\u0448\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>do_exit()<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f:<\/p>\n<pre><code class=\"python\">exit_signals(tsk); \/* sets PF_EXITING *\/<\/code><\/pre>\n<p>2. <code>do_exit()<\/code> \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u043e <code>exit_files(tsk)<\/code>, \u0433\u0434\u0435 \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f (flush) \u0432\u0441\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0447\u0435\u0433\u043e \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u0430\u044f \u0432\u044b\u0448\u0435 \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u0441\u0442\u0435\u043a\u0430.<\/p>\n<p>3. \u041f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0435\u043d <code>pid<\/code> \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>zap_pid_ns_processes()<\/code>, \u0432\u0441\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f <code>SIGKILL<\/code> (\u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u043a\u0430\u043a \u043e\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044f, \u0431\u0443\u0434\u0435\u0442 \u0444\u0430\u0442\u0430\u043b\u044c\u043d\u044b\u043c), \u0430 \u0434\u0430\u043b\u044c\u0448\u0435 \u2014 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432.<\/p>\n<p>4. \u042d\u0442\u043e \u0443\u0431\u0438\u0432\u0430\u0435\u0442 \u0434\u0435\u043c\u043e\u043d\u0430 <code>FUSE<\/code> \u0432 <code>pid ns<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d \u0443\u0436\u0435 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c.<\/p>\n<p>5. <code>complete_signal()<\/code> \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u0447\u0438 <code>FUSE<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u0436\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0430\u0441\u044c, \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442 \u0441\u0438\u0433\u043d\u0430\u043b, \u0442.\u043a. \u0443 \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u044c <code>PF_EXITING<\/code>.<\/p>\n<p>6. \u0414\u0435\u0434\u043b\u043e\u043a. \u0411\u0435\u0437 \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a <code>FUSE<\/code>, \u0432\u0441\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0441\u0435\u0442\u044c \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e.<\/p>\n<h2>\u0420\u0435\u0448\u0435\u043d\u0438\u0435: \u043d\u0435 \u0436\u0434\u0438\u0442\u0435!<\/h2>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u0436\u0434\u0430\u0442\u044c \u0441\u0431\u0440\u043e\u0441\u0430 (flush): \u0437\u0430\u0434\u0430\u0447\u0430 \u0443\u043c\u0438\u0440\u0430\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u043a\u043e\u043c\u0443 \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u043a\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 <code>flush()<\/code>. \u042d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0438 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442 \u043a\u043e\u0434 <code>wait<\/code> \u044f\u0434\u0440\u0430 \u0432\u043e <code>flash()<\/code>, \u0442. \u0435. \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e \u0432\u0441\u0435\u043c\u0438, \u043a\u0442\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a \u0447\u0435\u043c\u0443-\u0442\u043e \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u044f\u0434\u0440\u0430.<\/p>\n<p>\u0422\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0434\u043b\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0443\u0436\u0435 \u0432\u044b\u0448\u043b\u0438 \u043f\u0430\u0442\u0447\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/github.com\/torvalds\/linux\/commit\/14feceeeb012faf9def7d313d37f5d4f85e6572b\"><u>\u0437\u0434\u0435\u0441\u044c<\/u><\/a> \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043b\u044f FUSE, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u0432 \u044f\u0434\u0440\u043e Linux 6.3,\u00a0 \u0432\u044b\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u0435 23 \u0430\u043f\u0440\u0435\u043b\u044f 2023 \u0433\u043e\u0434\u0430.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u044b\u043b\u0430 \u0440\u0435\u0447\u044c \u043e \u0434\u0435\u0434\u043b\u043e\u043a\u0435 FUSE, \u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0435\u0441\u0442\u044c \u0438 \u0432 \u043a\u043e\u0434\u0435 nfs \u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u0445, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u044b \u0435\u0449\u0435 \u043d\u0435 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435, \u043d\u043e \u043f\u043e\u0447\u0442\u0438 \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0441\u0442\u043e\u043b\u043a\u043d\u0435\u043c\u0441\u044f. \u0422\u0430\u043a\u0436\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0438\u043c\u043f\u0442\u043e\u043c\u043e\u043c <a href=\"https:\/\/lore.kernel.org\/all\/20230512225414.GE3223426@dread.disaster.area\/\"><u>\u0434\u0440\u0443\u0433\u0438\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/u><\/a>. \u041d\u0430 \u044d\u0442\u043e \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0435\u043d pid, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>\u042d\u0442\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043e\u0434\u0438\u043d \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u044b \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u0432 Netflix, \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0430\u0445.\u00a0<\/p>\n<blockquote>\n<p>\u0412 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u0432\u0441\u0435\u0445 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u043d\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0443\u0440\u043e\u043a OTUS \u00ab\u0418\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043a\u0430\u043a \u043a\u043e\u0434, ansible, terraform\u00bb, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0439\u0434\u0435\u0442 \u0443\u0436\u0435 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0432\u0435\u0447\u0435\u0440\u043e\u043c. \u0417\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/otus.pw\/4NKE\/\">\u0437\u0434\u0435\u0441\u044c.<\/a><\/p>\n<\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/779820\/\"> https:\/\/habr.com\/ru\/articles\/779820\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041d\u0430\u0448\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 Netflix (Compute team) \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 AWS, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0437\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u0412 \u043c\u043e\u0438 \u043e\u0431\u044f\u0437\u0430\u043d\u043d\u043e\u0441\u0442\u0438 \u0432\u0445\u043e\u0434\u0438\u0442 \u0440\u0430\u0437\u0431\u043e\u0440 \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0430\u044e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438.<\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u0430\u044f \u0434\u0430\u043b\u0435\u0435, \u0431\u044b\u043b\u0430 \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 <a href=\"https:\/\/netflixtechblog.com\/netflix-drive-a607538c3055\"><u>ndrive<\/u><\/a> \u2014 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 <a href=\"https:\/\/www.kernel.org\/doc\/html\/latest\/filesystems\/fuse.html\"><u>\u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e FUSE<\/u><\/a>. \u042f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u044f \u043a\u043e\u043f\u0430\u043b\u0441\u044f \u0432 \/proc \u0432 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u043f\u0440\u0438\u0447\u0438\u043d\u044b, \u0438 \u0443\u0437\u043d\u0430\u043b, \u043a\u0430\u043a \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 wait \u0432 \u044f\u0434\u0440\u0435.<\/p>\n<h2>\u0417\u0430\u0432\u0438\u0441\u0430\u043d\u0438\u0435 Docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 kill \u0438 \u0437\u043e\u043c\u0431\u0438-\u043f\u0440\u043e\u0446\u0435\u0441\u0441<\/h2>\n<p>\u041c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u0437\u0430\u0432\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 API \u0434\u043e\u043a\u0435\u0440\u0430:<\/p>\n<pre><code>goroutine 146 [select, 8817 minutes]: net\/http.(*persistConn).roundTrip(0xc000658fc0, 0xc0003fc080, 0x0, 0x0, 0x0)         \/usr\/local\/go\/src\/net\/http\/transport.go:2610 +0x765 net\/http.(*Transport).roundTrip(0xc000420140, 0xc000966200, 0x30, 0x1366f20, 0x162)         \/usr\/local\/go\/src\/net\/http\/transport.go:592 +0xacb net\/http.(*Transport).RoundTrip(0xc000420140, 0xc000966200, 0xc000420140, 0x0, 0x0)         \/usr\/local\/go\/src\/net\/http\/roundtrip.go:17 +0x35 net\/http.send(0xc000966200, 0x161eba0, 0xc000420140, 0x0, 0x0, 0x0, 0xc00000e050, 0x3, 0x1, 0x0)         \/usr\/local\/go\/src\/net\/http\/client.go:251 +0x454 net\/http.(*Client).send(0xc000438480, 0xc000966200, 0x0, 0x0, 0x0, 0xc00000e050, 0x0, 0x1, 0x10000168e)         \/usr\/local\/go\/src\/net\/http\/client.go:175 +0xff net\/http.(*Client).do(0xc000438480, 0xc000966200, 0x0, 0x0, 0x0)         \/usr\/local\/go\/src\/net\/http\/client.go:717 +0x45f net\/http.(*Client).Do(...)         \/usr\/local\/go\/src\/net\/http\/client.go:585 golang.org\/x\/net\/context\/ctxhttp.Do(0x163bd48, 0xc000044090, 0xc000438480, 0xc000966100, 0x0, 0x0, 0x0)         \/go\/pkg\/mod\/golang.org\/x\/net@v0.0.0-20211209124913-491a49abca63\/context\/ctxhttp\/ctxhttp.go:27 +0x10f github.com\/docker\/docker\/client.(*Client).doRequest(0xc0001a8200, 0x163bd48, 0xc000044090, 0xc000966100, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)         \/go\/pkg\/mod\/github.com\/moby\/moby@v0.0.0-20190408150954-50ebe4562dfc\/client\/request.go:132 +0xbe github.com\/docker\/docker\/client.(*Client).sendRequest(0xc0001a8200, 0x163bd48, 0xc000044090, 0x13d8643, 0x3, 0xc00079a720, 0x51, 0x0, 0x0, 0x0, ...)         \/go\/pkg\/mod\/github.com\/moby\/moby@v0.0.0-20190408150954-50ebe4562dfc\/client\/request.go:122 +0x156 github.com\/docker\/docker\/client.(*Client).get(...)         \/go\/pkg\/mod\/github.com\/moby\/moby@v0.0.0-20190408150954-50ebe4562dfc\/client\/request.go:37 github.com\/docker\/docker\/client.(*Client).ContainerInspect(0xc0001a8200, 0x163bd48, 0xc000044090, 0xc0006a01c0, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, ...)         \/go\/pkg\/mod\/github.com\/moby\/moby@v0.0.0-20190408150954-50ebe4562dfc\/client\/container_inspect.go:18 +0x128 github.com\/Netflix\/titus-executor\/executor\/runtime\/docker.(*DockerRuntime).Kill(0xc000215180, 0x163bdb8, 0xc000938600, 0x1, 0x0, 0x0)         \/var\/lib\/buildkite-agent\/builds\/ip-192-168-1-90-1\/netflix\/titus-executor\/executor\/runtime\/docker\/docker.go:2835 +0x310 github.com\/Netflix\/titus-executor\/executor\/runner.(*Runner).doShutdown(0xc000432dc0, 0x163bd10, 0xc000938390, 0x1, 0xc000b821e0, 0x1d, 0xc0005e4710)         \/var\/lib\/buildkite-agent\/builds\/ip-192-168-1-90-1\/netflix\/titus-executor\/executor\/runner\/runner.go:326 +0x4f4 github.com\/Netflix\/titus-executor\/executor\/runner.(*Runner).startRunner(0xc000432dc0, 0x163bdb8, 0xc00071e0c0, 0xc0a502e28c08b488, 0x24572b8, 0x1df5980)         \/var\/lib\/buildkite-agent\/builds\/ip-192-168-1-90-1\/netflix\/titus-executor\/executor\/runner\/runner.go:122 +0x391 created by github.com\/Netflix\/titus-executor\/executor\/runner.StartTaskWithRuntime         \/var\/lib\/buildkite-agent\/builds\/ip-192-168-1-90-1\/netflix\/titus-executor\/executor\/runner\/runner.go:81 +0x411<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0438\u0441 (management engine) \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 HTTP-\u0432\u044b\u0437\u043e\u0432 \u043a unix-\u0441\u043e\u043a\u0435\u0442\u0443 Docker API \u0441 \u043f\u0440\u043e\u0441\u044c\u0431\u043e\u0439 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0438\u0442\u044c (<code>kill<\/code>) \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440. \u041d\u0430\u0448\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u043d\u0430 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 SIGKILL. \u041d\u043e kill (<code>SIGKILL<\/code>) \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0444\u0430\u0442\u0430\u043b\u044c\u043d\u044b\u043c, \u0430 \u0437\u0434\u0435\u0441\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0447\u0442\u043e-\u0442\u043e \u0435\u0449\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c?<\/p>\n<pre><code>$ docker exec -it 6643cd073492 bash OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: process_linux.go:130: executing setns process caused: exit status 1: unknown<\/code><\/pre>\n<p>\u0421\u0442\u0440\u0430\u043d\u043d\u043e. \u0412\u0440\u043e\u0434\u0435 \u0431\u044b \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0435\u0449\u0435 \u0436\u0438\u0432, \u043d\u043e <code>setns(2)<\/code> \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u043e\u0439. \u0427\u0442\u043e \u0436\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442? \u0415\u0441\u043b\u0438 \u043c\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0434\u0435\u0440\u0435\u0432\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 <code>ps awwfux<\/code>, \u0442\u043e \u0443\u0432\u0438\u0434\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code>\\_ containerd-shim -namespace moby -workdir \/var\/lib\/containerd\/io.containerd.runtime.v1.linux\/moby\/6643cd073492ba9166100ed30dbe389ff1caef0dc3d35 |  \\_ [docker-init] |      \\_ [ndrive] &lt;defunct><\/code><\/pre>\n<p>\u0418\u0442\u0430\u043a, \u043f\u0440\u043e\u0446\u0435\u0441\u0441 init \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432\u0441\u0435 \u0435\u0449\u0435 \u0436\u0438\u0432, \u043d\u043e \u0443 \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u044c \u043e\u0434\u0438\u043d \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0439 \u0437\u043e\u043c\u0431\u0438. \u0427\u0435\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043d\u044f\u0442 init \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430?<\/p>\n<pre><code># cat \/proc\/1528591\/stack [&lt;0>] do_wait+0x156\/0x2f0 [&lt;0>] kernel_wait4+0x8d\/0x140 [&lt;0>] zap_pid_ns_processes+0x104\/0x180 [&lt;0>] do_exit+0xa41\/0xb80 [&lt;0>] do_group_exit+0x3a\/0xa0 [&lt;0>] __x64_sys_exit_group+0x14\/0x20 [&lt;0>] do_syscall_64+0x37\/0xb0 [&lt;0>] entry_SYSCALL_64_after_hwframe+0x44\/0xae<\/code><\/pre>\n<p>\u041e\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f, \u043d\u043e, \u043f\u043e\u0445\u043e\u0436\u0435, \u0437\u0430\u0432\u0438\u0441, \u0438 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 ndrive \u2014 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 Z (&#171;\u0437\u043e\u043c\u0431\u0438&#187;). \u0417\u043e\u043c\u0431\u0438 \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0438\u0441\u044c \u0438 \u043e\u0436\u0438\u0434\u0430\u044e\u0442, \u043a\u043e\u0433\u0434\u0430 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0438\u0445 \u043a\u043e\u0434 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 <code>wait()<\/code>. \u041d\u043e \u043a\u0430\u043a \u0436\u0435 \u044f\u0434\u0440\u043e \u043c\u043e\u0433\u043b\u043e \u0437\u0430\u0441\u0442\u0440\u044f\u0442\u044c \u0432 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0438 \u0437\u043e\u043c\u0431\u0438?<\/p>\n<pre><code># ls \/proc\/1544450\/task 1544450  1544574<\/code><\/pre>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e. \u0412 \u0433\u0440\u0443\u043f\u043f\u0435 \u043f\u043e\u0442\u043e\u043a\u0430 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043f\u043e\u0442\u043e\u043a\u0430. \u041e\u0434\u0438\u043d \u0438\u0437 \u043d\u0438\u0445 \u0437\u043e\u043c\u0431\u0438, \u0430 \u0434\u0440\u0443\u0433\u043e\u0439, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043d\u0435\u0442:<\/p>\n<pre><code># cat \/proc\/1544574\/stack [&lt;0>] request_wait_answer+0x12f\/0x210 [&lt;0>] fuse_simple_request+0x109\/0x2c0 [&lt;0>] fuse_flush+0x16f\/0x1b0 [&lt;0>] filp_close+0x27\/0x70 [&lt;0>] put_files_struct+0x6b\/0xc0 [&lt;0>] do_exit+0x360\/0xb80 [&lt;0>] do_group_exit+0x3a\/0xa0 [&lt;0>] get_signal+0x140\/0x870 [&lt;0>] arch_do_signal_or_restart+0xae\/0x7c0 [&lt;0>] exit_to_user_mode_prepare+0x10f\/0x1c0 [&lt;0>] syscall_exit_to_user_mode+0x26\/0x40 [&lt;0>] do_syscall_64+0x46\/0xb0 [&lt;0>] entry_SYSCALL_64_after_hwframe+0x44\/0xae<\/code><\/pre>\n<p>\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0432\u0442\u043e\u0440\u043e\u0439 \u2014 \u043d\u0435 \u0437\u043e\u043c\u0431\u0438. \u041d\u043e \u043e\u043d \u0438\u0437\u043e \u0432\u0441\u0435\u0445 \u0441\u0438\u043b \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0438\u043c \u0441\u0442\u0430\u0442\u044c, \u0438 \u043f\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435, \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 FUSE. \u0427\u0442\u043e\u0431\u044b \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c \u043f\u0440\u0438\u0447\u0438\u043d\u0443, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u043a\u043e\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/git.kernel.org\/pub\/scm\/linux\/kernel\/git\/torvalds\/linux.git\/tree\/kernel\/pid_namespace.c?h=v5.19#n166\"><u>zap_pid_ns_processes()<\/u><\/a>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0438 \u0437\u0430\u0441\u0442\u0440\u044f\u043b\u0438:<\/p>\n<pre><code>\/*  * Reap the EXIT_ZOMBIE children we had before we ignored SIGCHLD.  * kernel_wait4() will also block until our children traced from the  * parent namespace are detached and become EXIT_DEAD.  *\/ do {         clear_thread_flag(TIF_SIGPENDING);         rc = kernel_wait4(-1, NULL, __WALL, NULL); } while (rc != -ECHILD);<\/code><\/pre>\n<p>\u041d\u043e \u043f\u0435\u0440\u0435\u0434 \u044d\u0442\u0438\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f:<\/p>\n<pre><code>\/* Don't allow any more processes into the pid namespace *\/ disable_pid_allocation(pid_ns);<\/code><\/pre>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u043a\u0435\u0440 \u0438 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c <code>setns()<\/code>, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0435\u043d (namespace) \u2014 \u0437\u043e\u043c\u0431\u0438. \u0425\u043e\u0440\u043e\u0448\u043e, \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c <code>setns(2)<\/code>, \u043d\u043e \u043f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u0437\u0430\u0441\u0442\u0440\u044f\u043b\u0438 \u0432 <code>kernel_wait4()<\/code>? \u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u043f\u0440\u0438\u0447\u0438\u043d\u0443, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u043b \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0442\u043e\u043a \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <a href=\"https:\/\/git.kernel.org\/pub\/scm\/linux\/kernel\/git\/torvalds\/linux.git\/tree\/fs\/fuse\/dev.c?h=v5.19#n407\"><u>request_wait_answer()<\/u><\/a> FUSE:<\/p>\n<pre><code>\/*  * Either request is already in userspace, or it was forced.  * Wait it out.  *\/ wait_event(req->waitq, test_bit(FR_FINISHED, &amp;req->flags));<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0436\u0434\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f (\u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u0432\u0435\u0442\u0430 \u0438\u0437 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u043e\u0431 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441\u0431\u0440\u043e\u0441\u0430 \u043d\u0430 \u0434\u0438\u0441\u043a (flush) \u043e\u0442 FUSE). \u041d\u043e <code>zap_pid_ns_processes()<\/code> \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b <code>SIGKILL<\/code>! \u0421\u0438\u0433\u043d\u0430\u043b <code>SIGKILL<\/code> \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0444\u0430\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u0434\u043b\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u0415\u0441\u043b\u0438 \u043c\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043e\u0436\u0438\u0434\u0430\u044e\u0449\u0438\u0439 (pending) \u0441\u0438\u0433\u043d\u0430\u043b <code>SIGKILL<\/code>:<\/p>\n<pre><code># grep Pnd \/proc\/1544574\/status SigPnd: 0000000000000000 ShdPnd: 0000000000000100<\/code><\/pre>\n<p>\u0412 ShdPnd \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c 0x100 (\u0442. \u0435. \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d 9-\u0439 \u0431\u0438\u0442), \u0447\u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 SIGKILL.\u00a0<\/p>\n<p>\u041e\u0436\u0438\u0434\u0430\u044e\u0449\u0438\u0435 (pending) \u0441\u0438\u0433\u043d\u0430\u043b\u044b \u2014 \u044d\u0442\u043e \u0441\u0438\u0433\u043d\u0430\u043b\u044b, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u044f\u0434\u0440\u043e\u043c, \u043d\u043e \u0435\u0449\u0435 \u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e. \u0421\u0438\u0433\u043d\u0430\u043b\u044b \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0432\u0445\u043e\u0434\u0435 \u0438\u043b\u0438 \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u0438\u043b\u0438 \u043f\u0440\u0438 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439. \u0415\u0441\u043b\u0438 \u044f\u0434\u0440\u043e \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0447\u0435\u043c-\u0442\u043e \u0437\u0430\u043d\u044f\u0442\u043e, \u0441\u0438\u0433\u043d\u0430\u043b \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0438 (pending). \u0422\u0430\u043a\u0436\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0437\u0430\u0434\u0430\u0447\u0435\u0439, \u0438 \u043e\u043d\u0438 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b. \u0417\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u044b \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043d\u0430\u0431\u043e\u0440\u0430\u0445. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 man 7 signal \u0441\u043a\u0430\u0437\u0430\u043d\u043e: &#171;\u0421\u0438\u0433\u043d\u0430\u043b\u044b <code>SIGKILL<\/code> \u0438 <code>SIGSTOP<\/code> \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u0439\u043c\u0430\u043d\u044b, \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0438\u043b\u0438 \u043f\u0440\u043e\u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b&#187;. \u041d\u043e \u0437\u0434\u0435\u0441\u044c \u044f\u0434\u0440\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043e\u0436\u0438\u0434\u0430\u044e\u0449\u0438\u0439 \u0441\u0438\u0433\u043d\u0430\u043b <code>SIGKILL<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0434\u0430\u0436\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438!<\/p>\n<h2>\u041b\u043e\u0436\u043d\u044b\u0439 \u0441\u043b\u0435\u0434: \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441\u0438\u0433\u043d\u0430\u043b\u044b?<\/h2>\n<p>\u0412\u0441\u0435 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0441\u0442\u0440\u0430\u043d\u043d\u043e, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e wait (\u0442. \u0435. <code>include\/linux\/wait.h<\/code>) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u044f\u0434\u0440\u0435 \u043f\u043e\u0432\u0441\u044e\u0434\u0443: \u0441\u0435\u043c\u0430\u0444\u043e\u0440\u044b, \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f, \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0438 \u0442. \u0434. \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u043e\u043d \u0437\u043d\u0430\u0435\u0442 \u043e <code>SIGKILL<\/code>. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0436\u0435 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 <code>wait_event()<\/code>? \u041f\u043e\u043a\u043e\u043f\u0430\u0432\u0448\u0438\u0441\u044c \u0432 \u043a\u043e\u0434\u0435, \u044f \u043d\u0430\u0448\u0435\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"python\">#define ___wait_event(wq_head, condition, state, exclusive, ret, cmd)           \\ ({                                                                              \\         __label__ __out;                                                        \\         struct wait_queue_entry __wq_entry;                                     \\         long __ret = ret;       \/* explicit shadow *\/                           \\                                                                                 \\         init_wait_entry(&amp;__wq_entry, exclusive ? WQ_FLAG_EXCLUSIVE : 0);        \\         for (;;) {                                                              \\                 long __int = prepare_to_wait_event(&amp;wq_head, &amp;__wq_entry, state);\\                                                                                 \\                 if (condition)                                                  \\                         break;                                                  \\                                                                                 \\                 if (___wait_is_interruptible(state) &amp;&amp; __int) {                 \\                         __ret = __int;                                          \\                         goto __out;                                             \\                 }                                                               \\                                                                                 \\                 cmd;    <\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-362604","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/362604","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=362604"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/362604\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=362604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=362604"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=362604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}