From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Subject: Re: [PATCH 3/4] mm: simplify device private page handling in hmm_range_fault Date: Mon, 16 Mar 2020 16:59:23 -0300 Message-ID: <20200316195923.GA26988@ziepe.ca> References: <20200316193216.920734-1-hch@lst.de> <20200316193216.920734-4-hch@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20200316193216.920734-4-hch@lst.de> Sender: kvm-ppc-owner@vger.kernel.org To: Christoph Hellwig Cc: Dan Williams , Bharata B Rao , Christian =?utf-8?B?S8O2bmln?= , Ben Skeggs , Jerome Glisse , kvm-ppc@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-mm@kvack.org List-Id: nouveau.vger.kernel.org On Mon, Mar 16, 2020 at 08:32:15PM +0100, Christoph Hellwig wrote: > diff --git a/mm/hmm.c b/mm/hmm.c > index 180e398170b0..cfad65f6a67b 100644 > +++ b/mm/hmm.c > @@ -118,15 +118,6 @@ static inline void hmm_pte_need_fault(const struct hmm_vma_walk *hmm_vma_walk, > /* We aren't ask to do anything ... */ > if (!(pfns & range->flags[HMM_PFN_VALID])) > return; > - /* If this is device memory then only fault if explicitly requested */ > - if ((cpu_flags & range->flags[HMM_PFN_DEVICE_PRIVATE])) { > - /* Do we fault on device memory ? */ > - if (pfns & range->flags[HMM_PFN_DEVICE_PRIVATE]) { > - *write_fault = pfns & range->flags[HMM_PFN_WRITE]; > - *fault = true; > - } > - return; > - } Yes, this is an elegant solution to the input flags. However, between patch 3 and 4 doesn't this break amd gpu as it will return device_private pages now if not requested? Squash the two? Jason