Skip to content

Commit

Permalink
Add missing __GFP_HIGHMEM flag to vmalloc
Browse files Browse the repository at this point in the history
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 openzfs#9031
  • Loading branch information
c0d3z3r0 authored and tonyhutter committed Sep 25, 2019
1 parent 2b9f73e commit ceb516a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion module/spl/spl-kmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit ceb516a

Please sign in to comment.