@@ -1671,15 +1671,18 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
1671
1671
struct page * * pages ;
1672
1672
unsigned int nr_pages , array_size , i ;
1673
1673
const gfp_t nested_gfp = (gfp_mask & GFP_RECLAIM_MASK ) | __GFP_ZERO ;
1674
- const gfp_t alloc_mask = gfp_mask | __GFP_HIGHMEM | __GFP_NOWARN ;
1674
+ const gfp_t alloc_mask = gfp_mask | __GFP_NOWARN ;
1675
+ const gfp_t highmem_mask = (gfp_mask & (GFP_DMA | GFP_DMA32 )) ?
1676
+ 0 :
1677
+ __GFP_HIGHMEM ;
1675
1678
1676
1679
nr_pages = get_vm_area_size (area ) >> PAGE_SHIFT ;
1677
1680
array_size = (nr_pages * sizeof (struct page * ));
1678
1681
1679
1682
area -> nr_pages = nr_pages ;
1680
1683
/* Please note that the recursion is strictly bounded. */
1681
1684
if (array_size > PAGE_SIZE ) {
1682
- pages = __vmalloc_node (array_size , 1 , nested_gfp |__GFP_HIGHMEM ,
1685
+ pages = __vmalloc_node (array_size , 1 , nested_gfp |highmem_mask ,
1683
1686
PAGE_KERNEL , node , area -> caller );
1684
1687
} else {
1685
1688
pages = kmalloc_node (array_size , nested_gfp , node );
@@ -1700,17 +1703,17 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
1700
1703
}
1701
1704
1702
1705
if (node == NUMA_NO_NODE )
1703
- page = alloc_page (alloc_mask );
1706
+ page = alloc_page (alloc_mask | highmem_mask );
1704
1707
else
1705
- page = alloc_pages_node (node , alloc_mask , 0 );
1708
+ page = alloc_pages_node (node , alloc_mask | highmem_mask , 0 );
1706
1709
1707
1710
if (unlikely (!page )) {
1708
1711
/* Successfully allocated i pages, free them in __vunmap() */
1709
1712
area -> nr_pages = i ;
1710
1713
goto fail ;
1711
1714
}
1712
1715
area -> pages [i ] = page ;
1713
- if (gfpflags_allow_blocking (gfp_mask ))
1716
+ if (gfpflags_allow_blocking (gfp_mask | highmem_mask ))
1714
1717
cond_resched ();
1715
1718
}
1716
1719
0 commit comments