From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: mmu_notifier and i915_gem_userptr.c Date: Thu, 26 Jun 2014 00:18:59 +0200 Message-ID: <20140625221859.GD7732@8bytes.org> References: <20140619153655.GG31771@8bytes.org> <20140619160257.GB8476@nuc-i3427.alporthouse.com> <20140620114350.GH31771@8bytes.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail.8bytes.org (8bytes.org [85.214.48.195]) by gabe.freedesktop.org (Postfix) with ESMTP id 020C56E173 for ; Wed, 25 Jun 2014 15:19:03 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.8bytes.org (Postfix) with SMTP id 1CAA112AF32 for ; Thu, 26 Jun 2014 00:19:01 +0200 (CEST) Content-Disposition: inline In-Reply-To: <20140620114350.GH31771@8bytes.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Chris Wilson Cc: David Airlie , Daniel Vetter , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org List-Id: intel-gfx@lists.freedesktop.org On Fri, Jun 20, 2014 at 01:43:50PM +0200, Joerg Roedel wrote: > Change_pte is also called when the underlying page of an address > changes in the kernel which would matter for DMA. But that can only > happen in KSM and uprobes code which is probably not of interest for the > i915 driver. > > The other case where I think it matters is the do_wp_page() path for > COW. The code works by calling invalidate_range_start -> change_pte -> > invalidate_range_end. Your driver would react to this by unbinding the > vma from itself internally (after a fork for example). > > But I have to check whether this really matters here. Okay, I think it does not matter for the i915 driver. The code-paths which map pages read-only for COW invoke invalidate_range_start/end on the page-ranges which causes the driver to unbind the pages. When get_user_pages() is called again later it will do the COW by itself, so the driver doesn't need to care. So I tend to say that the i915 driver does not need a change_pte() call-back at all. But probably someone should double-check to make sure I didn't miss something. Joerg