Excerpts from Dave Hansen's message of January 19, 2022 3:28 am:
On 1/17/22 6:46 PM, Nicholas Piggin wrote:It's not safe to enable though. That's the problem. If it was just
Very fragile or not, I think folks are likely to get it wrong. It wouldThis all sounds very fragile to me. Every time a new architecture wouldThis is documented in the Kconfig.
get added for huge vmalloc() support, the developer needs to know to go
find that architecture's module_alloc() and add this flag.
#
# Archs that select this would be capable of PMD-sized vmaps (i.e.,
# arch_vmap_pmd_supported() returns true), and they must make no assumptions
# that vmalloc memory is mapped with PAGE_SIZE ptes. The VM_NO_HUGE_VMAP flag
# can be used to prohibit arch-specific allocations from using hugepages to
# help with this (e.g., modules may require it).
#
config HAVE_ARCH_HUGE_VMALLOC
depends on HAVE_ARCH_HUGE_VMAP
bool
Is it really fair to say it's *very* fragile? Surely it's reasonable to
read the (not very long) documentation ad understand the consequences for
the arch code before enabling it.
be nice to have it default *everyone* to safe and slow and make *sure*
modules then you'd have a point but it could be anything.
they go look at the architecture modules code itself before enablingThis is required not just for modules for the whole arch code, it
this for modules.
has to be looked at and decided this will work.
Just from that Kconfig text, I don't think I'd know off the top of myYou have to make sure arch/x86 makes no assumptions that vmalloc memory
head what do do for x86, or what code I needed to go touch.
is backed by PAGE_SIZE ptes. If you can't do that then you shouldn't
enable the option. The option can not explain it any more because any
arch could do anything with its mappings. The module code is an example,
not the recipe.
Thanks,
Nick
.