Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] drop slub_debug/page_poison from bootloaders
@ 2021-02-28 23:14 q66
  2021-03-01  8:42 ` fosslinux
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: q66 @ 2021-02-28 23:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1967 bytes --]

There is a new pull request by q66 against master on the void-packages repository

https://github.com/void-ppc/void-packages page-poison
https://github.com/void-linux/void-packages/pull/29142

drop slub_debug/page_poison from bootloaders
These are kernel hardening options introduced into Void in 2016. On most modern hardware they have a small performance hit, on older hardware they can have a significant performance hit. In kernel 5.3, new options were introduced, `init_on_alloc` and `init_on_free`. There are also kernel options to make these default.

The new defaults have been toggled in kernels 5.4, 5.10 and 5.11 in bd0d33eec0bd774d8cc62e32689b6fbfda517179. I explicitly did not enable `init_on_free` since that has a much bigger performance penalty, even on current-day hardware.

The only "drawback" of these changes is that people using old kernels will not get these options anymore. OTOH, the new behavior is much better in other ways (it has less of an impact, it's enabled in kernels rather than default configs so any changes to it will propagate to all users unconditionally, etc). And also, there isn't any other mainstream distribution that was using these options in the first place, for a reason, as far as I can tell.

People on kernels 4.4, 4.9, 4.14 and 4.19 who really care can update it themselves. But since older kernels tend to be associated with older hardware, they'll probably want to keep the options off in the first place.

What troubles me more is that even if I merge this PR, it will not propagate to existing users who have modified their `/etc/default/grub`, so they will need to change those files themselves. The new default kernel options are not incompatible with the old options, but people will likely want to remove them anyway. So we should probably put information about this in the documentation, too.

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/29142.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-page-poison-29142.patch --]
[-- Type: text/x-diff, Size: 4238 bytes --]

From 5c17699452ddaea9c4ab02d9b0574e9263e63abf Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Mon, 1 Mar 2021 00:01:29 +0100
Subject: [PATCH 1/3] pinephone-uboot: drom slub_debug/page_poison

---
 srcpkgs/pinephone-uboot/files/uboot.default | 2 +-
 srcpkgs/pinephone-uboot/template            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/pinephone-uboot/files/uboot.default b/srcpkgs/pinephone-uboot/files/uboot.default
index e0955f552c2..2fee8db656e 100644
--- a/srcpkgs/pinephone-uboot/files/uboot.default
+++ b/srcpkgs/pinephone-uboot/files/uboot.default
@@ -8,4 +8,4 @@
 ROCKER_ARGS=yes
 
 # Regular cmdline for configured kernel
-CMDLINE="console=tty0 console=ttyS0,115200 rootwait loglevel=4 slub_debug=P page_poison=1"
+CMDLINE="console=tty0 console=ttyS0,115200 rootwait loglevel=4"
diff --git a/srcpkgs/pinephone-uboot/template b/srcpkgs/pinephone-uboot/template
index aaee84f998b..e594d838f2b 100644
--- a/srcpkgs/pinephone-uboot/template
+++ b/srcpkgs/pinephone-uboot/template
@@ -1,7 +1,7 @@
 # Template file for 'pinephone-uboot'
 pkgname=pinephone-uboot
 version=0.0.20200917
-revision=2
+revision=3
 archs="aarch64*"
 create_wrksrc=yes
 hostmakedepends="flex cross-or1k-none-elf-gcc dtc python3 python3-devel bc swig"

From fa68e194c31a56fe96ce8058e8f366d96b11739d Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Mon, 1 Mar 2021 00:01:59 +0100
Subject: [PATCH 2/3] pinebookpro-uboot: drop slub_debug/page_poison

---
 srcpkgs/pinebookpro-uboot/files/kernel.d/uboot | 2 +-
 srcpkgs/pinebookpro-uboot/template             | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/pinebookpro-uboot/files/kernel.d/uboot b/srcpkgs/pinebookpro-uboot/files/kernel.d/uboot
index c7914c454fe..f184ced22d5 100755
--- a/srcpkgs/pinebookpro-uboot/files/kernel.d/uboot
+++ b/srcpkgs/pinebookpro-uboot/files/kernel.d/uboot
@@ -14,7 +14,7 @@ cat > /boot/boot.txt <<EOF
 setenv macaddr da 19 c8 7a 6d f4
 
 part uuid \${devtype} \${devnum}:\${bootpart} uuid
-setenv bootargs console=ttyS2,1500000 console=tty1 root=PARTUUID=${partuuid} rootwait video=eDP-1:1920x1080@60 loglevel=4 slub_debug=P page_poison=1
+setenv bootargs console=ttyS2,1500000 console=tty1 root=PARTUUID=${partuuid} rootwait video=eDP-1:1920x1080@60 loglevel=4
 setenv fdtfile rockchip/rk3399-pinebook-pro.dtb
 
 if load \${devtype} \${devnum}:\${bootpart} \${kernel_addr_r} $(bootstrip /boot/vmlinux-${kver}); then
diff --git a/srcpkgs/pinebookpro-uboot/template b/srcpkgs/pinebookpro-uboot/template
index 4aff7de9e65..2f497adcd5b 100644
--- a/srcpkgs/pinebookpro-uboot/template
+++ b/srcpkgs/pinebookpro-uboot/template
@@ -2,7 +2,7 @@
 pkgname=pinebookpro-uboot
 reverts="20200212_1 20200212_2"
 version=0.0.20200212
-revision=3
+revision=4
 _commit_uboot=365495a329c8e92ca4c134562d091df71b75845e
 _commit_atf=22d12c4148c373932a7a81e5d1c59a767e143ac2
 archs="aarch64*"

From b943fb66cd89c38762733958ad0a488930bf3960 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Mon, 1 Mar 2021 00:03:24 +0100
Subject: [PATCH 3/3] grub: remove slub_debug/page_poison from defaults

---
 srcpkgs/grub/files/grub.default | 2 +-
 srcpkgs/grub/template           | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/grub/files/grub.default b/srcpkgs/grub/files/grub.default
index 5cd1fd2fd52..8e8231603eb 100644
--- a/srcpkgs/grub/files/grub.default
+++ b/srcpkgs/grub/files/grub.default
@@ -6,7 +6,7 @@ GRUB_DEFAULT=0
 #GRUB_HIDDEN_TIMEOUT_QUIET=false
 GRUB_TIMEOUT=5
 GRUB_DISTRIBUTOR="Void"
-GRUB_CMDLINE_LINUX_DEFAULT="loglevel=4 slub_debug=P page_poison=1"
+GRUB_CMDLINE_LINUX_DEFAULT="loglevel=4"
 # Uncomment to use basic console
 #GRUB_TERMINAL_INPUT="console"
 # Uncomment to disable graphical terminal
diff --git a/srcpkgs/grub/template b/srcpkgs/grub/template
index 21321d001c9..009b1e48822 100644
--- a/srcpkgs/grub/template
+++ b/srcpkgs/grub/template
@@ -1,7 +1,7 @@
 # Template file for 'grub'
 pkgname=grub
 version=2.04
-revision=4
+revision=5
 hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man"
 makedepends="libusb-compat-devel ncurses-devel freetype-devel
  liblzma-devel device-mapper-devel fuse-devel"

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: drop slub_debug/page_poison from bootloaders
  2021-02-28 23:14 [PR PATCH] drop slub_debug/page_poison from bootloaders q66
@ 2021-03-01  8:42 ` fosslinux
  2021-03-04 23:30 ` [PR PATCH] [Updated] " q66
  2021-03-04 23:33 ` [PR PATCH] [Merged]: " q66
  2 siblings, 0 replies; 4+ messages in thread
From: fosslinux @ 2021-03-01  8:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 201 bytes --]

New comment by fosslinux on void-packages repository

https://github.com/void-linux/void-packages/pull/29142#issuecomment-787767589

Comment:
Is there a plan to announce this in news on voidlinux.org?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PR PATCH] [Updated] drop slub_debug/page_poison from bootloaders
  2021-02-28 23:14 [PR PATCH] drop slub_debug/page_poison from bootloaders q66
  2021-03-01  8:42 ` fosslinux
@ 2021-03-04 23:30 ` q66
  2021-03-04 23:33 ` [PR PATCH] [Merged]: " q66
  2 siblings, 0 replies; 4+ messages in thread
From: q66 @ 2021-03-04 23:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2090 bytes --]

There is an updated pull request by q66 against master on the void-packages repository

https://github.com/void-ppc/void-packages page-poison
https://github.com/void-linux/void-packages/pull/29142

drop slub_debug/page_poison from bootloaders
These are kernel hardening options introduced into Void in 2016. On most modern hardware they have a small performance hit, on older hardware they can have a significant performance hit. In kernel 5.3, new options were introduced, `init_on_alloc` and `init_on_free`. There are also kernel options to make these default.

The new defaults have been toggled in kernels 5.4, 5.10 and 5.11 in bd0d33eec0bd774d8cc62e32689b6fbfda517179. I explicitly did not enable `init_on_free` since that has a much bigger performance penalty, even on current-day hardware.

The only "drawback" of these changes is that people using old kernels will not get these options anymore. OTOH, the new behavior is much better in other ways (it has less of an impact, it's enabled in kernels rather than default configs so any changes to it will propagate to all users unconditionally, etc). And also, there isn't any other mainstream distribution that was using these options in the first place, for a reason, as far as I can tell.

People on kernels 4.4, 4.9, 4.14 and 4.19 who really care can update it themselves. But since older kernels tend to be associated with older hardware, they'll probably want to keep the options off in the first place.

What troubles me more is that even if I merge this PR, it will not propagate to existing users who have modified their `/etc/default/grub`, so they will need to change those files themselves. The new default kernel options are not incompatible with the old options, but people will likely want to remove them anyway. So we should probably put information about this in the documentation, too.

[ci skip]

Anyway, waiting with merging this until the affected kernels have been rebuilt (i.e. for their next version bump).

A patch file from https://github.com/void-linux/void-packages/pull/29142.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-page-poison-29142.patch --]
[-- Type: text/x-diff, Size: 2928 bytes --]

From bc5d8dad48eb250f89933dbe5ce07c61a4000b5b Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Mon, 1 Mar 2021 00:01:29 +0100
Subject: [PATCH 1/2] pinephone-uboot: drom slub_debug/page_poison

---
 srcpkgs/pinephone-uboot/files/uboot.default | 2 +-
 srcpkgs/pinephone-uboot/template            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/pinephone-uboot/files/uboot.default b/srcpkgs/pinephone-uboot/files/uboot.default
index e0955f552c2..2fee8db656e 100644
--- a/srcpkgs/pinephone-uboot/files/uboot.default
+++ b/srcpkgs/pinephone-uboot/files/uboot.default
@@ -8,4 +8,4 @@
 ROCKER_ARGS=yes
 
 # Regular cmdline for configured kernel
-CMDLINE="console=tty0 console=ttyS0,115200 rootwait loglevel=4 slub_debug=P page_poison=1"
+CMDLINE="console=tty0 console=ttyS0,115200 rootwait loglevel=4"
diff --git a/srcpkgs/pinephone-uboot/template b/srcpkgs/pinephone-uboot/template
index aaee84f998b..e594d838f2b 100644
--- a/srcpkgs/pinephone-uboot/template
+++ b/srcpkgs/pinephone-uboot/template
@@ -1,7 +1,7 @@
 # Template file for 'pinephone-uboot'
 pkgname=pinephone-uboot
 version=0.0.20200917
-revision=2
+revision=3
 archs="aarch64*"
 create_wrksrc=yes
 hostmakedepends="flex cross-or1k-none-elf-gcc dtc python3 python3-devel bc swig"

From 1f02a1eb483b9f49f066fd670ae1478110d1c231 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Mon, 1 Mar 2021 00:01:59 +0100
Subject: [PATCH 2/2] pinebookpro-uboot: drop slub_debug/page_poison

---
 srcpkgs/pinebookpro-uboot/files/kernel.d/uboot | 2 +-
 srcpkgs/pinebookpro-uboot/template             | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/pinebookpro-uboot/files/kernel.d/uboot b/srcpkgs/pinebookpro-uboot/files/kernel.d/uboot
index c7914c454fe..f184ced22d5 100755
--- a/srcpkgs/pinebookpro-uboot/files/kernel.d/uboot
+++ b/srcpkgs/pinebookpro-uboot/files/kernel.d/uboot
@@ -14,7 +14,7 @@ cat > /boot/boot.txt <<EOF
 setenv macaddr da 19 c8 7a 6d f4
 
 part uuid \${devtype} \${devnum}:\${bootpart} uuid
-setenv bootargs console=ttyS2,1500000 console=tty1 root=PARTUUID=${partuuid} rootwait video=eDP-1:1920x1080@60 loglevel=4 slub_debug=P page_poison=1
+setenv bootargs console=ttyS2,1500000 console=tty1 root=PARTUUID=${partuuid} rootwait video=eDP-1:1920x1080@60 loglevel=4
 setenv fdtfile rockchip/rk3399-pinebook-pro.dtb
 
 if load \${devtype} \${devnum}:\${bootpart} \${kernel_addr_r} $(bootstrip /boot/vmlinux-${kver}); then
diff --git a/srcpkgs/pinebookpro-uboot/template b/srcpkgs/pinebookpro-uboot/template
index 4aff7de9e65..2f497adcd5b 100644
--- a/srcpkgs/pinebookpro-uboot/template
+++ b/srcpkgs/pinebookpro-uboot/template
@@ -2,7 +2,7 @@
 pkgname=pinebookpro-uboot
 reverts="20200212_1 20200212_2"
 version=0.0.20200212
-revision=3
+revision=4
 _commit_uboot=365495a329c8e92ca4c134562d091df71b75845e
 _commit_atf=22d12c4148c373932a7a81e5d1c59a767e143ac2
 archs="aarch64*"

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PR PATCH] [Merged]: drop slub_debug/page_poison from bootloaders
  2021-02-28 23:14 [PR PATCH] drop slub_debug/page_poison from bootloaders q66
  2021-03-01  8:42 ` fosslinux
  2021-03-04 23:30 ` [PR PATCH] [Updated] " q66
@ 2021-03-04 23:33 ` q66
  2 siblings, 0 replies; 4+ messages in thread
From: q66 @ 2021-03-04 23:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1933 bytes --]

There's a merged pull request on the void-packages repository

drop slub_debug/page_poison from bootloaders
https://github.com/void-linux/void-packages/pull/29142

Description:
These are kernel hardening options introduced into Void in 2016. On most modern hardware they have a small performance hit, on older hardware they can have a significant performance hit. In kernel 5.3, new options were introduced, `init_on_alloc` and `init_on_free`. There are also kernel options to make these default.

The new defaults have been toggled in kernels 5.4, 5.10 and 5.11 in bd0d33eec0bd774d8cc62e32689b6fbfda517179. I explicitly did not enable `init_on_free` since that has a much bigger performance penalty, even on current-day hardware.

The only "drawback" of these changes is that people using old kernels will not get these options anymore. OTOH, the new behavior is much better in other ways (it has less of an impact, it's enabled in kernels rather than default configs so any changes to it will propagate to all users unconditionally, etc). And also, there isn't any other mainstream distribution that was using these options in the first place, for a reason, as far as I can tell.

People on kernels 4.4, 4.9, 4.14 and 4.19 who really care can update it themselves. But since older kernels tend to be associated with older hardware, they'll probably want to keep the options off in the first place.

What troubles me more is that even if I merge this PR, it will not propagate to existing users who have modified their `/etc/default/grub`, so they will need to change those files themselves. The new default kernel options are not incompatible with the old options, but people will likely want to remove them anyway. So we should probably put information about this in the documentation, too.

[ci skip]

Anyway, waiting with merging this until the affected kernels have been rebuilt (i.e. for their next version bump).

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-04 23:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-28 23:14 [PR PATCH] drop slub_debug/page_poison from bootloaders q66
2021-03-01  8:42 ` fosslinux
2021-03-04 23:30 ` [PR PATCH] [Updated] " q66
2021-03-04 23:33 ` [PR PATCH] [Merged]: " q66

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).