Skip to contentSkip to conversation

mm/secretmem: make it on by default

PATCH Applied Mike Rapoport 3 participants 3 messages May 15, 2023 – May 16, 2023

Subsystems (2)
lore
Share & tools
lore

Mike Rapoport

author maintainer
#0 lore raw

PATCH 1/1 mm/secretmem: make it on by default

From: "Mike Rapoport (IBM)" <[email protected]>

Following the discussion about direct map fragmentaion at LSF/MM [1], it appears that direct map fragmentation has a negligible effect on kernel data accesses. Since the only reason that warranted secretmem to be disabled by default was concern about performance regression caused by the direct map fragmentation, it makes perfect sense to lift this restriction and make secretmem enabled.

secretmem obeys RLIMIT_MEMBLOCK and as such it is not expected to cause large fragmentation of the direct map or meaningfull increase in page tables allocated during split of the large mappings in the direct map.

The secretmem.enable parameter is retained to allow system administrators to disable secretmem at boot.

Switch the default setting of secretem.enable parameter to 1.

---
 mm/secretmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/secretmem.c +1 -1
index 0b502625cd30..974b32ba8b9d 100644
@@ -35,7 +35,7 @@
 #define SECRETMEM_MODE_MASK	(0x0)
 #define SECRETMEM_FLAGS_MASK	SECRETMEM_MODE_MASK
 
-static bool secretmem_enable __ro_after_init;
+static bool secretmem_enable __ro_after_init = 1;
 module_param_named(enable, secretmem_enable, bool, 0400);
 MODULE_PARM_DESC(secretmem_enable,
 		 "Enable secretmem and memfd_secret(2) system call");
Signature · 1 line
2.35.1
#1 lore raw

Hi,

Quoted 9 lines · Mike Rapoport

From: "Mike Rapoport (IBM)" <[email protected]>

Following the discussion about direct map fragmentaion at LSF/MM [1], it appears that direct map fragmentation has a negligible effect on kernel data accesses. Since the only reason that warranted secretmem to be disabled by default was concern about performance regression caused by the direct map fragmentation, it makes perfect sense to lift this restriction and make secretmem enabled.

Quoted 8 lines

secretmem obeys RLIMIT_MEMBLOCK and as such it is not expected to cause large fragmentation of the direct map or meaningfull increase in page tables allocated during split of the large mappings in the direct map.

The secretmem.enable parameter is retained to allow system administrators to disable secretmem at boot.

Switch the default setting of secretem.enable parameter to 1.

Nit: secretmem.enable

Maybe fix up while applying.

Quoted 20 lines
---
 mm/secretmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/secretmem.c +1 -1
index 0b502625cd30..974b32ba8b9d 100644
@@ -35,7 +35,7 @@
 #define SECRETMEM_MODE_MASK	(0x0)
 #define SECRETMEM_FLAGS_MASK	SECRETMEM_MODE_MASK
 
-static bool secretmem_enable __ro_after_init;
+static bool secretmem_enable __ro_after_init = 1;
 module_param_named(enable, secretmem_enable, bool, 0400);
 MODULE_PARM_DESC(secretmem_enable,
 		 "Enable secretmem and memfd_secret(2) system call");
Signature · 1 line
~Randy
Acked-by on v1 1/1
#2 lore raw
In reply to Mike Rapoport
Quoted 29 lines · Mike Rapoport

From: "Mike Rapoport (IBM)" <[email protected]>

Following the discussion about direct map fragmentaion at LSF/MM [1], it appears that direct map fragmentation has a negligible effect on kernel data accesses. Since the only reason that warranted secretmem to be disabled by default was concern about performance regression caused by the direct map fragmentation, it makes perfect sense to lift this restriction and make secretmem enabled.

secretmem obeys RLIMIT_MEMBLOCK and as such it is not expected to cause large fragmentation of the direct map or meaningfull increase in page tables allocated during split of the large mappings in the direct map.

The secretmem.enable parameter is retained to allow system administrators to disable secretmem at boot.

Switch the default setting of secretem.enable parameter to 1.

---
  mm/secretmem.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
mm/secretmem.c +0 -0
index 0b502625cd30..974b32ba8b9d 100644

mm/secretmem.c line 41

Quoted 8 lines
mm/secretmem.c +1 -1
@@ -35,7 +35,7 @@
  #define SECRETMEM_MODE_MASK	(0x0)
  #define SECRETMEM_FLAGS_MASK	SECRETMEM_MODE_MASK
 
-static bool secretmem_enable __ro_after_init;
+static bool secretmem_enable __ro_after_init = 1;
  module_param_named(enable, secretmem_enable, bool, 0400);
  MODULE_PARM_DESC(secretmem_enable,
  		 "Enable secretmem and memfd_secret(2) system call");
Signature · 3 lines
Thanks,

David / dhildenb