On Sat, May 10, 2014 at 02:28:35PM +1000, Benjamin Herrenschmidt wrote: > On Thu, 2014-05-08 at 21:26 -0400, Jerome Glisse wrote: > > Otherwise i have no other choice than to add something like mmu_notifier > > in the place where there can a be race (huge page split, cow, ...). Which > > sounds like a bad idea to me when mmu_notifier is perfect for the job. > > Even there, how are you going to find a sleepable context ? All that stuff > has the PTL held. > > Cheers, > Ben. All i need is invalidate_page and invalidate_range_start both of which are not call while holding any lock beside that anon_vma and or mmap_sem. So i am fine on that front. The change_pte callback are bracketed by call to invalidate_range_start / end. What is important is to flush GPU page table prior to any update that would make the cpu page table point to a different page. For invalidate_page this is ok because so far it is call either as page reclaimation and those page is change to swap entry or file entry. Or it is call for page migration and cpu page table is set to special migration entry (there is also the memory failure case but this one is harmless too). So as far as i can tell i am safe on that front and only mmu_notifier provide the early warning that i need notably for COW. Cheers, Jérôme -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>