Re: mmu_notifier and i915_gem_userptr.c

From: Joerg Roedel
Date: Wed Jun 25 2014 - 18:19:10 EST


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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/