From patchwork Fri Jul 28 05:00:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13331187 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0488C41513 for ; Fri, 28 Jul 2023 04:48:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3D1D36B0074; Fri, 28 Jul 2023 00:48:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 35B736B0075; Fri, 28 Jul 2023 00:48:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 188466B0078; Fri, 28 Jul 2023 00:48:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 060F06B0074 for ; Fri, 28 Jul 2023 00:48:34 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id BFA58160414 for ; Fri, 28 Jul 2023 04:48:33 +0000 (UTC) X-FDA: 81059789706.22.518BC35 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf17.hostedemail.com (Postfix) with ESMTP id 7773C40009 for ; Fri, 28 Jul 2023 04:48:30 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf17.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690519711; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TD9L4lC/bWfizvKwNSfd2+Bp+MhdORLoRxAYAh2SyGE=; b=0I/mGFtE7MXCxQlOLImR++QRCIP/cdM7Z10bHGbSmi3Z0nz5ae1usm2I82UmB3j8TAUeic hIR2c1TqiuLz93nPNL2OV+CKcH5d6EWvRBIA7KhTM0uGGW6IdJkZ6sRVAFOKIA1tY2cY0u MAiW76A29o8zlJcIa2da3C8jzklGNt4= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf17.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690519711; a=rsa-sha256; cv=none; b=IHD/fvT7qjtQpTItllEItbw8yYPrVAsUpmPbYhHUOhyKdgLkIT1JPS+nyRr7tdulMESISk AO66iouV2nb0aMOo9V9hhxBToP/WJ9F80hzX/CCYlhGZK2QmIajmpMSgR04V0T1Q1ZXrwj /uvzGaCj4fS5if0Ts8D17USd9bk5WT8= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4RBw9H5nhFz1GDJX; Fri, 28 Jul 2023 12:47:31 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 28 Jul 2023 12:48:26 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , , , =?utf-8?q?Christian_G=C3=B6ttsche?= , David Hildenbrand , Felix Kuehling , Alex Deucher , , , , , , , , , , Kefeng Wang Subject: [PATCH v3 2/4] drm/amdkfd: use vma_is_initial_stack() and vma_is_initial_heap() Date: Fri, 28 Jul 2023 13:00:41 +0800 Message-ID: <20230728050043.59880-3-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230728050043.59880-1-wangkefeng.wang@huawei.com> References: <20230728050043.59880-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 7773C40009 X-Stat-Signature: o41frfsp3hwms1mwnspdfzuis9cta6xg X-HE-Tag: 1690519709-600925 X-HE-Meta: U2FsdGVkX1/oUbr3w1OIysm/kLXKD9keS6nMH3iMCkHsg3Dva4uUIb6Pvv9nuWn6VFj4phfoYFav1Pd1fmeIltqla/GFXeEJCpHlFvlHMsZ9MJ6US+g4N2QKNURn7jbDyIpzsUQA8teFXV7rLWCmk2/mIMCj5oNzpDndS3Jl9lvKNeTIAfPOty4+Hq5LTAPjgqj+RB/NdStlTrCo//hvJvJj8zCZbsgbAfmGPapbWkIgMoohwaRBSIyqI0mF9f/U/Cc84ZrEnlvgiI6i9wyZOIBry0E4imYJPtZucayih4kaulp7jYhstu6kwkb+/Fs6LkB/++TntB/8EvRX3TSbBHZZD2FFHMPZlWOG4JSU7EZtnjrxiqInktlAW9XCENPubdarnApQl8WpARXXmxUTrlXjLHIupK4Pcb8EaORbr3fzi47lA4d/Q7ukzdSfyM7zcKp8SFc90Ze7of0BnA+XLQlyyGorcuoRNO3GuFSqqlMix/xQFos/eSlbHR7ulNE4051shQgQD+x11BS4r1iwG0VOMQc6TeLUAK0jk3asy84KncUXquAjtyyg6s8P0hk0Ho2rwzWB/STPUsBkQ7+jJVuiG3/m4/YPfIkomwys8GPD2Xv5XcMI+81rZ1mKIP9GyhgHpaJyy4NxOqMdr/uECp/Jutx6CGo5GehbEM7xDDPdGU9Vr4EmhvhmOsk69CF7H4xz6knNbYwPSQ4UTiJrrcvi8XSPTuKXHWvwoviE4w9n73TAw0tw3I8khB6xV1MpB/BDcipA2u/SkTZnfKiSIHMhQMbqflbtBZyRJ6Z99zTAG2h22L9dUPvjhSTXs10ruJbCZBtaaqUWACF4gjGWtEp9cpATWo0su0toGlcTzq1M1rgPOGvyCifCxZ7pX58lve6o28ohhGd7uPXpT8WElWsofj+S7xRxAvNFYiBbuEKWKDfoDcgH2fJFu/uqkNFs8oNcQq0naY/O4zizjXh S4ANi+Rc RtRbz9lKCKktY2Bi5d5tMNC3sVFNNY2UhJ1tIFRA8ma81F54I1nxXQbW8wvKxKsMhognqW4ZQqit/T9Jnsh7NsTdzwImE64Aihhnt4DuIxqzNTHvawczIgmIUEDfDnN756XogJrsiwk/iQfwsp9xrqScV6vi2smTDGNQZKLwJVmp+uIoEJB1sI3jgRNZywm1eXpqvlzQeaYw/iR+GPsmL62FLYjNpw4US1zNFnUroLeeL7e+k4um2tacub83zbJopXxLt+wLBNmPhGmk967hpwVPcaXWxVx1ryUjsYTRX1rVwmh5J3bQ6AlgT6gY0H7HlchYLscGYLgRIYqlGiurqRW9jrA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Use the helpers to simplify code. Cc: Felix Kuehling Cc: Alex Deucher Cc: "Christian König" Cc: "Pan, Xinhui" Cc: David Airlie Cc: Daniel Vetter Reviewed-by: David Hildenbrand Reviewed-by: Felix Kuehling Signed-off-by: Kefeng Wang --- 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 01c7de2d6e19..308384dbc502 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c @@ -2624,10 +2624,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));