From: Huang Rui <ray.huang@amd.com>
To: "Zhu, Lingshan" <Lingshan.Zhu@amd.com>
Cc: "Koenig, Christian" <Christian.Koenig@amd.com>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
Jingxiang Li <jingxiang.li@ecarxgroup.com>
Subject: Re: [PATCH] drm/ttm: increase ttm pre-fault value to PMD size
Date: Thu, 30 May 2024 12:02:53 +0800 [thread overview]
Message-ID: <Zlf6be9KcW5xyVC0@amd.com> (raw)
In-Reply-To: <20240530034104.338561-1-lingshan.zhu@amd.com>
On Thu, May 30, 2024 at 11:41:04AM +0800, Zhu, Lingshan wrote:
> 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>
Thanks Lingshan.
I suggested to add reported-by from Jiangxiang like that:
Reported-by: Jingxiang Li <jingxiang.li@ecarxgroup.com>
Jingxiang, could you please test this patch? We expect to have a Tested-by. :-)
Thanks,
Ray
> ---
> include/drm/ttm/ttm_bo.h | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/include/drm/ttm/ttm_bo.h b/include/drm/ttm/ttm_bo.h
> index 6ccf96c91f3a..c20ef44002da 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 */
> -#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;
>
> --
> 2.45.1
>
next prev parent reply other threads:[~2024-05-30 4:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-30 3:41 [PATCH] drm/ttm: increase ttm pre-fault value to PMD size Zhu Lingshan
2024-05-30 4:02 ` Huang Rui [this message]
2024-05-30 7:51 ` Zhu Lingshan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Zlf6be9KcW5xyVC0@amd.com \
--to=ray.huang@amd.com \
--cc=Christian.Koenig@amd.com \
--cc=Lingshan.Zhu@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jingxiang.li@ecarxgroup.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.