From: Jerome Glisse Subject: Re: HMM (heterogeneous memory management) v6 Date: Wed, 12 Nov 2014 15:09:14 -0500 Message-ID: <20141112200911.GA7720@gmail.com> References: <1415644096-3513-1-git-send-email-j.glisse@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Linus Torvalds , joro@8bytes.org, Mel Gorman , "H. Peter Anvin" , Peter Zijlstra , Andrea Arcangeli , Johannes Weiner , Larry Woodman , Rik van Riel , Dave Airlie , Brendan Conoboy , Joe Donohue , Duncan Poole , Sherry Cheung , Subhash Gutti , John Hubbard , Mark Hairgrove , Lucien Dunning , Cameron Buschardt , Arvind Gopalakrishnan , Shachar Raindel , Liran Liss , R To: Christoph Lameter Return-path: Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-Id: linux-fsdevel.vger.kernel.org On Tue, Nov 11, 2014 at 01:00:56PM -0600, Christoph Lameter wrote: > On Mon, 10 Nov 2014, j.glisse@gmail.com wrote: >=20 > > In a nutshell HMM is a subsystem that provide an easy to use api to m= irror a > > process address on a device with minimal hardware requirement (mainly= device > > page fault and read only page mapping). This does not rely on ATS and= PASID > > PCIE extensions. It intends to supersede those extensions by allowing= to move > > system memory to device memory in a transparent fashion for core kern= el mm > > code (ie cpu page fault on page residing in device memory will trigge= r > > migration back to system memory). >=20 > Could we define a new NUMA node that maps memory from the GPU and > then simply use the existing NUMA features to move a process over there= . Sorry for late reply, i am traveling and working on an updated patchset t= o change the device page table design to something simpler and easier to gr= asp. So GPU process will never run on CPU nor will they have a kernel task str= uct associated with them. From core kernel point of view they do not exist. I hope that at one point down the line the hw will allow for better integra= tion with kernel core but it's not there yet. So the NUMA idea was considered early on but was discarded as it's not re= ally appropriate. You can have several CPU thread working with several GPU thr= ead at the same time and they can either access disjoint memory or some share memory. Usual case will be few kbytes of share memory for synchronization btw CPU and GPU threads. But when a GPU job is launch we want most of the memory it will use to be migrated to device memory. Issue is that the device memory is not accessi= ble from the CPU (PCIE bar are too small). So there is no way to keep the mem= ory mapped for the CPU. We do need to mark the memory as unaccessible to the = CPU and then migrate it to the GPU memory. Now when there is a CPU page fault on some migrated memory we need to mig= rate memory back to system memory. Hence why i need to tie HMM with some core = MM code so that on this kind of fault core kernel knows it needs to call int= o HMM which will perform housekeeping and starts migration back to system memory. So technicaly there is no task migration only memory migration. Is there something i missing inside NUMA or some NUMA work in progress th= at change NUMA sufficiently that it might somehow address the use case i am describing above ? 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