From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerome Glisse Subject: Re: [RFC] Heterogeneous memory management (mirror process address space on a device mmu). Date: Sat, 10 May 2014 20:48:31 -0400 Message-ID: <20140511004829.GA7101@gmail.com> References: <20140506102925.GD11096@twins.programming.kicks-ass.net> <20140506150014.GA6731@gmail.com> <20140506153315.GB6731@gmail.com> <20140506161836.GC6731@gmail.com> <1399446892.4161.34.camel@pasglop> <20140509012601.GA2906@gmail.com> <1399696115.4481.48.camel@pasglop> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Linus Torvalds , Peter Zijlstra , linux-mm , Linux Kernel Mailing List , linux-fsdevel , Mel Gorman , "H. Peter Anvin" , Andrew Morton , Linda Wang , Kevin E Martin , Jerome Glisse , Andrea Arcangeli , Johannes Weiner , Larry Woodman , Rik van Riel , Dave Airlie , Jeff Law , Brendan Conoboy , Joe Donohue , Duncan Poole , Sherry Cheung , Subhash Gutti , John Hubbard , Mark Hairgrove Return-path: Content-Disposition: inline In-Reply-To: <1399696115.4481.48.camel@pasglop> Sender: owner-linux-mm@kvack.org List-Id: linux-fsdevel.vger.kernel.org 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_notif= ier > > in the place where there can a be race (huge page split, cow, ...). W= hich > > sounds like a bad idea to me when mmu_notifier is perfect for the job= . >=20 > Even there, how are you going to find a sleepable context ? All that st= uff > has the PTL held. >=20 > Cheers, > Ben. All i need is invalidate_page and invalidate_range_start both of which ar= e 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 wou= ld make the cpu page table point to a different page. For invalidate_page th= is is ok because so far it is call either as page reclaimation and those pag= e is change to swap entry or file entry. Or it is call for page migration a= nd cpu page table is set to special migration entry (there is also the memor= y 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 pro= vide the early warning that i need notably for COW. Cheers, J=E9r=F4me -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org