mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-21 04:53:46 -04:00
drm/ttm: Allow page allocations w/o triggering OOM..
This to allow drivers to choose to avoid OOM invocation and handle page allocation failures instead. v2: Remove extra new lines. Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Roger He <Hongbo.He@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
7b158d1691
commit
cb5f1a52ca
@@ -741,6 +741,9 @@ out:
|
||||
if (ttm_flags & TTM_PAGE_FLAG_ZERO_ALLOC)
|
||||
gfp_flags |= __GFP_ZERO;
|
||||
|
||||
if (ttm_flags & TTM_PAGE_FLAG_NO_RETRY)
|
||||
gfp_flags |= __GFP_RETRY_MAYFAIL;
|
||||
|
||||
/* ttm_alloc_new_pages doesn't reference pool so we can run
|
||||
* multiple requests in parallel.
|
||||
**/
|
||||
@@ -893,6 +896,9 @@ static int ttm_get_pages(struct page **pages, unsigned npages, int flags,
|
||||
if (flags & TTM_PAGE_FLAG_ZERO_ALLOC)
|
||||
gfp_flags |= __GFP_ZERO;
|
||||
|
||||
if (flags & TTM_PAGE_FLAG_NO_RETRY)
|
||||
gfp_flags |= __GFP_RETRY_MAYFAIL;
|
||||
|
||||
if (flags & TTM_PAGE_FLAG_DMA32)
|
||||
gfp_flags |= GFP_DMA32;
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user