Re: [PATCH v2 1/2] mm/vmalloc: export __vmalloc_node_range

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09.06.21 18:28, Claudio Imbrenda wrote:
On Wed, 9 Jun 2021 16:59:17 +0100
Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:

On Tue, Jun 08, 2021 at 08:06:17PM +0200, Claudio Imbrenda wrote:
The recent patches to add support for hugepage vmalloc mappings
added a flag for __vmalloc_node_range to allow to request small
pages. This flag is not accessible when calling vmalloc, the only
option is to call directly __vmalloc_node_range, which is not
exported.

This means that a module can't vmalloc memory with small pages.

Case in point: KVM on s390x needs to vmalloc a large area, and it
needs to be mapped with small pages, because of a hardware
limitation.

This patch exports __vmalloc_node_range so it can be used in modules
too.

No.  I spent a lot of effort to mak sure such a low-level API is
not exported.

ok, but then how can we vmalloc memory with small pages from KVM?

An alternative would be to provide a vmalloc_no_huge function in generic
code  (similar to  vmalloc_32) (or if preferred in s390 base architecture code)
Something like

void *vmalloc_no_huge(unsigned long size)
{
        return __vmalloc_node_flags(size, NUMA_NO_NODE,VM_NO_HUGE_VMAP |
                                GFP_KERNEL | __GFP_ZERO);
}
EXPORT_SYMBOL(vmalloc_no_huge);

or a similar vzalloc variant.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux