drm/ttm: increase ttm pre-fault value to PMD size
Subsystems (2)
PATCH 1/1 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.
--- include/drm/ttm/ttm_bo.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
include/drm/ttm/ttm_bo.h +5 -1
@@ -39,7 +39,11 @@#include "ttm_device.h" /* Default number of pre-faulted pages in the TTM fault handler */ -#define TTM_BO_VM_NUM_PREFAULT 16 +#ifdef CONFIG_PGTABLE_HAS_HUGE_LEAVES +#define TTM_BO_VM_NUM_PREFAULT (1 << (PMD_SHIFT - PAGE_SHIFT)) +#else +#define TTM_BO_VM_NUM_PREFAULT 16 +#endif struct iosys_map ;
Signature · 1 line
2.45.1
Quoted 4 lines · Lingshan
ttm page fault handler
ttm_bo_vm_fault_reserved()mapsTTM_BO_VM_NUM_PREFAULTmore pages beforehand due to the principle of locality.
Quoted 8 lines
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 <[email protected]>
Thanks Lingshan.
I suggested to add reported-by from Jiangxiang like that:
Jingxiang, could you please test this patch? We expect to have a Tested-by. :-)
Thanks,
Ray
Quoted 24 lines
--- include/drm/ttm/ttm_bo.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)include/drm/ttm/ttm_bo.h +5
-1@@ -39,7 +39,11 @@#include "ttm_device.h" /* Default number of pre-faulted pages in the TTM fault handler */ -#define TTM_BO_VM_NUM_PREFAULT 16 +#ifdef CONFIG_PGTABLE_HAS_HUGE_LEAVES +#define TTM_BO_VM_NUM_PREFAULT (1 << (PMD_SHIFT - PAGE_SHIFT)) +#else +#define TTM_BO_VM_NUM_PREFAULT 16 +#endif struct iosys_map ;Signature · 1 line
2.45.1
Please ignore this patch, V2 will be send out soon
Thanks
Zhu Lingshan
Quoted 48 lines · Huang Rui
Quoted 4 lines · Lingshan
ttm page fault handler
ttm_bo_vm_fault_reserved()mapsTTM_BO_VM_NUM_PREFAULTmore pages beforehand due to the principle of locality.Quoted 8 lines
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 <[email protected]>Thanks Lingshan.
I suggested to add reported-by from Jiangxiang like that:
Reported-by Jingxiang Li <[email protected]>Jingxiang, could you please test this patch? We expect to have a Tested-by. :-)
Thanks,
RayQuoted 24 lines
--- include/drm/ttm/ttm_bo.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)include/drm/ttm/ttm_bo.h +5
-1@@ -39,7 +39,11 @@#include "ttm_device.h" /* Default number of pre-faulted pages in the TTM fault handler */ -#define TTM_BO_VM_NUM_PREFAULT 16 +#ifdef CONFIG_PGTABLE_HAS_HUGE_LEAVES +#define TTM_BO_VM_NUM_PREFAULT (1 << (PMD_SHIFT - PAGE_SHIFT)) +#else +#define TTM_BO_VM_NUM_PREFAULT 16 +#endif struct iosys_map ;Signature · 1 line
2.45.1