Re: [PATCH] drm/ttm: fix ttm tt init fail when size exceeds kmalloc limit

2022-04-20 Thread Christian König
; dri-devel@lists.freedesktop.org ; amd-...@lists.freedesktop.org *Subject:* Re: [PATCH] drm/ttm: fix ttm tt init fail when size exceeds kmalloc limit On 2022-04-20 09:23, Lazar, Lijo wrote: > > > On 4/20/2022 6:26 PM, Christian König wrote: >> Am 20.04.22 um 14:54 schrieb W

Re: [PATCH] drm/ttm: fix ttm tt init fail when size exceeds kmalloc limit

2022-04-20 Thread Wang, Yang(Kevin)
m should allocate 1TB/4k * 8 buffer to >>>>> store allocate result (page address), this should not be failed >>>>> usually. >>>>> >>>>> There is a similar fix in upstream kernel 5.18, before this fix >>>>> entered the TTM code, this problem exis

Re: [PATCH] drm/ttm: fix ttm tt init fail when size exceeds kmalloc limit

2022-04-20 Thread Felix Kuehling
egards, Kevin *From:* Koenig, Christian *Sent:* Wednesday, April 20, 2022 8:42 PM *To:* Wang, Yang(Kevin) ; Christian König ; dri-devel@lists.freedesktop.org ; amd-...@lists.freedesktop.org *Subject:* Re: [PATCH] drm/ttm: fix ttm tt init fail when size exceeds kmal

Re: [PATCH] drm/ttm: fix ttm tt init fail when size exceeds kmalloc limit

2022-04-20 Thread Lazar, Lijo
g ; amd-...@lists.freedesktop.org *Subject:* Re: [PATCH] drm/ttm: fix ttm tt init fail when size exceeds kmalloc limit Hi Kevin, yes and that is perfectly valid and expected behavior. There is absolutely no need to change anything in TTM here. What we could do is: 1) Change the test case to use something larger t

Re: [PATCH] drm/ttm: fix ttm tt init fail when size exceeds kmalloc limit

2022-04-20 Thread Wang, Yang(Kevin)
gt; <mailto:dri-devel@lists.freedesktop.org>; amd-...@lists.freedesktop.org<mailto:amd-...@lists.freedesktop.org> <mailto:amd-...@lists.freedesktop.org> Subject: Re: [PATCH] drm/ttm: fix ttm tt init fail when size exceeds kmalloc limit Hi Kevin, no, the test case should already fail i

Re: [PATCH] drm/ttm: fix ttm tt init fail when size exceeds kmalloc limit

2022-04-20 Thread Wang, Yang(Kevin)
) ; Christian König ; dri-devel@lists.freedesktop.org ; amd-...@lists.freedesktop.org Subject: Re: [PATCH] drm/ttm: fix ttm tt init fail when size exceeds kmalloc limit Hi Kevin, yes and that is perfectly valid and expected behavior. There is absolutely no need to change anything in TTM here. What we

Re: [PATCH] drm/ttm: fix ttm tt init fail when size exceeds kmalloc limit

2022-04-20 Thread Wang, Yang(Kevin)
; amd-...@lists.freedesktop.org Subject: Re: [PATCH] drm/ttm: fix ttm tt init fail when size exceeds kmalloc limit Hi Kevin, no, the test case should already fail in amdgpu_bo_validate_size(). If we have a system with 2TiB of memory where the test case could succeed then we should incr

Re: [PATCH] drm/ttm: fix ttm tt init fail when size exceeds kmalloc limit

2022-04-20 Thread Christian König
d-...@lists.freedesktop.org> <mailto:amd-...@lists.freedesktop.org> *Subject:* Re: [PATCH] drm/ttm: fix ttm tt init fail when size exceeds kmalloc limit Am 20.04.22 um 10:56 schrieb Yang Wang: > if the __GFP_ZERO is set, the kvmalloc() can't fallback to use vmalloc() Hui what? Why should kvmallo

Re: [PATCH] drm/ttm: fix ttm tt init fail when size exceeds kmalloc limit

2022-04-20 Thread Wang, Yang(Kevin)
lloc Best Regards, Kevin From: Koenig, Christian Sent: Wednesday, April 20, 2022 6:53 PM To: Wang, Yang(Kevin) ; dri-devel@lists.freedesktop.org ; amd-...@lists.freedesktop.org Subject: Re: [PATCH] drm/ttm: fix ttm tt init fail when size exceeds kmalloc limit A

Re: [PATCH] drm/ttm: fix ttm tt init fail when size exceeds kmalloc limit

2022-04-20 Thread Christian König
-...@lists.freedesktop.org *Subject:* Re: [PATCH] drm/ttm: fix ttm tt init fail when size exceeds kmalloc limit Am 20.04.22 um 10:56 schrieb Yang Wang: > if the __GFP_ZERO is set, the kvmalloc() can't fallback to use vmalloc() Hui what? Why should kvmalloc() not be able to fallback to vmallo

Re: [PATCH] drm/ttm: fix ttm tt init fail when size exceeds kmalloc limit

2022-04-20 Thread Wang, Yang(Kevin)
[AMD Official Use Only] From: Koenig, Christian Sent: Wednesday, April 20, 2022 5:00 PM To: Wang, Yang(Kevin) ; dri-devel@lists.freedesktop.org ; amd-...@lists.freedesktop.org Subject: Re: [PATCH] drm/ttm: fix ttm tt init fail when size exceeds kmalloc limit

Re: [PATCH] drm/ttm: fix ttm tt init fail when size exceeds kmalloc limit

2022-04-20 Thread Christian König
Am 20.04.22 um 10:56 schrieb Yang Wang: if the __GFP_ZERO is set, the kvmalloc() can't fallback to use vmalloc() Hui what? Why should kvmalloc() not be able to fallback to vmalloc() when __GFP_ZERO is set? And even that is really the case then that sounds like a bug in kvmalloc(). Regards,

[PATCH] drm/ttm: fix ttm tt init fail when size exceeds kmalloc limit

2022-04-20 Thread Yang Wang
if the __GFP_ZERO is set, the kvmalloc() can't fallback to use vmalloc() to allocate memory, when request size is exceeds kmalloc limit, it will cause allocate memory fail. e.g: when ttm want to create a BO with 1TB size, it maybe fail. Signed-off-by: Yang Wang --- drivers/gpu/drm/ttm/ttm_tt.c