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.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 AAF1CC0044D for ; Mon, 16 Mar 2020 18:25:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5F43020409 for ; Mon, 16 Mar 2020 18:25:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="DCjng0Ea" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F43020409 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0ABA76B0003; Mon, 16 Mar 2020 14:25:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 05CF86B0005; Mon, 16 Mar 2020 14:25:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E65BB6B0007; Mon, 16 Mar 2020 14:25:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0189.hostedemail.com [216.40.44.189]) by kanga.kvack.org (Postfix) with ESMTP id CF2DA6B0003 for ; Mon, 16 Mar 2020 14:25:42 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 72B69180AD81D for ; Mon, 16 Mar 2020 18:25:42 +0000 (UTC) X-FDA: 76602053724.26.stone81_14af557f6f51a X-HE-Tag: stone81_14af557f6f51a X-Filterd-Recvd-Size: 5473 Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Mon, 16 Mar 2020 18:25:42 +0000 (UTC) Received: by mail-qt1-f195.google.com with SMTP id i26so5336907qtq.8 for ; Mon, 16 Mar 2020 11:25:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=iJWE8TrI0ffeC3Sw+RcRtUnbRu8X59xIzG4mlob+7fY=; b=DCjng0Eaj6HsbWcNiFCJF+xC8Xk9BgVsXDx62rgE7yz5SfveIj38SorIiCEOoUa7js Q4IVmYevLv2UGcYf/mLcOQPXQR1t+P5y4tyU7bFUWKuRBb2vNiRnjus7GrAdRYxq1kjp B6J4OhOvN84SzJIorUukFE1+lOLMcgI5ZzqhXw4t5UP43h7gYy64UuehQbk65HUtIw/U nZKwNGJHtutDw5YNRYbjC+GLSeDNDgi86fScXxkugNWCbP/7BMGRkIuJUBUekRkN0TJK s75Fb2QVxt7azd3VwTD3WiKDxav8shUm08cY0MvWn1oEkMv5eKiwv2dZcqpCf8thyMpe qlMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=iJWE8TrI0ffeC3Sw+RcRtUnbRu8X59xIzG4mlob+7fY=; b=WHR0YpL+S0ubYtJPTo8WzmamY+2iTmBwoG0whZmt+nhZ1cfQwqor9KjJ+UL3iRoX9W DvZaWiR9qxdpRpxlzlvb2CEpu4kxqnDW7/9TjV734NTBE2lGcySYZ+3nCQ8+ntcQCoK9 qBLugvgJUe3v9JgQPCA3nPaGil20YPlpsrKcJVxahX8XseHwChnkjEJeummlEhTun6eT +vHWjZeH2AbUwYeNphpNgY5s/dA6u1n5kq/g/9t7HeJ9Ed+ICfXWHsMIeA65I6gryY2L yoiB0f1ic6cA2x6gtuvcuRu1fSc6DOg218hE/qcZcWM0uZckCudTftn49GHYLhehIZBH 7ViQ== X-Gm-Message-State: ANhLgQ0wAyv2St+llpuRmpiYO3fcmYPIvqI7b7C9vwpYfZPD8TEM0PjW FOitRPXw/6tIIliE63g1X6d95g== X-Google-Smtp-Source: ADFU+vvfq4yHOpYtgjLPPUevf/Pne0zhXSDrRxuWoEydOpikvFwyL2cJYI4Bk8hFq8xZPBXAVYBn7A== X-Received: by 2002:ac8:1196:: with SMTP id d22mr1498877qtj.344.1584383141614; Mon, 16 Mar 2020 11:25:41 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-68-57-212.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.57.212]) by smtp.gmail.com with ESMTPSA id q24sm361232qtk.45.2020.03.16.11.25.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Mar 2020 11:25:41 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1jDuQm-0005aw-Bf; Mon, 16 Mar 2020 15:25:40 -0300 Date: Mon, 16 Mar 2020 15:25:40 -0300 From: Jason Gunthorpe To: Jerome Glisse , Ralph Campbell , Felix.Kuehling@amd.com Cc: linux-mm@kvack.org, John Hubbard , dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Christoph Hellwig , Philip Yang Subject: Re: [PATCH hmm 0/8] Various error case bug fixes for hmm_range_fault() Message-ID: <20200316182540.GA21434@ziepe.ca> References: <20200311183506.3997-1-jgg@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200311183506.3997-1-jgg@ziepe.ca> User-Agent: Mutt/1.9.4 (2018-02-28) 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 Wed, Mar 11, 2020 at 03:34:58PM -0300, Jason Gunthorpe wrote: > From: Jason Gunthorpe > > The hmm_range_fault() flow is fairly complicated. The scheme allows the > caller to specify if it needs a usable result for each page, or if it only > needs the current page table status filled in. This mixture of behavior is > useful for a caller that wants to build a 'prefetch around fault' > algorithm. > > Although we have no in-tree users of this capability, I am working on > having RDMA ODP work in this manner, and removing these bugs from > hmm_range_fault() is a necessary step. > > The basic principles are: > > - If the caller did not ask for a VA to be valid then hmm_range_fault() > should not fail because of that VA > > - If 0 is returned from hmm_range_fault() then the entire pfns array > contains valid data > > - HMM_PFN_ERROR is set if faulting fails, or if asking for faulting > would fail > > - A 0 return from hmm_range_fault() does not have HMM_PFN_ERROR in any > VA's the caller asked to be valid > > This series does not get there completely, I have a followup series > closing some more complex cases. > > I tested this series using Ralph's hmm tester he posted a while back, > other testing would be appreciated. > > Jason Gunthorpe (8): > mm/hmm: add missing unmaps of the ptep during hmm_vma_handle_pte() > mm/hmm: do not call hmm_vma_walk_hole() while holding a spinlock > mm/hmm: add missing pfns set to hmm_vma_walk_pmd() > mm/hmm: add missing call to hmm_range_need_fault() before returning > EFAULT > mm/hmm: reorganize how !pte_present is handled in hmm_vma_handle_pte() > mm/hmm: return -EFAULT when setting HMM_PFN_ERROR on requested valid > pages > mm/hmm: add missing call to hmm_pte_need_fault in HMM_PFN_SPECIAL > handling > mm/hmm: do not check pmd_protnone twice in hmm_vma_handle_pmd() I moved these toward linux-next, if others have remarks or tags please feel free to continue. > mm/hmm: don't free the cached pgmap while scanning I will respin Thank you all for the reviews! Regards, Jason