drm/ttm: Use GFP_TRANSHUGE_LIGHT for allocating huge pages
authorMichel Dänzer <michel.daenzer@amd.com>
Wed, 25 Apr 2018 15:32:10 +0000 (17:32 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 15 May 2018 18:44:17 +0000 (13:44 -0500)
commit00862edba135c30d65b9af863163fdfa1f502c61
treed5b65af53514cbfacbcfc9caffaf49f936a2a9bd
parent87ac8fb08bc7c69a39842c73f3a9d06eb73f02cc
drm/ttm: Use GFP_TRANSHUGE_LIGHT for allocating huge pages

GFP_TRANSHUGE tries very hard to allocate huge pages, which can result
in long delays with high memory pressure. I have observed firefox
freezing for up to around a minute due to this while restic was taking
a full system backup.

Since we don't really need huge pages, use GFP_TRANSHUGE_LIGHT |
__GFP_NORETRY instead, in order to fail quickly when there are no huge
pages available.

Set __GFP_KSWAPD_RECLAIM as well, in order for huge pages to be freed
up in the background if necessary.

With these changes, I'm no longer seeing freezes during a restic backup.

Cc: stable@vger.kernel.org
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/ttm/ttm_page_alloc.c
drivers/gpu/drm/ttm/ttm_page_alloc_dma.c