All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] prevent OOM triggered by TTM
@ 2018-02-06  9:04 Roger He
       [not found] ` <1517907874-21248-1-git-send-email-Hongbo.He-5C7GfCeVMHo@public.gmane.org>
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Roger He @ 2018-02-06  9:04 UTC (permalink / raw)
  To: amd-gfx, dri-devel; +Cc: Roger He, Christian.Koenig

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(-)

-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2018-02-07 18:07 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-06  9:04 [PATCH 0/5] prevent OOM triggered by TTM Roger He
     [not found] ` <1517907874-21248-1-git-send-email-Hongbo.He-5C7GfCeVMHo@public.gmane.org>
2018-02-06  9:04   ` [PATCH 1/5] drm/ttm: check if the free swap space is under limit 256MB Roger He
2018-02-06  9:04   ` [PATCH 2/5] drm/ttm: keep original behavior except with flag no_retry Roger He
2018-02-06  9:04   ` [PATCH 3/5] drm/ttm: use bit flag to replace allow_reserved_eviction in ttm_operation_ctx Roger He
2018-02-06  9:04   ` [PATCH 4/5] drm/ttm: add bit flag TTM_OPT_FLAG_ALLOW_ALLOC_ANYWAY Roger He
2018-02-06  9:04 ` [PATCH 5/5] drm/ttm: add input parameter allow_allo_anyway for ttm_bo_evict_mm Roger He
2018-02-06  9:51 ` [PATCH 0/5] prevent OOM triggered by TTM Christian König
2018-02-06 10:07   ` He, Roger
2018-02-07  6:43 ` Thomas Hellstrom
2018-02-07  8:25   ` He, Roger
2018-02-07  8:41     ` Christian König
     [not found]       ` <d617ad27-095d-f17d-d310-89caf21d12ca-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-02-07 10:19         ` He, Roger
     [not found]     ` <MWHPR1201MB0127DA7619E7AE8C95D8FE8DFDFC0-3iK1xFAIwjq9imrIu4W8xGrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2018-02-07 13:17       ` Thomas Hellstrom
2018-02-07 13:22         ` Christian König
     [not found]           ` <4b46ea00-ddb4-a316-02b8-247bd3812a14-5C7GfCeVMHo@public.gmane.org>
2018-02-07 18:07             ` Thomas Hellstrom

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.