{"id":4595,"date":"2021-05-16T09:38:17","date_gmt":"2021-05-16T00:38:17","guid":{"rendered":"https:\/\/now0930.pe.kr\/wordpress\/?p=4595"},"modified":"2021-05-16T09:38:48","modified_gmt":"2021-05-16T00:38:48","slug":"4%ec%9e%a5-process-%eb%a1%9c%ea%b7%b8-%ed%99%95%ec%9d%b8","status":"publish","type":"post","link":"https:\/\/now0930.pe.kr\/wordpress\/4%ec%9e%a5-process-%eb%a1%9c%ea%b7%b8-%ed%99%95%ec%9d%b8\/","title":{"rendered":"4\uc7a5 process \ub85c\uadf8 \ud655\uc778"},"content":{"rendered":"\n<p>\ucc45 &#8220;\ub514\ubc84\uae45\uc744 \ud1b5\ud574.. \ub9ac\ub205\uc2a4 \ucee4\ub110&#8221; 148 \ud398\uc774\uc9c0 \uc608\uc81c\ub97c \uc2e4\ud589\ud588\ub2e4. \uc798 \ub530\ub77c \ud574\uc57c \ud55c\ub2e4. trace \ub97c \uc8fd\uc774\uace0 \uc0b4\ub9ac\ub294 \uacfc\uc815\uc5d0 \uc624\ud0c0\ub85c \uc0b4\uc9dd \ud5f7\uac08\ub838\ub2e4. \ucc45\uc740 \/sys\/kernel\/debug\/tracing\/trace\ub97c \ubcf5\uc0ac\ud558\ub294 script\ub97c \ub9cc\ub4e4\uc5c8\ub2e4. \ub514\ubc84\uadf8 \uba54\uc138\uc9c0\ub97c \ubcf4\ub824\uba74 \uc774\ubca4\ud2b8 \ubc1c\uc0dd \ud6c4 \ubc14\ub85c \ubcf5\uc0ac\ud574\uc57c\uc9c0, \ud0c0\uc774\ud551\ud55c\ub2e4\uace0 \ub2a6\uac8c \ud558\uba74 \uc774\uc804 \uae30\ub85d\uc744 \uc2dc\uc2a4\ud15c\uc774 \uc9c0\uc6cc\ubc84\ub9b0\ub2e4. trace \ud30c\uc77c\uc744 \uc9c0\uc6b8 \uc218 \uc5c6\ub2e4. \ucd08\uae30\ud654 \ud558\ub824\uba74 tracing_on\uc5d0 0\uc744 \ub2e4\uc2dc \uc368\uc918\uc57c \ud55c\ub2e4. \uc544\ub798\uc640 \uac19\uc740 \uae30\ub85d\uc744 \ubf51\uc544 \ub0c8\ub2e4. \ub2e4 \uc801\uc744 \uc218 \uc5c6\uc5b4, \uc911\uc694\ud55c \ubd80\ubd84\ub9cc \ucd94\ucd9c\ud588\ub2e4. \uc0dd\uac01\uc774 \ub9de\ub294\uc9c0 \ubaa8\ub974\uaca0\ub2e4.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">5825  => sys_clone+0x18\/0x3c\n5826  => ret_fast_syscall+0x0\/0x28\n5827  => 0xbed826b0\n5828             bash-1921  [002] .... 32848.024289: _do_fork+0x14\/0x41c &lt;-sys_clone+0x34\/0x3c\n5829             bash-1921  [002] .... 32848.024299: &lt;stack trace>\n5830  => _do_fork+0x18\/0x41c\n5831  => sys_clone+0x34\/0x3c\n5832  => ret_fast_syscall+0x0\/0x28\n5833  => 0xbed826b0\n5834           &lt;idle>-0     [000] dns. 32848.024300: sched_wakeup: comm=kworker\/u8:3 pid=2958 prio=120 target_cpu=000\n5835             bash-1921  [002] .... 32848.024301: copy_process.part.0+0x14\/0x1ac4 &lt;-_do_fork+0xc4\/0x41c\n5836           &lt;idle>-0     [000] d... 32848.024307: sched_switch: prev_comm=swapper\/0 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=kworker\/u8:3 next_pid=2958 next_prio=120\n5837             bash-1921  [002] .... 32848.024310: &lt;stack trace>\n5838  => copy_process.part.0+0x18\/0x1ac4\n5839  => _do_fork+0xc4\/0x41c\n5840  => sys_clone+0x34\/0x3c\n5841  => ret_fast_syscall+0x0\/0x28\n5842  => 0xbed826b0\n5843     kworker\/u8:3-2958  [000] d... 32848.024324: sched_switch: prev_comm=kworker\/u8:3 prev_pid=2958 prev_prio=120 prev_state=I ==> next_comm=swapper\/0 next_pid=0 next_prio=120\n5844             bash-1921  [002] .... 32848.024940: sched_process_fork: comm=bash pid=1921 child_comm=bash child_pid=3043\n5845           &lt;idle>-0     [003] d... 32848.024981: sched_switch: prev_comm=swapper\/3 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=bash next_pid=3043 next_prio=120\n5846    raspbian_proc-3043  [003] d... 32848.025568: sched_switch: prev_comm=bash prev_pid=3043 prev_prio=120 prev_state=S ==> next_comm=swapper\/3 next_pid=0 next_prio=120\n5847           &lt;idle>-0     [003] dnh. 32848.025595: sched_wakeup: comm=bash pid=3043 prio=120 target_cpu=003\n5848           &lt;idle>-0     [003] d... 32848.025608: sched_switch: prev_comm=swapper\/3 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=bash next_pid=3043 next_prio=120\n5849             bash-1921  [002] d... 32848.025727: sched_switch: prev_comm=bash prev_pid=1921 prev_prio=120 prev_state=S ==> next_comm=swapper\/2 next_pid=0 next_prio=120\n5850           &lt;idle>-0     [000] dnh. 32848.026664: sched_wakeup: comm=irq\/36-mmc1 pid=82 prio=49 target_cpu=000\n5851           &lt;idle>-0     [000] d... 32848.026684: sched_switch: prev_comm=swapper\/0 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=irq\/36-mmc1 next_pid=82 next_prio=49\n5852      irq\/36-mmc1-82    [000] d.s. 32848.026720: sched_wakeup: comm=irq\/36-mmc1 pid=82 prio=49 target_cpu=000\n5853      irq\/36-mmc1-82    [000] d.s. 32848.026763: sched_wakeup: comm=irq\/36-mmc1 pid=82 prio=49 target_cpu=000\n5854      irq\/36-mmc1-82    [000] d.s. 32848.026806: sched_wakeup: comm=irq\/36-mmc1 pid=82 prio=49 target_cpu=000\n5855      irq\/36-mmc1-82    [000] d... 32848.026823: sched_wakeup: comm=kworker\/u8:3 pid=2958 prio=120 target_cpu=000\n5856      irq\/36-mmc1-82    [000] d... 32848.026840: sched_switch: prev_comm=irq\/36-mmc1 prev_pid=82 prev_prio=49 prev_state=S ==> next_comm=kworker\/u8:3 next_pid=2958 next_prio=120\n5857     kworker\/u8:3-2958  [000] d.s. 32848.026900: sched_wakeup: comm=kworker\/u8:3 pid=2958 prio=120 target_cpu=000\n5858     kworker\/u8:3-2958  [000] d.s. 32848.026946: sched_wakeup: comm=kworker\/u8:3 pid=2958 prio=120 target_cpu=000\n...\n8445     kworker\/u8:0-2918  [001] d... 32866.110752: sched_switch: prev_comm=kworker\/u8:0 prev_pid=2918 prev_prio=120 prev_state=I ==> next_comm=bash next_pid=3013 next_prio=120\n8446             bash-3013  [001] d... 32866.110848: signal_generate: sig=9 errno=0 code=0 comm=raspbian_proc pid=3043 grp=1 res=0\n8447           &lt;idle>-0     [003] dnh. 32866.110856: sched_wakeup: comm=raspbian_proc pid=3043 prio=120 target_cpu=003\n8448           &lt;idle>-0     [003] d... 32866.110870: sched_switch: prev_comm=swapper\/3 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=raspbian_proc next_pid=3043 next_prio=120\n8449    raspbian_proc-3043  [003] d... 32866.110880: signal_deliver: sig=9 errno=0 code=0 sa_handler=0 sa_flags=0\n8450    raspbian_proc-3043  [003] .... 32866.110883: do_exit+0x14\/0xbd4 &lt;-do_group_exit+0x50\/0xe8\n8451    raspbian_proc-3043  [003] .... 32866.110909: &lt;stack trace>\n8452  => do_exit+0x18\/0xbd4\n8453  => do_group_exit+0x50\/0xe8\n8454  => get_signal+0x160\/0x85c\n8455  => do_signal+0x360\/0x4a4\n8456  => do_work_pending+0xd4\/0xec\n8457  => slow_work_pending+0xc\/0x20\n8458  => 0xb6e1969c\n8459    raspbian_proc-3043  [003] .... 32866.111230: sched_process_exit: comm=raspbian_proc pid=3043 prio=120\n8460    raspbian_proc-3043  [003] d... 32866.111296: signal_generate: sig=17 errno=0 code=2 comm=bash pid=1921 grp=1 res=0\n8461           &lt;idle>-0     [002] dnh. 32866.111311: sched_wakeup: comm=bash pid=1921 prio=120 target_cpu=002\n8462             bash-3013  [001] dn.. 32866.111313: sched_wakeup: comm=kworker\/u8:0 pid=2918 prio=120 target_cpu=001\n8463           &lt;idle>-0     [002] d... 32866.111327: sched_switch: prev_comm=swapper\/2 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=bash next_pid=1921 next_prio=120\n8464    raspbian_proc-3043  [003] d... 32866.111330: sched_switch: prev_comm=raspbian_proc prev_pid=3043 prev_prio=120 prev_state=Z ==> next_comm=kworker\/u8:0 next_pid=2918 next_prio=120\n8465           &lt;idle>-0     [000] dnh. 32866.111359: sched_wakeup: comm=sshd pid=3010 prio=120 target_cpu=000\n8466             bash-3013  [001] d... 32866.111362: sched_switch: prev_comm=bash prev_pid=3013 prev_prio=120 prev_state=S ==> next_comm=swapper\/1 next_pid=0 next_prio=120\n8467     kworker\/u8:0-2918  [003] d... 32866.111364: sched_switch: prev_comm=kworker\/u8:0 prev_pid=2918 prev_prio=120 prev_state=I ==> next_comm=swapper\/3 next_pid=0 next_prio=120\n8468           &lt;idle>-0     [000] d... 32866.111374: sched_switch: prev_comm=swapper\/0 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=sshd next_pid=3010 next_prio=120\n8469           &lt;idle>-0     [003] dnh. 32866.111531: sched_wakeup: comm=kworker\/u8:0 pid=2918 prio=120 target_cpu=003\n8470           &lt;idle>-0     [003] d... 32866.111539: sched_switch: prev_comm=swapper\/3 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=kworker\/u8:0 next_pid=2918 next_prio=120\n8471             sshd-3010  [000] d... 32866.111572: sched_switch: prev_comm=sshd prev_pid=3010 prev_prio=120 prev_state=S ==> next_comm=swapper\/0 next_pid=0 next_prio=120\n<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>bash pid\ub294 1921\uc774\ub2e4.<\/li><li>5844\ud589\uc5d0\uc11c child_pid 3043\uc73c\ub85c \uc790\uc2dd \ud504\ub85c\uc138\uc2a4\ub97c \ub9cc\ub4e4\uc5c8\ub2e4.<\/li><li>5846\ud589\uc5d0\uc11c raspbian_proce\ub97c \ubcfc \uc218 \uc788\ub2e4.<\/li><li>\uc774 \uc804\uc5d0 5836\ud589\uc5d0\uc11c \ub2e4\uc74c \ud504\ub85c\uc138\uc2a4 id 2958\uc744 \uac00\uc9c0\uace0 \uac70\uafb8\ub85c sys_clone -&gt; _do-fork -&gt; copy_process\ub97c \uc2e4\ud589\ud588\ub2e4.<\/li><li>5836 \ud589\uc5d0\uc11c next pid 2958(5857\ud589)\ub85c \ub118\uc5b4\uac00\uc57c \ud558\ub294\ub370 fork \ud558\ub290\ub77c \ub2e4\uc74c \ud589\uc744 \uc2e4\ud589\ud588\ub2e4.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"linux-process-states\"><a href=\"https:\/\/idea.popcount.org\/2012-12-11-linux-process-states\/\">Linux process states<\/a><\/h2>\n\n\n\n<p>As in every Unix flavour, in Linux a process can be in a number of states. It&#8217;s easiest to observe it in tools like <code>ps<\/code> or <code>top<\/code>: it&#8217;s usually in the column named <code>S<\/code>. The documentation of <code>ps<\/code> describes the possible values:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">PROCESS STATE CODES\n   R  running or runnable (on run queue)\n   D  uninterruptible sleep (usually IO)\n   S  interruptible sleep (waiting for an event to complete)\n   Z  defunct\/zombie, terminated but not reaped by its parent\n   T  stopped, either by a job control signal or because\n      it is being traced\n   [...]\n<\/pre>\n\n\n\n<p>A process starts its life in an <code>R<\/code> &#8220;running&#8221; state and finishes after its parent reaps it from the <code>Z<\/code> &#8220;zombie&#8221; state.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/idea.popcount.org\/2012-12-11-linux-process-states\/76a49594323247f21c9b3a69945445ee.svg\" alt=\"\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>8449\ud589\uc5d0\uc11c signo 9\ubc88\uc744 \ubc1b\uc558\ub2e4.<\/li><li>\uc2dc\uadf8\ub110 9\ubc88\uc744 \ubc1b\uc544 \uc2dc\uadf8\ub110 17 \ubc1c\uc0dd \uc2dc\ucf30\ub2e4.<\/li><li>slow_work_pending -> do_work_pending -> do_signal -> get_signal -> do_group_exit -> do_exit \uc21c\uc73c\ub85c \uc2e4\ud589\ud55c\ub2e4.<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\ucc45 &#8220;\ub514\ubc84\uae45\uc744 \ud1b5\ud574.. \ub9ac\ub205\uc2a4 \ucee4\ub110&#8221; 148 \ud398\uc774\uc9c0 \uc608\uc81c\ub97c \uc2e4\ud589\ud588\ub2e4. \uc798 \ub530\ub77c \ud574\uc57c \ud55c\ub2e4. trace \ub97c \uc8fd\uc774\uace0 \uc0b4\ub9ac\ub294 \uacfc\uc815\uc5d0 \uc624\ud0c0\ub85c \uc0b4\uc9dd [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[12],"tags":[911,53,798,912],"class_list":["post-4595","post","type-post","status-publish","format-standard","hentry","category-12","tag-kernel","tag-linux","tag-raspberry","tag-912"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/posts\/4595","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/comments?post=4595"}],"version-history":[{"count":6,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/posts\/4595\/revisions"}],"predecessor-version":[{"id":4604,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/posts\/4595\/revisions\/4604"}],"wp:attachment":[{"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/media?parent=4595"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/categories?post=4595"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/tags?post=4595"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}