Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp927229pxb; Mon, 16 Aug 2021 22:48:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTTdtnwfAfSjEuo/rmAl6Ohp0rZ2YChJEFTzjagld8pApkA7uj9uC2iXCCS0PWqFi8jAOq X-Received: by 2002:a17:907:1048:: with SMTP id oy8mr1959554ejb.382.1629179315992; Mon, 16 Aug 2021 22:48:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629179315; cv=none; d=google.com; s=arc-20160816; b=HvO2I0yV5dNn4XfXabNO7FV8RklpaQz0VBKHCi1qloXSVqAe53XfEcra85eDcrXGfU 5hcZH3QNhYjRG0D8MtQ1m3i10NtPp6PienWDSXJS08EYSs9dmFjGIZsdA/CTJUPXZ2NF SancTR5O8Ad5L95ivFckHdPOzJ0Kxu0xvoBwaCuEPfwZJtnSQ9oYRj93YaSVg0twNESA 5q3PM3zToLHU712ZkizLkvluU2rYA5pvO7UuX28TJ2cFx4FU90fh3Fo2NK5TMwjgMx1h G//YFGT2HkkVDifY+H9oJ5fdY1zeROF2+IyIpbi7M7gyghfvEms9CgkpjcMnIOdIZG7E wcIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=jqQrMdMtezDXikCeYGpeGD5SQ5o0Er/rVSYICvysOEU=; b=WxaPigwvdCP7QswaV5U4nOlkTUTiLV8J7DS/BNKCI0747kp62YpPLfmJmn6eGBO6+7 Xg1kDQwHyOzwa2CuMsTomf0HF/JQWHDTqwFEkgw1FbOxHi3gDd8h+YN/6T/B6DGTWn46 VaUp3K1+SiWOrkHK6gNVxXEMxQiDqiktMi2BZsr1YvTYq55XD8n7+3f56Jv3AeRVXYWn 47PN//C9CLTVRqyFbU9nwDEsGOfBrNk653RwMHdInQ8rbaOBrog5SAvo70wTv2Fp2suv r1lQa8HAJcrmT2bKdmv342PnkGxICo/rfp+BzNudsfqfvXURXUdJjavSPuJKZxWE3hYN NmiQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n19si1398735eds.562.2021.08.16.22.48.07; Mon, 16 Aug 2021 22:48:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234155AbhHQFsX (ORCPT + 99 others); Tue, 17 Aug 2021 01:48:23 -0400 Received: from verein.lst.de ([213.95.11.211]:57146 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233928AbhHQFsX (ORCPT ); Tue, 17 Aug 2021 01:48:23 -0400 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) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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.