Skip to content

prevent OOM triggered by TTM

Roger He amd-gfx dri-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 of 5 patches 9 repliesIn review

1 of 5 patches is in this archive. The cover letter announces 5.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
5/5drm/ttm: add input parameter allow_allo_anyway for ttm_bo_evict_mmdrivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c drivers/gpu/drm/amd/amdgpu/amdgpu_device.c drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +9 more+37 -250 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] prevent OOM triggered by TTM

currently ttm code has no any allocation limit. So it allows pages allocatation unlimited until OOM. Because if swap space is full of swapped pages and then system memory will be filled up with ttm pages. and then any memory allocation request will trigger OOM.

the following patches is for prevent OOM triggered by TTM. the basic idea is when allocating TTM pages, check the free swap space firt. if it is less than the fixe limit, reject the allocation request. but there are two exceptions which should allow it regardless of zone memory account limit.
a. page fault
for ttm_mem_global_reserve if serving for page fault routine, because page fault routing already grabbed system memory so the allowance of this exception is harmless. Otherwise, it will trigger
OOM killer.
b. suspend
anyway, we should allow suspend success always.

at last, if bdev.no_retry is false (by defaut), keep the original behavior no any change.

Roger He (5):
drm/ttm: check if the free swap space is under limit 256MB drm/ttm: keep original behavior except with flag no_retry drm/ttm: use bit flag to replace allow_reserved_eviction in
ttm_operation_ctx
drm/ttm: add bit flag TTM_OPT_FLAG_ALLOW_ALLOC_ANYWAY drm/ttm: add input parameter allow_allo_anyway for ttm_bo_evict_mm

 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c      |  4 +--
 drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c  |  4 +--
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c  | 10 +++---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.h  |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c     |  8 +++--
 drivers/gpu/drm/nouveau/nouveau_drm.c       |  2 +-
 drivers/gpu/drm/qxl/qxl_object.c            |  4 +--
 drivers/gpu/drm/radeon/radeon_device.c      |  6 ++--
 drivers/gpu/drm/radeon/radeon_object.c      |  6 ++--
 drivers/gpu/drm/radeon/radeon_object.h      |  3 +-
 drivers/gpu/drm/ttm/ttm_bo.c                | 19 +++++++----
 drivers/gpu/drm/ttm/ttm_bo_vm.c             |  6 ++--
 drivers/gpu/drm/ttm/ttm_memory.c            | 51 ++++++++++++++++++++++++++---
 drivers/gpu/drm/ttm/ttm_page_alloc_dma.c    |  1 -
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c         |  6 ++--
 include/drm/ttm/ttm_bo_api.h                | 14 ++++++--
 include/drm/ttm/ttm_memory.h                |  6 ++++
 18 files changed, 111 insertions(+), 43 deletions(-)
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel