Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp75369ybl; Thu, 15 Aug 2019 12:59:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqxbhhsVAk7n7vfiyjS4wQW3RPuZ2vJhtGQom+abNbzqRrN8sa4XhuxDLgtLZBS29FQuz9OU X-Received: by 2002:a62:7a0f:: with SMTP id v15mr7055349pfc.35.1565899187187; Thu, 15 Aug 2019 12:59:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565899187; cv=none; d=google.com; s=arc-20160816; b=FFhZ0+kHX+dQI7hC5ksVWPjtrwbEgrFB6vUR1Gz84vVHndeezvjZ+94SR3Z2hOhRlR EWGnG+MA9tlB4d04cWsAHbMnbwJvDUEdmF+1vA/OHTxKl2XLmOPCtHrVhWqx9GvU4NTn TeRL4RWL7F/AXiI+EPwlVxAVNZ7jzED5WAYSNiBDZB8TLgqb6IRPHf0P/RnczYtZVGNY fGdwFTQMaFtslEURoBkYg/RZK1nKMi2bw01IgMhYFScgeWpC+m69rd1VpnRGclTvFH7E JdZ+lFB6Ln1zj8jcAyKXQ3T8Qhdh+NZ9daWE0YLWUXuxbGaFn2QQJlMJUNilo7XHgts9 oRHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=1Sl9m3ZUNvB7jsKLTx8er3R4jj1y5FKhGObeTw2X2Rs=; b=u2kpghjjvjjSfKdpbB5NDdDLOKWiM8hOBn3g4Rcx6tR4BrJjzGPACerjjjVVNCfEVY JgqoMDP2pBJrQU261gA/6EdHPuJ+7lG78utKhP6mmtmc+aJ6GWqkrLlzcnqE50ZDaz3P wH8QpYVJrgbjb53GUfnQe9N/efYJzXONWeIx77KuUm0+MWlBuNbOjX5ry8TbORUyORXv QQkfJJSiEnn5x2MvUImJB7JRo08iJHMYc1ocZEjt4CXLRivr1jHrqipPg+XsrXuNT6sh V5g8n3TTu+d4I9waXy7kPb9ZKy4SsOLPdRv/JdcvxEj7fU09anvafiN3+bXjGUhdG9Ql O9Uw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p11si1554958pjr.3.2019.08.15.12.59.31; Thu, 15 Aug 2019 12:59:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731903AbfHOSD2 (ORCPT + 99 others); Thu, 15 Aug 2019 14:03:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42196 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731200AbfHOSD2 (ORCPT ); Thu, 15 Aug 2019 14:03:28 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 161762A09AF; Thu, 15 Aug 2019 18:03:28 +0000 (UTC) Received: from redhat.com (unknown [10.20.6.178]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F1A13600CD; Thu, 15 Aug 2019 18:03:26 +0000 (UTC) Date: Thu, 15 Aug 2019 14:03:25 -0400 From: Jerome Glisse To: Dan Williams Cc: Jason Gunthorpe , Christoph Hellwig , Ben Skeggs , Felix Kuehling , Ralph Campbell , "linux-mm@kvack.org" , "nouveau@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" , "amd-gfx@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 04/15] mm: remove the pgmap field from struct hmm_vma_walk Message-ID: <20190815180325.GA4920@redhat.com> References: <20190806160554.14046-1-hch@lst.de> <20190806160554.14046-5-hch@lst.de> <20190807174548.GJ1571@mellanox.com> <20190808065933.GA29382@lst.de> <20190814073854.GA27249@lst.de> <20190814132746.GE13756@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 15 Aug 2019 18:03:28 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 14, 2019 at 07:48:28AM -0700, Dan Williams wrote: > On Wed, Aug 14, 2019 at 6:28 AM Jason Gunthorpe wrote: > > > > On Wed, Aug 14, 2019 at 09:38:54AM +0200, Christoph Hellwig wrote: > > > On Tue, Aug 13, 2019 at 06:36:33PM -0700, Dan Williams wrote: > > > > Section alignment constraints somewhat save us here. The only example > > > > I can think of a PMD not containing a uniform pgmap association for > > > > each pte is the case when the pgmap overlaps normal dram, i.e. shares > > > > the same 'struct memory_section' for a given span. Otherwise, distinct > > > > pgmaps arrange to manage their own exclusive sections (and now > > > > subsections as of v5.3). Otherwise the implementation could not > > > > guarantee different mapping lifetimes. > > > > > > > > That said, this seems to want a better mechanism to determine "pfn is > > > > ZONE_DEVICE". > > > > > > So I guess this patch is fine for now, and once you provide a better > > > mechanism we can switch over to it? > > > > What about the version I sent to just get rid of all the strange > > put_dev_pagemaps while scanning? Odds are good we will work with only > > a single pagemap, so it makes some sense to cache it once we find it? > > Yes, if the scan is over a single pmd then caching it makes sense. Quite frankly an easier an better solution is to remove the pagemap lookup as HMM user abide by mmu notifier it means we will not make use or dereference the struct page so that we are safe from any racing hotunplug of dax memory (as long as device driver using hmm do not have a bug). Cheers, J?r?me