From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70B3BC432BE for ; Tue, 17 Aug 2021 05:47:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BA25960F39 for ; Tue, 17 Aug 2021 05:47:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BA25960F39 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 3D7706B006C; Tue, 17 Aug 2021 01:47:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3856B8D0001; Tue, 17 Aug 2021 01:47:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 29A756B0073; Tue, 17 Aug 2021 01:47:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0198.hostedemail.com [216.40.44.198]) by kanga.kvack.org (Postfix) with ESMTP id 137B56B006C for ; Tue, 17 Aug 2021 01:47:52 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id A247722AD3 for ; Tue, 17 Aug 2021 05:47:51 +0000 (UTC) X-FDA: 78483491142.02.550E995 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf21.hostedemail.com (Postfix) with ESMTP id C1DBED022B68 for ; Tue, 17 Aug 2021 05:47:50 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id C7A586736F; Tue, 17 Aug 2021 07:47:47 +0200 (CEST) Date: Tue, 17 Aug 2021 07:47:47 +0200 From: Christoph Hellwig To: Felix Kuehling Cc: Christoph Hellwig , Alex Sierra , akpm@linux-foundation.org, linux-mm@kvack.org, rcampbell@nvidia.com, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, jgg@nvidia.com, jglisse@redhat.com Subject: Re: [PATCH v6 04/13] drm/amdkfd: add SPM support for SVM Message-ID: <20210817054747.GA4895@lst.de> References: <20210813063150.2938-1-alex.sierra@amd.com> <20210813063150.2938-5-alex.sierra@amd.com> <20210815091000.GB25067@lst.de> <0ecf3253-5c77-e982-981a-b340ff705838@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0ecf3253-5c77-e982-981a-b340ff705838@amd.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Rspamd-Queue-Id: C1DBED022B68 Authentication-Results: imf21.hostedemail.com; dkim=none; spf=none (imf21.hostedemail.com: domain of hch@lst.de has no SPF policy when checking 213.95.11.211) smtp.mailfrom=hch@lst.de; dmarc=none X-Rspamd-Server: rspam01 X-Stat-Signature: cwmgegzq9187dgeipqghcfgpknk1rkd7 X-HE-Tag: 1629179270-294391 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: On Mon, Aug 16, 2021 at 02:54:30PM -0400, Felix Kuehling wrote: > I think you're right. We only need the start and end address from > lookup_resource and we already know that anyway. It means we can drop > patch 3 from the series. > > Just to be sure, we'll confirm that the end address determined by our > driver matches the one from lookup_resource (coming from the system > address map in the system BIOS). If there were a mismatch, it would > probably be a bug (in the driver or the BIOS) that we'd need to fix anyway. Or rather that the driver claimed area is smaller or the same as the bios range. No harm (except for potential peformance implications) when you don't use all of it. > I don't really see the "mess" you're talking about. Including the above, > there are only 3 conditional statements in that function that are not > error-handling related: > > /* Page migration works on Vega10 or newer */ > if (kfddev->device_info->asic_family < CHIP_VEGA10) > return -EINVAL; > ... > if (xgmi_connected_to_cpu) > res = lookup_resource(&iomem_resource, adev->gmc.aper_base); > else > res = devm_request_free_mem_region(adev->dev, &iomem_resource, size); > ... > pgmap->type = xgmi_connected_to_cpu ? > MEMORY_DEVICE_GENERIC : MEMORY_DEVICE_PRIVATE; > Plus the devm_release_mem_region error handling that is currently missing.