Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

improve kernel boot time #548

Open
devimc opened this issue Sep 12, 2017 · 0 comments
Open

improve kernel boot time #548

devimc opened this issue Sep 12, 2017 · 0 comments

Comments

@devimc
Copy link

devimc commented Sep 12, 2017

applying this patch in the clear container kernel we could have a better boot time

diff --git a/config b/config
index 8c45031..6e0b833 100644
--- a/config
+++ b/config
@@ -1,6 +1,6 @@
 #
 # Automatically generated file; DO NOT EDIT.
-# Linux/x86 4.9.4 Kernel Configuration
+# Linux/x86 4.9.35 Kernel Configuration
 #
 CONFIG_64BIT=y
 CONFIG_X86_64=y
@@ -105,10 +105,8 @@ CONFIG_GENERIC_CMOS_UPDATE=y
 CONFIG_TICK_ONESHOT=y
 CONFIG_NO_HZ_COMMON=y
 # CONFIG_HZ_PERIODIC is not set
-# CONFIG_NO_HZ_IDLE is not set
-CONFIG_NO_HZ_FULL=y
-# CONFIG_NO_HZ_FULL_ALL is not set
-# CONFIG_NO_HZ_FULL_SYSIDLE is not set
+CONFIG_NO_HZ_IDLE=y
+# CONFIG_NO_HZ_FULL is not set
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
 
@@ -116,6 +114,7 @@ CONFIG_HIGH_RES_TIMERS=y
 # CPU/Task time and stats accounting
 #
 CONFIG_VIRT_CPU_ACCOUNTING=y
+# CONFIG_TICK_CPU_ACCOUNTING is not set
 CONFIG_VIRT_CPU_ACCOUNTING_GEN=y
 # CONFIG_IRQ_TIME_ACCOUNTING is not set
 CONFIG_BSD_PROCESS_ACCT=y
@@ -136,10 +135,9 @@ CONFIG_RCU_STALL_COMMON=y
 CONFIG_CONTEXT_TRACKING=y
 # CONFIG_CONTEXT_TRACKING_FORCE is not set
 # CONFIG_TREE_RCU_TRACE is not set
-CONFIG_RCU_NOCB_CPU=y
 # CONFIG_RCU_NOCB_CPU_NONE is not set
 # CONFIG_RCU_NOCB_CPU_ZERO is not set
-CONFIG_RCU_NOCB_CPU_ALL=y
+# CONFIG_RCU_NOCB_CPU_ALL is not set
 # CONFIG_RCU_EXPEDITE_BOOT is not set
 # CONFIG_BUILD_BIN2C is not set
 # CONFIG_IKCONFIG is not set

also we will see a reduction in the number of process running in the VM

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.4  0.0   8696   988 ?        Ss   14:52   0:00 /usr/lib/systemd/systemd
root         2  0.0  0.0      0     0 ?        S    14:52   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S    14:52   0:00 [ksoftirqd/0]
root         4  0.0  0.0      0     0 ?        S    14:52   0:00 [kworker/0:0]
root         5  0.0  0.0      0     0 ?        S<   14:52   0:00 [kworker/0:0H]
root         6  0.0  0.0      0     0 ?        S    14:52   0:00 [kworker/u8:0]
root         7  0.0  0.0      0     0 ?        S    14:52   0:00 [rcu_sched]
root         8  0.0  0.0      0     0 ?        S    14:52   0:00 [rcu_bh]
root         9  0.0  0.0      0     0 ?        S    14:52   0:00 [migration/0]
root        10  0.0  0.0      0     0 ?        S<   14:52   0:00 [lru-add-drain]
root        11  0.0  0.0      0     0 ?        S    14:52   0:00 [cpuhp/0]
root        12  0.0  0.0      0     0 ?        S    14:52   0:00 [cpuhp/1]
root        13  0.0  0.0      0     0 ?        S    14:52   0:00 [migration/1]
root        14  0.0  0.0      0     0 ?        S    14:52   0:00 [ksoftirqd/1]
root        15  0.0  0.0      0     0 ?        S    14:52   0:00 [kworker/1:0]
root        16  0.0  0.0      0     0 ?        S<   14:52   0:00 [kworker/1:0H]
root        17  0.0  0.0      0     0 ?        S    14:52   0:00 [cpuhp/2]
root        18  0.0  0.0      0     0 ?        S    14:52   0:00 [migration/2]
root        19  0.0  0.0      0     0 ?        S    14:52   0:00 [ksoftirqd/2]
root        20  0.0  0.0      0     0 ?        S    14:52   0:00 [kworker/2:0]
root        21  0.0  0.0      0     0 ?        S<   14:52   0:00 [kworker/2:0H]
root        22  0.0  0.0      0     0 ?        S    14:52   0:00 [cpuhp/3]
root        23  0.0  0.0      0     0 ?        S    14:52   0:00 [migration/3]
root        24  0.0  0.0      0     0 ?        S    14:52   0:00 [ksoftirqd/3]
root        25  0.0  0.0      0     0 ?        S    14:52   0:00 [kworker/3:0]
root        26  0.0  0.0      0     0 ?        S<   14:52   0:00 [kworker/3:0H]
root        27  0.0  0.0      0     0 ?        S    14:52   0:00 [kdevtmpfs]
root        28  0.0  0.0      0     0 ?        S<   14:52   0:00 [netns]
root        29  0.0  0.0      0     0 ?        S    14:52   0:00 [oom_reaper]
root        30  0.0  0.0      0     0 ?        S<   14:52   0:00 [writeback]
root        31  0.0  0.0      0     0 ?        S    14:52   0:00 [kcompactd0]
root        32  0.0  0.0      0     0 ?        SN   14:52   0:00 [ksmd]
root        33  0.0  0.0      0     0 ?        S    14:52   0:00 [kworker/0:1]
root        34  0.0  0.0      0     0 ?        S<   14:52   0:00 [crypto]
root        35  0.0  0.0      0     0 ?        S<   14:52   0:00 [bioset]
root        36  0.0  0.0      0     0 ?        S<   14:52   0:00 [kblockd]
root        39  0.0  0.0      0     0 ?        S    14:52   0:00 [kswapd0]
root        40  0.0  0.0      0     0 ?        S<   14:52   0:00 [vmstat]
root        41  0.0  0.0      0     0 ?        S<   14:52   0:00 [bioset]
root        42  0.0  0.0      0     0 ?        S<   14:52   0:00 [xfsalloc]
root        43  0.0  0.0      0     0 ?        S<   14:52   0:00 [xfs_mru_cache]
root        65  0.0  0.0      0     0 ?        S<   14:52   0:00 [nfit]
root        66  0.0  0.0      0     0 ?        S    14:52   0:00 [kworker/u8:1]
root        67  0.0  0.0      0     0 ?        S    14:52   0:00 [kworker/u8:2]
root        68  0.0  0.0      0     0 ?        S<   14:52   0:00 [bioset]
root        69  0.0  0.0      0     0 ?        S    14:52   0:00 [khvcd]
root        70  0.0  0.0      0     0 ?        S<   14:52   0:00 [bioset]
root        71  0.0  0.0      0     0 ?        S<   14:52   0:00 [bioset]
root        72  0.0  0.0      0     0 ?        S<   14:52   0:00 [bioset]
root        73  0.0  0.0      0     0 ?        S<   14:52   0:00 [bioset]
root        74  0.0  0.0      0     0 ?        S<   14:52   0:00 [bioset]
root        75  0.0  0.0      0     0 ?        S<   14:52   0:00 [bioset]
root        76  0.0  0.0      0     0 ?        S<   14:52   0:00 [bioset]
root        77  0.0  0.0      0     0 ?        S    14:52   0:00 [kworker/0:2]
root        78  0.0  0.0      0     0 ?        S<   14:52   0:00 [bioset]
root        79  0.0  0.0      0     0 ?        S<   14:52   0:00 [bioset]
root        80  0.0  0.0      0     0 ?        S<   14:52   0:00 [bioset]
root        81  0.0  0.0      0     0 ?        S<   14:52   0:00 [bioset]
root        82  0.0  0.0      0     0 ?        S<   14:52   0:00 [bioset]
root        83  0.0  0.0      0     0 ?        S<   14:52   0:00 [bioset]
root        84  0.0  0.0      0     0 ?        S<   14:52   0:00 [bioset]
root        85  0.0  0.0      0     0 ?        S<   14:52   0:00 [bioset]
root        86  0.0  0.0      0     0 ?        S<   14:52   0:00 [bioset]
root        87  0.0  0.0      0     0 ?        S<   14:52   0:00 [bioset]
root        88  0.0  0.0      0     0 ?        S<   14:52   0:00 [bioset]
root        89  0.0  0.0      0     0 ?        S<   14:52   0:00 [bioset]
root        90  0.0  0.0      0     0 ?        S<   14:52   0:00 [bioset]
root        91  0.0  0.0      0     0 ?        S<   14:52   0:00 [bioset]
root        92  0.0  0.0      0     0 ?        S<   14:52   0:00 [bioset]
root        93  0.0  0.0      0     0 ?        S<   14:52   0:00 [bioset]
root        94  0.0  0.0      0     0 ?        S<   14:52   0:00 [bioset]
root        95  0.0  0.0      0     0 ?        S<   14:52   0:00 [ixgbe]
root        96  0.0  0.0      0     0 ?        S<   14:52   0:00 [ixgbevf]
root        97  0.0  0.0      0     0 ?        S<   14:52   0:00 [dm_bufio_cache]
root        98  0.0  0.0      0     0 ?        S<   14:52   0:00 [ipv6_addrconf]
root        99  0.0  0.0      0     0 ?        S    14:52   0:00 [jbd2/pmem0p1-8]
root       100  0.0  0.0      0     0 ?        S<   14:52   0:00 [ext4-rsv-conver]
root       101  0.0  0.0      0     0 ?        S    14:52   0:00 [kworker/1:1]
root       107  0.0  0.0  19196   304 ?        Ss   14:52   0:00 /usr/lib/systemd/systemd-journald
root       114  0.0  0.0      0     0 ?        S    14:52   0:00 [kworker/2:1]
root       119  0.0  0.0   5908   500 ?        Ss   14:52   0:00 /usr/lib/systemd/systemd-udevd --children-max=16
root       140  0.0  0.0      0     0 ?        S    14:52   0:00 [kworker/3:1]
systemd+   141  0.0  0.0  81292   364 ?        Ssl  14:52   0:00 /usr/lib/systemd/systemd-timesyncd
root       163  0.0  0.1 678984  2460 ?        Ssl  14:52   0:00 /usr/bin/cc-agent
root       164  0.0  0.0   5400   460 ?        Ss   14:52   0:00 /usr/bin/bash
message+   168  0.0  0.0   4048   336 ?        Ss   14:52   0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
root       182  0.0  0.0   1092     4 ?        Ss   14:52   0:00 ./pause
root       193  0.0  0.0   1220   264 ?        Ss+  14:52   0:00 sh
root       201  0.0  0.0   5548   228 ?        R+   14:53   0:00 ps aux

VS

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0   8720  1052 ?        Ss   14:55   0:00 /usr/lib/systemd/systemd
root         2  0.0  0.0      0     0 ?        S    14:55   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S    14:55   0:00 [ksoftirqd/0]
root         5  0.0  0.0      0     0 ?        S<   14:55   0:00 [kworker/0:0H]
root         6  0.0  0.0      0     0 ?        S    14:55   0:00 [kworker/u8:0]
root         7  0.0  0.0      0     0 ?        S    14:55   0:00 [rcu_sched]
root         8  0.0  0.0      0     0 ?        S    14:55   0:00 [rcu_bh]
root         9  0.0  0.0      0     0 ?        S    14:55   0:00 [rcuos/0]
root        10  0.0  0.0      0     0 ?        S    14:55   0:00 [rcuob/0]
root        11  0.0  0.0      0     0 ?        S    14:55   0:00 [migration/0]
root        12  0.0  0.0      0     0 ?        S<   14:55   0:00 [lru-add-drain]
root        13  0.0  0.0      0     0 ?        S    14:55   0:00 [cpuhp/0]
root        14  0.0  0.0      0     0 ?        S    14:55   0:00 [cpuhp/1]
root        15  0.0  0.0      0     0 ?        S    14:55   0:00 [migration/1]
root        16  0.0  0.0      0     0 ?        S    14:55   0:00 [ksoftirqd/1]
root        17  0.0  0.0      0     0 ?        S    14:55   0:00 [kworker/1:0]
root        18  0.0  0.0      0     0 ?        S<   14:55   0:00 [kworker/1:0H]
root        19  0.0  0.0      0     0 ?        S    14:55   0:00 [rcuos/1]
root        20  0.0  0.0      0     0 ?        S    14:55   0:00 [rcuob/1]
root        21  0.0  0.0      0     0 ?        S    14:55   0:00 [cpuhp/2]
root        22  0.0  0.0      0     0 ?        S    14:55   0:00 [migration/2]
root        23  0.0  0.0      0     0 ?        S    14:55   0:00 [ksoftirqd/2]
root        24  0.0  0.0      0     0 ?        S    14:55   0:00 [kworker/2:0]
root        25  0.0  0.0      0     0 ?        S<   14:55   0:00 [kworker/2:0H]
root        26  0.0  0.0      0     0 ?        S    14:55   0:00 [rcuos/2]
root        27  0.0  0.0      0     0 ?        S    14:55   0:00 [rcuob/2]
root        28  0.0  0.0      0     0 ?        S    14:55   0:00 [cpuhp/3]
root        29  0.0  0.0      0     0 ?        S    14:55   0:00 [migration/3]
root        30  0.0  0.0      0     0 ?        S    14:55   0:00 [ksoftirqd/3]
root        32  0.0  0.0      0     0 ?        S<   14:55   0:00 [kworker/3:0H]
root        33  0.0  0.0      0     0 ?        S    14:55   0:00 [rcuos/3]
root        34  0.0  0.0      0     0 ?        S    14:55   0:00 [rcuob/3]
root        35  0.0  0.0      0     0 ?        S    14:55   0:00 [kdevtmpfs]
root        36  0.0  0.0      0     0 ?        S<   14:55   0:00 [netns]
root        37  0.0  0.0      0     0 ?        S    14:55   0:00 [oom_reaper]
root        38  0.0  0.0      0     0 ?        S<   14:55   0:00 [writeback]
root        39  0.0  0.0      0     0 ?        S    14:55   0:00 [kcompactd0]
root        40  0.0  0.0      0     0 ?        SN   14:55   0:00 [ksmd]
root        41  0.0  0.0      0     0 ?        S    14:55   0:00 [kworker/0:1]
root        42  0.0  0.0      0     0 ?        S<   14:55   0:00 [crypto]
root        43  0.0  0.0      0     0 ?        S<   14:55   0:00 [bioset]
root        44  0.0  0.0      0     0 ?        S<   14:55   0:00 [kblockd]
root        47  0.0  0.0      0     0 ?        S    14:55   0:00 [kswapd0]
root        48  0.0  0.0      0     0 ?        S<   14:55   0:00 [vmstat]
root        49  0.0  0.0      0     0 ?        S<   14:55   0:00 [bioset]
root        50  0.0  0.0      0     0 ?        S<   14:55   0:00 [xfsalloc]
root        51  0.0  0.0      0     0 ?        S<   14:55   0:00 [xfs_mru_cache]
root        73  0.0  0.0      0     0 ?        S<   14:55   0:00 [nfit]
root        74  0.0  0.0      0     0 ?        S    14:55   0:00 [kworker/u8:1]
root        75  0.0  0.0      0     0 ?        S<   14:55   0:00 [bioset]
root        76  0.0  0.0      0     0 ?        S    14:55   0:00 [khvcd]
root        77  0.0  0.0      0     0 ?        S<   14:55   0:00 [bioset]
root        78  0.0  0.0      0     0 ?        S<   14:55   0:00 [bioset]
root        79  0.0  0.0      0     0 ?        S<   14:55   0:00 [bioset]
root        80  0.0  0.0      0     0 ?        S    14:55   0:00 [kworker/0:2]
root        81  0.0  0.0      0     0 ?        S<   14:55   0:00 [bioset]
root        82  0.0  0.0      0     0 ?        S<   14:55   0:00 [bioset]
root        83  0.0  0.0      0     0 ?        S<   14:55   0:00 [bioset]
root        84  0.0  0.0      0     0 ?        S<   14:55   0:00 [bioset]
root        85  0.0  0.0      0     0 ?        S<   14:55   0:00 [bioset]
root        86  0.0  0.0      0     0 ?        S<   14:55   0:00 [bioset]
root        87  0.0  0.0      0     0 ?        S<   14:55   0:00 [bioset]
root        88  0.0  0.0      0     0 ?        S<   14:55   0:00 [bioset]
root        89  0.0  0.0      0     0 ?        S<   14:55   0:00 [bioset]
root        90  0.0  0.0      0     0 ?        S<   14:55   0:00 [bioset]
root        91  0.0  0.0      0     0 ?        S<   14:55   0:00 [bioset]
root        92  0.0  0.0      0     0 ?        S<   14:55   0:00 [bioset]
root        93  0.0  0.0      0     0 ?        S<   14:55   0:00 [bioset]
root        94  0.0  0.0      0     0 ?        S<   14:55   0:00 [bioset]
root        95  0.0  0.0      0     0 ?        S<   14:55   0:00 [bioset]
root        96  0.0  0.0      0     0 ?        S<   14:55   0:00 [bioset]
root        97  0.0  0.0      0     0 ?        S<   14:55   0:00 [bioset]
root        98  0.0  0.0      0     0 ?        S<   14:55   0:00 [bioset]
root        99  0.0  0.0      0     0 ?        S<   14:55   0:00 [bioset]
root       100  0.0  0.0      0     0 ?        S<   14:55   0:00 [bioset]
root       101  0.0  0.0      0     0 ?        S<   14:55   0:00 [bioset]
root       102  0.0  0.0      0     0 ?        S<   14:55   0:00 [ixgbe]
root       103  0.0  0.0      0     0 ?        S<   14:55   0:00 [ixgbevf]
root       104  0.0  0.0      0     0 ?        S<   14:55   0:00 [dm_bufio_cache]
root       105  0.0  0.0      0     0 ?        S<   14:55   0:00 [ipv6_addrconf]
root       112  0.0  0.0      0     0 ?        S    14:55   0:00 [jbd2/pmem0p1-8]
root       113  0.0  0.0      0     0 ?        S<   14:55   0:00 [ext4-rsv-conver]
root       114  0.0  0.0      0     0 ?        S    14:55   0:00 [kworker/1:1]
root       123  0.0  0.0  19196   304 ?        Ss   14:55   0:00 /usr/lib/systemd/systemd-journald
root       128  0.0  0.0      0     0 ?        S    14:55   0:00 [kworker/2:1]
root       136  0.0  0.0   5796   476 ?        Ss   14:55   0:00 /usr/lib/systemd/systemd-udevd --children-max=16
root       156  0.0  0.0      0     0 ?        S    14:55   0:00 [kworker/3:2]
root       157  0.0  0.0      0     0 ?        S    14:55   0:00 [kworker/3:3]
systemd+   158  0.0  0.0  81292   380 ?        Ssl  14:55   0:00 /usr/lib/systemd/systemd-timesyncd
root       177  0.0  0.0 606644  1480 ?        Ssl  14:55   0:00 /usr/bin/cc-agent
root       179  0.0  0.0   5400   456 ?        Ss   14:55   0:00 /usr/bin/bash
message+   191  0.0  0.0   4052   332 ?        Ss   14:55   0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
root       199  0.0  0.0   1092     4 ?        Ss   14:55   0:00 ./pause
root       207  0.0  0.1  18240  2088 ?        Ss+  14:55   0:00 bash
root       265  0.0  0.0   5548   228 ?        R+   15:26   0:00 ps aux

the question is should we change to CONFIG_NO_HZ_IDLE ?

mcastelino pushed a commit to mcastelino/runtime that referenced this issue Dec 6, 2018
qemu: create vm directory before launching qemu
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant