From 44674e4c92f7ef20dbc985f479c5c19548378a08 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Fri, 28 Jul 2023 19:59:01 +0800 Subject: sysv: Mount cgroup fs for memory pressure information early Prepare for systemd-254 update. See #5293 for details. --- bootscripts/ChangeLog | 3 +++ bootscripts/lfs/init.d/mountvirtfs | 4 ++++ chapter01/changelog.xml | 13 +++++++++++++ chapter10/fstab.xml | 23 ++++++++++++----------- chapter10/kernel.xml | 5 +++++ packages.ent | 2 +- 6 files changed, 38 insertions(+), 12 deletions(-) diff --git a/bootscripts/ChangeLog b/bootscripts/ChangeLog index d255411b1..aff30cb41 100644 --- a/bootscripts/ChangeLog +++ b/bootscripts/ChangeLog @@ -1,3 +1,6 @@ +2023-07-28 Xi Ruoyao + * In mountvirtfs, mount /sys/fs/cgroup for udev from systemd-254. + 2023-07-22 Xi Ruoyao * In mountvirtfs, create symlinks /dev/{fd,std{in,out,err}} and /dev/core (optional). diff --git a/bootscripts/lfs/init.d/mountvirtfs b/bootscripts/lfs/init.d/mountvirtfs index bbf30cf90..fd797787a 100644 --- a/bootscripts/lfs/init.d/mountvirtfs +++ b/bootscripts/lfs/init.d/mountvirtfs @@ -63,6 +63,10 @@ case "${1}" in log_info_msg2 " ${INFO}/dev/shm" mount -o nosuid,nodev /dev/shm || failed=1 + mkdir -p /sys/fs/cgroup + log_info_msg2 " ${INFO}/sys/fs/cgroup" + mount -o nosuid,noexec,nodev /sys/fs/cgroup || failed=1 + (exit ${failed}) evaluate_retval if [ "${failed}" = 1 ]; then diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index cfb845733..73fc65f72 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -40,6 +40,19 @@ appropriate for the entry or if needed the entire day's listitem. --> + + 2023-07-28 + + + [xry111] - Enable cgroup-based memory pressure information + in kernel, and add the cgroup file system into /etc/fstab and the + mountvirtfs bootscript. This is a preparation for udev from + systemd-254. Addresses + #5293. + + + + 2023-07-22 diff --git a/chapter10/fstab.xml b/chapter10/fstab.xml index f78b234db..ccf767ab6 100644 --- a/chapter10/fstab.xml +++ b/chapter10/fstab.xml @@ -22,17 +22,18 @@ cat > /etc/fstab << "EOF" # Begin /etc/fstab -# file system mount-point type options dump fsck -# order - -/dev/<xxx> / <fff> defaults 1 1 -/dev/<yyy> swap swap pri=1 0 0 -proc /proc proc nosuid,noexec,nodev 0 0 -sysfs /sys sysfs nosuid,noexec,nodev 0 0 -devpts /dev/pts devpts gid=5,mode=620 0 0 -tmpfs /run tmpfs defaults 0 0 -devtmpfs /dev devtmpfs mode=0755,nosuid 0 0 -tmpfs /dev/shm tmpfs nosuid,nodev 0 0 +# file system mount-point type options dump fsck +# order + +/dev/<xxx> / <fff> defaults 1 1 +/dev/<yyy> swap swap pri=1 0 0 +proc /proc proc nosuid,noexec,nodev 0 0 +sysfs /sys sysfs nosuid,noexec,nodev 0 0 +devpts /dev/pts devpts gid=5,mode=620 0 0 +tmpfs /run tmpfs defaults 0 0 +devtmpfs /dev devtmpfs mode=0755,nosuid 0 0 +tmpfs /dev/shm tmpfs nosuid,nodev 0 0 +cgroup2 /sys/fs/cgroup cgroup2 nosuid,noexec,nodev 0 0 # End /etc/fstab EOF diff --git a/chapter10/kernel.xml b/chapter10/kernel.xml index ad6b252a7..376f6cdff 100644 --- a/chapter10/kernel.xml +++ b/chapter10/kernel.xml @@ -135,7 +135,12 @@ [*] Randomize the address of the kernel image (KASLR) [CONFIG_RANDOMIZE_BASE] General setup ---> [ ] Compile the kernel with warnings as errors [CONFIG_WERROR] + CPU/Task time and stats accounting ---> + [*] Pressure stall information tracking [CONFIG_PSI] + [ ] Require boot parameter to enable pressure stall information tracking [CONFIG_PSI_DEFAULT_DISABLED] < > Enable kernel headers through /sys/kernel/kheaders.tar.xz [CONFIG_IKHEADERS] + [*] Control Group support [CONFIG_CGROUPS] ---> + [*] Memory controller [CONFIG_MEMCG] [ ] Configure standard kernel features (expert users) [CONFIG_EXPERT] General architecture-dependent options ---> [*] Stack Protector buffer overflow detection [CONFIG_STACKPROTECTOR] diff --git a/packages.ent b/packages.ent index 6fd5c0280..09008604d 100644 --- a/packages.ent +++ b/packages.ent @@ -383,7 +383,7 @@ - + -- cgit v1.2.3-54-g00ecf