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=-2.3 required=3.0 tests=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 957CCC10F29 for ; Tue, 17 Mar 2020 12:32:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5CD8F20757 for ; Tue, 17 Mar 2020 12:32:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5CD8F20757 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 03AC96B0005; Tue, 17 Mar 2020 08:32:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F2D9D6B0006; Tue, 17 Mar 2020 08:32:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E1C676B0007; Tue, 17 Mar 2020 08:32:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0132.hostedemail.com [216.40.44.132]) by kanga.kvack.org (Postfix) with ESMTP id C6C086B0005 for ; Tue, 17 Mar 2020 08:32:13 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 7FBFD3CE1 for ; Tue, 17 Mar 2020 12:32:13 +0000 (UTC) X-FDA: 76604791746.19.word74_3079e455a5545 X-HE-Tag: word74_3079e455a5545 X-Filterd-Recvd-Size: 2578 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf06.hostedemail.com (Postfix) with ESMTP for ; Tue, 17 Mar 2020 12:32:13 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 6DC3F68BFE; Tue, 17 Mar 2020 13:32:10 +0100 (CET) Date: Tue, 17 Mar 2020 13:32:10 +0100 From: Christoph Hellwig To: Jason Gunthorpe Cc: Christoph Hellwig , Jerome Glisse , Ralph Campbell , Felix.Kuehling@amd.com, linux-mm@kvack.org, John Hubbard , dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Philip Yang Subject: Re: [PATCH hmm 8/8] mm/hmm: add missing call to hmm_pte_need_fault in HMM_PFN_SPECIAL handling Message-ID: <20200317123210.GA12058@lst.de> References: <20200311183506.3997-1-jgg@ziepe.ca> <20200311183506.3997-9-jgg@ziepe.ca> <20200316091347.GH12439@lst.de> <20200316121053.GP13183@mellanox.com> <20200316124953.GC17386@lst.de> <20200316130458.GQ13183@mellanox.com> <20200316131201.GA17955@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200316131201.GA17955@lst.de> User-Agent: Mutt/1.5.17 (2007-11-01) 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, Mar 16, 2020 at 02:12:01PM +0100, Christoph Hellwig wrote: > On Mon, Mar 16, 2020 at 10:04:58AM -0300, Jason Gunthorpe wrote: > > > Ok. I had some cleanups like this based of older trees, but if you are > > > active in this area I think I'll let you handle it. > > > > You once said you wanted to loose the weird pfn flags scheme, so > > before putting hmm_range_fault in ODP I planned to do that. > > > > If you have your series someplace send me a URL and I'll look on it > > I have a local branch I just started hacking on, but it is rather broken > based on various discussions we had. But for a basic one I'd suggest > something like: > > - kill HMM_PFN_SPECIAL as it serves no purpose > - split the ->pfns array into an input flags (optional) and an output > pfn (mandtory) one, using new flags for the input side > - replace the output flags/values indirection with a bunch of values > encoded in the high bits of a u64, with the rest used for the pfn Thinking out loud a bit more: - do we really need HMM_PFN_ERROR, or is just a return value from hmm_range_fault enough? - because if it is we don't need output flags at all, and the output array could be struct pages, which would make for a much easier to use API