Skip to content

Commit

Permalink
drm/ttm: increase ttm pre-fault value to PMD size
Browse files Browse the repository at this point in the history
ttm page fault handler ttm_bo_vm_fault_reserved() maps
TTM_BO_VM_NUM_PREFAULT more pages beforehand
due to the principle of locality.

However, on some platform the page faults are more costly, this
patch intends to increase the number of ttm pre-fault to relieve
the number of page faults.

When multiple levels of page table is supported, the new default
value would be the PMD size, similar to huge page.

Signed-off-by: Zhu Lingshan <lingshan.zhu@amd.com>
Reported-and-tested-by: Li Jingxiang <jingxiang.li@ecarxgroup.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240604084934.225738-1-lingshan.zhu@amd.com
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
  • Loading branch information
Zhu Lingshan authored and Christian König committed Jun 20, 2024
1 parent c139120 commit 0ddd2ae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/drm/ttm/ttm_bo.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@
#include "ttm_device.h"

/* Default number of pre-faulted pages in the TTM fault handler */
#if CONFIG_PGTABLE_LEVELS > 2
#define TTM_BO_VM_NUM_PREFAULT (1 << (PMD_SHIFT - PAGE_SHIFT))
#else
#define TTM_BO_VM_NUM_PREFAULT 16
#endif

struct iosys_map;

Expand Down

0 comments on commit 0ddd2ae

Please sign in to comment.