Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp8271408rwp; Wed, 19 Jul 2023 07:37:58 -0700 (PDT) X-Google-Smtp-Source: APBJJlE7RIhubdVjsNqMGrVC/4KpWErwW8ORM4k7URMUTvIAgcWvHNS294rFRsYLkwUj/336uKf5 X-Received: by 2002:a17:907:7e9a:b0:987:16c6:6ff3 with SMTP id qb26-20020a1709077e9a00b0098716c66ff3mr2812654ejc.38.1689777477762; Wed, 19 Jul 2023 07:37:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689777477; cv=pass; d=google.com; s=arc-20160816; b=elK+UpBwyS5bg0MoPN1sFerxk1bxK7NE/W31fmi+h7UAYEPm12RzXbrX9TbCSJ3Eub bUvluSfS0e17mEmeTLWX/8GMxKF4iqBSWvPIohqQPd1eHUjj8pSsBQx3g4pq9yDNBpk3 hxwjKW5ndyeG28Vsk6Bsjpfqbxe0YbuP+LnULtPWzmxMMfxTx6T9mjvNLT9+hHGfc2nP Jn+ncBVd8z1l05rgfRqn+pgUbvm055c8cIvit8er5/4HVZfhuX7TJa9ONK51cX0Mws2e 90rXXHqNJCCxcqqVTpU8HA6WXVMvHK3lm1zx3Paqr52PqvukDZsZwONoASzBiH8QqFHg lGbA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=JiTW8fCjX/4q7DDyRSjV238D/QVT/rwNhUJ0BOiO6vE=; fh=PShuJ7CZTPgmfVM5ETSV9DrlNm178h/wCI1WeRFG2DQ=; b=lqfCgGs1Twzeeu/bNMAT9Me+bSLhJ5hzi1Mn7DE63J9lzES/iItYocGv7oUZ0HsZjg vhdZBAppM+BMT1Q5wo2gl5r14zBcf6z+MK/SeNKJXptFCAAB/Jg9SKAaCKYA404zji9g wbmvpoulT1LuAbxb+Rppxu7AAw3VemhpJ1GtLQ7zyHc25Zuxbf/PcQjb2w2tQbLfl8nJ x5kI4bZgqjHq09HsWp/GSgjfxqhGv7tZGajh3qmkxxDbVnyP92un4YX2Rx30pGDUygzm pY+8+enrLoL2emXdioFhAyKbgIF2ovam+1mAKMd5CxBcIry6UGwQEW2scy18MCk6CRwS hrUQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=RI8ipCUV; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d11-20020a170906370b00b00992f45c9343si2799533ejc.1025.2023.07.19.07.37.31; Wed, 19 Jul 2023 07:37:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=RI8ipCUV; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231603AbjGSOZH (ORCPT + 99 others); Wed, 19 Jul 2023 10:25:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231608AbjGSOZB (ORCPT ); Wed, 19 Jul 2023 10:25:01 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2040.outbound.protection.outlook.com [40.107.93.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CBB926BF; Wed, 19 Jul 2023 07:24:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QI6sOzi+gtQNdbN9C9GztwX037PSU2qhwGRIMd/ULjCFzbtl6G3vaGFx69Ru1dK2qxwYfscPcjX7u6az40Zuas8P2TIXBwRmBXSngKlE0q82RopW/vblRncDIe+/Y3xZzl3DeaCACmPW7kHidfJPFdQD2ycLHD5f4gesGlnSTv6YFpEINOYs2eIHDe/1ya/cDnqio0tJ1GlKWq5c4/eHIPGOeIQsgK4Y0HHwuIrY0itAVrwwYE/woVCFvByXlBC1cC4EWZoHxjmCvfclmNGCm4rQybJjlhQLheVJbjyFLNkaVATnLk39tlnQgrl8RZl6V+7u2T9yyBc7AVHnY0h86A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JiTW8fCjX/4q7DDyRSjV238D/QVT/rwNhUJ0BOiO6vE=; b=HY35YnX8iZAJYNOVeC4Aj1Dc5oo6aDFeOITJq49ORmFY01L2PElKQiKuNFCv9H4HgW+RZGDp/drbb6vJlR2897IW7zfIp0nlEGw3s99nhuKO6GCJiWKCTUO2MhY4TbhfyooCG8ErX+6Ml8jAo2b/rUaUtZikyj1WV5kqedoaneUwjonYfhz5WkfXrppi8MRsZs4PkFimUwJcJItmBcDkoEaCRdlR/5mcIF3CVY6P/AeVP8j0sgPCBGwhBYrqiaXJl2uK8018am8YHGZrZC49bIMUz0iQQdP6fAmsufU2xb/Ji+nWhSFdFAJUJlVoVvxFEgxceRJzcPbgaYxIWOifAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JiTW8fCjX/4q7DDyRSjV238D/QVT/rwNhUJ0BOiO6vE=; b=RI8ipCUVyRQQgyvzjHqzmMZkkYuMs7UfgrnLQD6lfqMKKp0P96fgQmoQ2/5h+kXQ2V7x0P+4j8G+zET0DUt+GNYsHIw8qBKxAJBaoRHl993HvswGMTQANS3/yvXtKNe2U1Ad+EpZCFy/oTVJckWowftSS4mmIpNfjItNWbqDhkM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BN9PR12MB5115.namprd12.prod.outlook.com (2603:10b6:408:118::14) by BL3PR12MB6546.namprd12.prod.outlook.com (2603:10b6:208:38d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Wed, 19 Jul 2023 14:24:37 +0000 Received: from BN9PR12MB5115.namprd12.prod.outlook.com ([fe80::ca28:efb4:a838:58fb]) by BN9PR12MB5115.namprd12.prod.outlook.com ([fe80::ca28:efb4:a838:58fb%4]) with mapi id 15.20.6609.024; Wed, 19 Jul 2023 14:24:37 +0000 Message-ID: <8b547ba9-45bb-312c-293f-356b5bea01c7@amd.com> Date: Wed, 19 Jul 2023 10:24:33 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v2 2/4] drm/amdkfd: use vma_is_initial_stack() and vma_is_initial_heap() Content-Language: en-US To: Kefeng Wang , Andrew Morton Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-perf-users@vger.kernel.org, selinux@vger.kernel.org, Alex Deucher , =?UTF-8?Q?Christian_K=c3=b6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter References: <20230719075127.47736-1-wangkefeng.wang@huawei.com> <20230719075127.47736-3-wangkefeng.wang@huawei.com> From: Felix Kuehling In-Reply-To: <20230719075127.47736-3-wangkefeng.wang@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: YQBPR0101CA0140.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:e::13) To BN9PR12MB5115.namprd12.prod.outlook.com (2603:10b6:408:118::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN9PR12MB5115:EE_|BL3PR12MB6546:EE_ X-MS-Office365-Filtering-Correlation-Id: 4144b76c-73e1-4298-7dc1-08db8863e16c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: K8/s9c9gpEtTTD5iV+55HocmMU3c/dddZ6HOlFsLY90f1RZ9fx51+cmnVGOCC86xxqNjZQ44pIYb6Lo44qjrOvcvdzlrEivSSuEHRxa9+PiSW8VbVDApzVWbFUoSVydb8lYP7aVA+dQQqgo9uc4Y7DlftYJGNhcSoD5wfS4NsmT1FY0pqJljqBrYBwiIYpI4l1BrRiiiWncDgznn7ZyivLTaCAl/dLVQh+yncEXt/LMheF5R1QxG7VfK0pu4SjebkeOJ9/D6F1Axx2cemAmMR1ePcQNSCj8UfcXsldTfLiXyp6TCZ6xjWEHr++7I5Hn2KzZGVlAjdeE3djJxxYjy1WoV+73ZVmbBbtR9Mg/hxtMa56CbXpMjaiwLkKHiqrYGh5cDTl8K+kMQqdwIyg12fIJCNQaz3A2HkydnQXSpGEVGIhSf8nSKe78ZQzNSDoqmiuOI9BLcA4K0yQvtkv5anrX94LxnDO7LZMLk8I2T9SMBi65M6FwTa0hKOaLc5bACjtzpaqYqpdhDsR/6G/bA/60wDzYXGmtgfMS9SJotkkEqesY28vnro90o2jKpCoIQuog4PM/CWXRVrMu2lZr0TRmbnKM9aQIyClJ+lXjmM5eX3G5LBcIG5eRPEkJCm8ZvhjrPwtfARg9Iz6pWacGrTQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN9PR12MB5115.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(396003)(39860400002)(376002)(366004)(136003)(451199021)(66946007)(54906003)(6486002)(110136005)(41300700001)(478600001)(8676002)(8936002)(5660300002)(6666004)(66476007)(66556008)(6512007)(4326008)(2616005)(316002)(66574015)(83380400001)(186003)(26005)(6506007)(38100700002)(31696002)(86362001)(36756003)(7416002)(44832011)(2906002)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?M3FZVW1jVFRjVW1UcmdKcTQyTW83bGpLSHJiTVRMK3dVWFNxbHJQVDdCZHFO?= =?utf-8?B?bktiYkpVYy9Vd0RGSzNNc2YrcmFSaXg1QzNkdFp2NnhlN3Vyc0pPS056cFJD?= =?utf-8?B?c2RpQy9TKzdSWlFCZDkzQ3llNGVFbGFybUpGZElsQmp1RVZmR1BTUitsL1pO?= =?utf-8?B?YytPRHlET3dYZHRxNVJXMG03NDc4ZVJGWHY3UHREMTRWNDBkQXMvTWlQYTlQ?= =?utf-8?B?YmFLUVFwRkdDM1JvL1RyLzNuMS9uK3dYRDNWYlA3MWVSeUV3RjF4eVluL3Fk?= =?utf-8?B?b0RNZGFrdVVIajdaL2IxSHNXVW5OMnNkSC9iaWhoRFBJL0kyRHU2TGUxM21P?= =?utf-8?B?SDBlRXVFSj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-Id: 4144b76c-73e1-4298-7dc1-08db8863e16c X-MS-Exchange-CrossTenant-AuthSource: BN9PR12MB5115.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 14:24:36.9856 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VMONTdcPTmTQCYzKTQBdirY9O5MRcWMIMiyW9FCa5ox8nCg8KayC4GgW0qNCTbAxEhI+7UehTqpytCcLBLk5NA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR12MB6546 X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 2023-07-19 um 03:51 schrieb Kefeng Wang: > 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 > Signed-off-by: Kefeng Wang Reviewed-by: Felix Kuehling > --- > 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));