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 9984EC10F29 for ; Tue, 17 Mar 2020 13:06:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5ED9B20738 for ; Tue, 17 Mar 2020 13:06:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5ED9B20738 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 0BDC26B0005; Tue, 17 Mar 2020 09:06:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0470A6B0006; Tue, 17 Mar 2020 09:06:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E77196B0007; Tue, 17 Mar 2020 09:06:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0112.hostedemail.com [216.40.44.112]) by kanga.kvack.org (Postfix) with ESMTP id CBAB36B0005 for ; Tue, 17 Mar 2020 09:06:12 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 91D26181AC9B6 for ; Tue, 17 Mar 2020 13:06:12 +0000 (UTC) X-FDA: 76604877384.02.cast61_3629363f4744d X-HE-Tag: cast61_3629363f4744d X-Filterd-Recvd-Size: 2578 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Tue, 17 Mar 2020 13:06:12 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 3203068BFE; Tue, 17 Mar 2020 14:06:09 +0100 (CET) Date: Tue, 17 Mar 2020 14:06:08 +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: <20200317130608.GA13030@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> <20200317123210.GA12058@lst.de> <20200317125317.GT13183@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200317125317.GT13183@mellanox.com> 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 Tue, Mar 17, 2020 at 09:53:17AM -0300, Jason Gunthorpe wrote: > > Thinking out loud a bit more: > > > > - do we really need HMM_PFN_ERROR, or is just a return value from > > hmm_range_fault enough? > > I'm not totally clear on this. The only use for ERROR is to signal to a > non-faulting hmm_range_fault (ie shapshot) that the page should generate a > device fault (ie device SIGSEGV). > > We can also handle ERROR by having the device take the fault to CPU, > then fail during a faulting hmm_range_fault and then dropping the > ERROR indication toward the device. > > If we already know the page cannot be faulted when we read it it feels > natural to return that too. True. Of course we could just stick an ERR_PTR into the page array in this case. > > - 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 > > valid and write is required for the non-faulting case, I don't > think flags can go away. Do we have any cases where these aren't simply kept from the input array? I couldn't find any, but I've not understood some of the subtle details before.