Skip to content

Commit bf9eee2

Browse files
drm/ttm: stop using GFP_TRANSHUGE_LIGHT
The only flag we really need is __GFP_NOMEMALLOC, highmem depends on dma32 and moveable/compound should never be set in the first place. Signed-off-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/413812/ Link: https://patchwork.freedesktop.org/patch/413964/ Fixes: d099fc8 ("drm/ttm: new TT backend allocation pool v3") Reported-by: Hans de Goede <[email protected]> Reviewed-by: Daniel Vetter <[email protected]>
1 parent 19c329f commit bf9eee2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

drivers/gpu/drm/ttm/ttm_pool.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,13 @@ static struct page *ttm_pool_alloc_page(struct ttm_pool *pool, gfp_t gfp_flags,
7979
struct page *p;
8080
void *vaddr;
8181

82-
if (order) {
83-
gfp_flags |= GFP_TRANSHUGE_LIGHT | __GFP_NORETRY |
82+
/* Don't set the __GFP_COMP flag for higher order allocations.
83+
* Mapping pages directly into an userspace process and calling
84+
* put_page() on a TTM allocated page is illegal.
85+
*/
86+
if (order)
87+
gfp_flags |= __GFP_NOMEMALLOC | __GFP_NORETRY |
8488
__GFP_KSWAPD_RECLAIM;
85-
gfp_flags &= ~__GFP_MOVABLE;
86-
gfp_flags &= ~__GFP_COMP;
87-
}
8889

8990
if (!pool->use_dma_alloc) {
9091
p = alloc_pages(gfp_flags, order);

0 commit comments

Comments
 (0)