lkml.org 
[lkml]   [2021]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 3/7] mm,memory_hotplug: Add kernel boot option to enable memmap_on_memory
On Thu, Feb 25, 2021 at 07:25:58PM +0100, David Hildenbrand wrote:
> > +static __meminit int memmap_on_memory_store(const char *val,
> > + const struct kernel_param *kp)
> > +{
> > + /*
> > + * Fail silently in case we cannot enable it due to platform constraints.
> > + * User can always check whether it is enabled or not via /sys/module.
> > + */
> > + if (!IS_ENABLED(CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE))
> > + return 0;
> > +
> > + return param_set_bool(val, kp);
> > +}
> > +module_param_call(memmap_on_memory, memmap_on_memory_store,
> > + memmap_on_memory_show, &memmap_on_memory_enabled, 0400);
>
> Why are other users not allowed to read?

I copied it from the shuffle one. I guess shuffle code made it 0400 for
security reasons.
Since we do not need that here, I will switch it to 0444.

> Might want to add a MODULE_PARM_DESC().

Sure

> As we fail silently already, I'd keep it simple and use a
>
> module_param(memmap_on_memory, bool, 0444);
>
> moving the IS_ENABLED(CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE) into the
> runtime check.

You mean moving this check into mhp_supports_memmap_on_memory() check
from patch#1 right?

Makes sense.


--
Oscar Salvador
SUSE L3

\
 
 \ /
  Last update: 2021-02-26 13:16    [W:0.115 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site