mirror of
https://github.com/torvalds/linux.git
synced 2026-04-24 17:42:27 -04:00
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>
This commit is contained in:
committed by
Alex Deucher
parent
bd4caed47a
commit
da291320ba
@@ -910,7 +910,8 @@ static gfp_t ttm_dma_pool_gfp_flags(struct ttm_dma_tt *ttm_dma, bool huge)
|
||||
gfp_flags |= __GFP_ZERO;
|
||||
|
||||
if (huge) {
|
||||
gfp_flags |= GFP_TRANSHUGE;
|
||||
gfp_flags |= GFP_TRANSHUGE_LIGHT | __GFP_NORETRY |
|
||||
__GFP_KSWAPD_RECLAIM;
|
||||
gfp_flags &= ~__GFP_MOVABLE;
|
||||
gfp_flags &= ~__GFP_COMP;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user