[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <149bdc44-eba1-1615-dd12-c3c324426dca@redhat.com>
Date: Wed, 19 Jul 2023 10:18:37 +0200
From: David Hildenbrand <david@...hat.com>
To: Kefeng Wang <wangkefeng.wang@...wei.com>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-mm@...ck.org, linux-perf-users@...r.kernel.org,
selinux@...r.kernel.org, Felix Kuehling <Felix.Kuehling@....com>,
Alex Deucher <alexander.deucher@....com>,
Christian König <christian.koenig@....com>,
"Pan, Xinhui" <Xinhui.Pan@....com>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>
Subject: Re: [PATCH v2 2/4] drm/amdkfd: use vma_is_initial_stack() and
vma_is_initial_heap()
On 19.07.23 09:51, Kefeng Wang wrote:
> Use the helpers to simplify code.
>
> Cc: Felix Kuehling <Felix.Kuehling@....com>
> Cc: Alex Deucher <alexander.deucher@....com>
> Cc: "Christian König" <christian.koenig@....com>
> Cc: "Pan, Xinhui" <Xinhui.Pan@....com>
> Cc: David Airlie <airlied@...il.com>
> Cc: Daniel Vetter <daniel@...ll.ch>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@...wei.com>
> ---
> drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
> index 5ff1a5a89d96..0b7bfbd0cb66 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
> @@ -2621,10 +2621,7 @@ svm_range_get_range_boundaries(struct kfd_process *p, int64_t addr,
> return -EFAULT;
> }
>
> - *is_heap_stack = (vma->vm_start <= vma->vm_mm->brk &&
> - vma->vm_end >= vma->vm_mm->start_brk) ||
> - (vma->vm_start <= vma->vm_mm->start_stack &&
> - vma->vm_end >= vma->vm_mm->start_stack);
> + *is_heap_stack = vma_is_initial_heap(vma) || vma_is_initial_stack(vma);
>
> start_limit = max(vma->vm_start >> PAGE_SHIFT,
> (unsigned long)ALIGN_DOWN(addr, 2UL << 8));
Certainly a valid refactoring, although questionable if such code should
care about that.
Reviewed-by: David Hildenbrand <david@...hat.com>
--
Cheers,
David / dhildenb
Powered by blists - more mailing lists