Messages in this thread | | | Date | Fri, 26 Feb 2021 13:14:40 +0100 | From | Oscar Salvador <> | Subject | Re: [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
| |