Add missing __GFP_HIGHMEM flag to vmalloc

Make use of __GFP_HIGHMEM flag in vmem_alloc, which is required for
some 32-bit systems to make use of full available memory.
While kernel versions >=4.12-rc1 add this flag implicitly, older
kernels do not.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Sebastian Gottschall <s.gottschall@dd-wrt.com>
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
Closes #9031
This commit is contained in:
Michael Niewöhner 2019-07-17 18:09:22 +02:00 committed by Brian Behlendorf
parent c8802ba08d
commit 5784c7c36e
1 changed files with 2 additions and 1 deletions

View File

@ -180,7 +180,8 @@ spl_kmem_alloc_impl(size_t size, int flags, int node)
*/
if ((size > spl_kmem_alloc_max) || use_vmem) {
if (flags & KM_VMEM) {
ptr = __vmalloc(size, lflags, PAGE_KERNEL);
ptr = __vmalloc(size, lflags | __GFP_HIGHMEM,
PAGE_KERNEL);
} else {
return (NULL);
}