Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp1651338img; Tue, 19 Mar 2019 12:19:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1+B7bEO16s6k2N0Lb72MVihgKzHw9njo4sKEhHV+/Tk9T80XWJjD3CnS6303uTbl1gDTF X-Received: by 2002:a17:902:2f:: with SMTP id 44mr3711521pla.139.1553023191725; Tue, 19 Mar 2019 12:19:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553023191; cv=none; d=google.com; s=arc-20160816; b=0ZG+hX+STgLLL7di+mvqxGj6zKeE385Z0kWXdfdmGcE1+ekl2KO0kJH67XtX70oNQu 7z3kzLoA2Frqk+O7E5qacsFokZ3FLWHQrTwcRQ+nsPedny0B232jFtxDuXFDh75dU4/M uUaxKrVgn5TWBbWp+3vkN2Fefa6YaNxd5gSUO9MmG81Q9B0heIgamy3RFB6o9GmvSRV2 bGJLU7+ucFTSkbd3mA6qHZXwEQdKKqLxUl3/hX9j5rQq8ApWsLfXcag/sCKoCZhfWJ+0 p98btrwvoRVMEf+SpoNtCFjTdmZVQ0G7Qp9/WMskONL955YT2L1vFqrR0ByLdAJm8DgT 2HnA== 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=SqKyDsIrCNZj0LNUi/jOz4p3YnLcroRbSoQ664QRnt8=; b=eLD8LkW3ria4ZXzdgu6JBG9GkyShPdBP5iyLVPYu9mvjN3aQoZGVKKtNLlAg3Crlzb AqPkY3heydJz0IFPouI0fzzgmdcjvM4yYj6D1WfeJ61bf5HyFlTkaZiciFFa9Jw6olzk w+5+Zuok1kbx6mcgz2edV6fPp+/V5pOaBAIxMDKz6PemIAdAnwdb6aRoyMlJ/kA4qp7d Tp/UwvnQnTR4Zc6J3iN6+M6TFZuNV/xvwZBIBTyxV7zO32cPeraV2dnWZx8w5PCa/6ZW AdnUyDqxuTvS1wYY1jOZNoL2M6iq7m03dcmz3HhkP/5YHC/lhD3FHDVNqnbM/CqJLabp ivfw== 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 j71si12946687pfc.280.2019.03.19.12.19.36; Tue, 19 Mar 2019 12:19:51 -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 S1727117AbfCSTSx (ORCPT + 99 others); Tue, 19 Mar 2019 15:18:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48942 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726753AbfCSTSx (ORCPT ); Tue, 19 Mar 2019 15:18:53 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8069C307EA87; Tue, 19 Mar 2019 19:18:52 +0000 (UTC) Received: from redhat.com (unknown [10.20.6.236]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7CA676ACE0; Tue, 19 Mar 2019 19:18:51 +0000 (UTC) Date: Tue, 19 Mar 2019 15:18:49 -0400 From: Jerome Glisse To: Dan Williams Cc: Andrew Morton , Linux MM , Linux Kernel Mailing List , Felix Kuehling , Christian =?iso-8859-1?Q?K=F6nig?= , Ralph Campbell , John Hubbard , Jason Gunthorpe , Alex Deucher Subject: Re: [PATCH 00/10] HMM updates for 5.1 Message-ID: <20190319191849.GA4310@redhat.com> References: <20190318170404.GA6786@redhat.com> <20190319094007.a47ce9222b5faacec3e96da4@linux-foundation.org> <20190319165802.GA3656@redhat.com> <20190319101249.d2076f4bacbef948055ae758@linux-foundation.org> <20190319171847.GC3656@redhat.com> <20190319174552.GA3769@redhat.com> <20190319190528.GA4012@redhat.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.10.0 (2018-05-17) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Tue, 19 Mar 2019 19:18:52 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 19, 2019 at 12:13:40PM -0700, Dan Williams wrote: > On Tue, Mar 19, 2019 at 12:05 PM Jerome Glisse wrote: > > > > On Tue, Mar 19, 2019 at 11:42:00AM -0700, Dan Williams wrote: > > > On Tue, Mar 19, 2019 at 10:45 AM Jerome Glisse wrote: > > > > > > > > On Tue, Mar 19, 2019 at 10:33:57AM -0700, Dan Williams wrote: > > > > > On Tue, Mar 19, 2019 at 10:19 AM Jerome Glisse wrote: > > > > > > > > > > > > On Tue, Mar 19, 2019 at 10:12:49AM -0700, Andrew Morton wrote: > > > > > > > On Tue, 19 Mar 2019 12:58:02 -0400 Jerome Glisse wrote: > > > > > [..] > > > > > > > Also, the discussion regarding [07/10] is substantial and is ongoing so > > > > > > > please let's push along wth that. > > > > > > > > > > > > I can move it as last patch in the serie but it is needed for ODP RDMA > > > > > > convertion too. Otherwise i will just move that code into the ODP RDMA > > > > > > code and will have to move it again into HMM code once i am done with > > > > > > the nouveau changes and in the meantime i expect other driver will want > > > > > > to use this 2 helpers too. > > > > > > > > > > I still hold out hope that we can find a way to have productive > > > > > discussions about the implementation of this infrastructure. > > > > > Threatening to move the code elsewhere to bypass the feedback is not > > > > > productive. > > > > > > > > I am not threatening anything that code is in ODP _today_ with that > > > > patchset i was factering it out so that i could also use it in nouveau. > > > > nouveau is built in such way that right now i can not use it directly. > > > > But i wanted to factor out now in hope that i can get the nouveau > > > > changes in 5.2 and then convert nouveau in 5.3. > > > > > > > > So when i said that code will be in ODP it just means that instead of > > > > removing it from ODP i will keep it there and it will just delay more > > > > code sharing for everyone. > > > > > > The point I'm trying to make is that the code sharing for everyone is > > > moving the implementation closer to canonical kernel code and use > > > existing infrastructure. For example, I look at 'struct hmm_range' and > > > see nothing hmm specific in it. I think we can make that generic and > > > not build up more apis and data structures in the "hmm" namespace. > > > > Right now i am trying to unify driver for device that have can support > > the mmu notifier approach through HMM. Unify to a superset of driver > > that can not abide by mmu notifier is on my todo list like i said but > > it comes after. I do not want to make the big jump in just one go. So > > i doing thing under HMM and thus in HMM namespace, but once i tackle > > the larger set i will move to generic namespace what make sense. > > > > This exact approach did happen several time already in the kernel. In > > the GPU sub-system we did it several time. First do something for couple > > devices that are very similar then grow to a bigger set of devices and > > generalise along the way. > > > > So i do not see what is the problem of me repeating that same pattern > > here again. Do something for a smaller set before tackling it on for > > a bigger set. > > All of that is fine, but when I asked about the ultimate trajectory > that replaces hmm_range_dma_map() with an updated / HMM-aware GUP > implementation, the response was that hmm_range_dma_map() is here to > stay. The issue is not with forking off a small side effort, it's the > plan to absorb that capability into a common implementation across > non-HMM drivers where possible. hmm_range_dma_map() is a superset of gup_range_dma_map() because on top of gup_range_dma_map() the hmm version deals with mmu notifier. But everything that is not mmu notifier related can be share through gup_range_dma_map() so plan is to end up with: hmm_range_dma_map(hmm_struct) { hmm_mmu_notifier_specific_prep_step(); gup_range_dma_map(hmm_struct->common_base_struct); hmm_mmu_notifier_specific_post_step(); } ie share as much as possible. Does that not make sense ? To get there i will need to do non trivial addition to GUP and so i went first to get HMM bits working and then work on common gup API. Cheers, J?r?me