From: Zhu Lingshan Date: Tue, 4 Jun 2024 08:49:34 +0000 (+0800) Subject: drm/ttm: increase ttm pre-fault value to PMD size X-Git-Tag: v6.11-rc1~141^2~15^2~64 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0ddd2ae586d28e521d37393364d989ce118802e0;p=thirdparty%2Fkernel%2Flinux.git drm/ttm: increase ttm pre-fault value to PMD size 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 Reported-and-tested-by: Li Jingxiang Link: https://patchwork.freedesktop.org/patch/msgid/20240604084934.225738-1-lingshan.zhu@amd.com Reviewed-by: Christian König Signed-off-by: Christian König --- diff --git a/include/drm/ttm/ttm_bo.h b/include/drm/ttm/ttm_bo.h index 6ccf96c91f3ae..ef0f52f56ebc6 100644 --- a/include/drm/ttm/ttm_bo.h +++ b/include/drm/ttm/ttm_bo.h @@ -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;