linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/secretmem: make it on by default
@ 2023-05-15  8:34 Mike Rapoport
  2023-05-15 15:08 ` Randy Dunlap
  2023-05-16 10:52 ` David Hildenbrand
  0 siblings, 2 replies; 3+ messages in thread
From: Mike Rapoport @ 2023-05-15  8:34 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Mike Rapoport, linux-mm, linux-kernel

From: "Mike Rapoport (IBM)" <rppt@kernel.org>

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.

Link: https://lwn.net/Articles/931406/ [1]
Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 mm/secretmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/secretmem.c b/mm/secretmem.c
index 0b502625cd30..974b32ba8b9d 100644
--- a/mm/secretmem.c
+++ b/mm/secretmem.c
@@ -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");
-- 
2.35.1



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

* Re: [PATCH] mm/secretmem: make it on by default
  2023-05-15  8:34 [PATCH] mm/secretmem: make it on by default Mike Rapoport
@ 2023-05-15 15:08 ` Randy Dunlap
  2023-05-16 10:52 ` David Hildenbrand
  1 sibling, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2023-05-15 15:08 UTC (permalink / raw)
  To: Mike Rapoport, Andrew Morton; +Cc: linux-mm, linux-kernel

Hi,

On 5/15/23 01:34, Mike Rapoport wrote:
> From: "Mike Rapoport (IBM)" <rppt@kernel.org>
> 
> 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.

Nit:                            secretmem.enable

Maybe fix up while applying.

> 
> Link: https://lwn.net/Articles/931406/ [1]
> Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
> ---
>  mm/secretmem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/secretmem.c b/mm/secretmem.c
> index 0b502625cd30..974b32ba8b9d 100644
> --- a/mm/secretmem.c
> +++ b/mm/secretmem.c
> @@ -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");

-- 
~Randy


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

* Re: [PATCH] mm/secretmem: make it on by default
  2023-05-15  8:34 [PATCH] mm/secretmem: make it on by default Mike Rapoport
  2023-05-15 15:08 ` Randy Dunlap
@ 2023-05-16 10:52 ` David Hildenbrand
  1 sibling, 0 replies; 3+ messages in thread
From: David Hildenbrand @ 2023-05-16 10:52 UTC (permalink / raw)
  To: Mike Rapoport, Andrew Morton; +Cc: linux-mm, linux-kernel

On 15.05.23 10:34, Mike Rapoport wrote:
> From: "Mike Rapoport (IBM)" <rppt@kernel.org>
> 
> 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.
> 
> Link: https://lwn.net/Articles/931406/ [1]
> Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
> ---
>   mm/secretmem.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/secretmem.c b/mm/secretmem.c
> index 0b502625cd30..974b32ba8b9d 100644
> --- a/mm/secretmem.c
> +++ b/mm/secretmem.c
> @@ -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");

Acked-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb



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

end of thread, other threads:[~2023-05-16 10:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-15  8:34 [PATCH] mm/secretmem: make it on by default Mike Rapoport
2023-05-15 15:08 ` Randy Dunlap
2023-05-16 10:52 ` David Hildenbrand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox