linux/drivers/gpu/drm/ttm
Roger He ec3fe391bd drm/ttm: check if free mem space is under the lower limit
the free mem space and the lower limit both include two parts:
system memory and swap space.

For the OOM triggered by TTM, that is the case as below:
first swap space is full of swapped out pages and soon
system memory also is filled up with ttm pages. and then
any memory allocation request will run into OOM.

to cover two cases:
a. if no swap disk at all or free swap space is under swap mem
   limit but available system mem is bigger than sys mem limit,
   allow TTM allocation;

b. if the available system mem is less than sys mem limit but
   free swap space is bigger than swap mem limit, allow TTM
   allocation.

v2: merge two memory limit(swap and system) into one
v3: keep original behavior except ttm_opt_ctx->flags with
    TTM_OPT_FLAG_FORCE_ALLOC
v4: always set force_alloc as tx->flags & TTM_OPT_FLAG_FORCE_ALLOC
v5: add an attribute for lower_mem_limit
v6: set lower_mem_limit as 0 to keep original behavior

Signed-off-by: Roger He <Hongbo.He@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-02-26 23:09:46 -05:00
..
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ttm_agp_backend.c drm/ttm: drop ttm->dummy_read_page 2018-02-26 23:09:45 -05:00
ttm_bo_manager.c drm/ttm: make ttm_mem_type_manager_func debug more useful 2017-08-17 15:45:59 -04:00
ttm_bo_util.c drm/ttm: drop bo->glob 2018-02-26 23:09:44 -05:00
ttm_bo_vm.c drm/ttm: add bit flag TTM_OPT_FLAG_FORCE_ALLOC 2018-02-26 23:09:34 -05:00
ttm_bo.c drm/ttm: drop persistent_swap_storage from ttm_bo_init and co 2018-02-26 23:09:45 -05:00
ttm_execbuf_util.c drm/ttm: drop bo->glob 2018-02-26 23:09:44 -05:00
ttm_lock.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/signal.h> 2017-03-02 08:42:29 +01:00
ttm_memory.c drm/ttm: check if free mem space is under the lower limit 2018-02-26 23:09:46 -05:00
ttm_module.c drm/ttm: make device_released static 2014-07-22 12:59:32 +10:00
ttm_object.c drm/ttm: use an operation ctx for ttm_mem_global_alloc 2017-12-27 11:38:54 -05:00
ttm_page_alloc_dma.c drm/ttm: check if free mem space is under the lower limit 2018-02-26 23:09:46 -05:00
ttm_page_alloc.c drm/ttm: check if free mem space is under the lower limit 2018-02-26 23:09:46 -05:00
ttm_tt.c drm/ttm: drop ttm->dummy_read_page 2018-02-26 23:09:45 -05:00