Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753098AbaKLXIz (ORCPT ); Wed, 12 Nov 2014 18:08:55 -0500 Received: from resqmta-ch2-01v.sys.comcast.net ([69.252.207.33]:52064 "EHLO resqmta-ch2-01v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752273AbaKLXIy (ORCPT ); Wed, 12 Nov 2014 18:08:54 -0500 Date: Wed, 12 Nov 2014 17:08:47 -0600 (CST) From: Christoph Lameter X-X-Sender: cl@gentwo.org To: Jerome Glisse 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 , Roland Dreier , Ben Sander , Greg Stoner , John Bridgman , Michael Mantor , Paul Blinzer , Laurent Morichetti , Alexander Deucher , Oded Gabbay , linux-fsdevel@vger.kernel.org, Linda Wang , Kevin E Martin , Jerome Glisse , Jeff Law , Haggai Eran , Or Gerlitz , Sagi Grimberg Subject: Re: HMM (heterogeneous memory management) v6 In-Reply-To: <20141112200911.GA7720@gmail.com> Message-ID: References: <1415644096-3513-1-git-send-email-j.glisse@gmail.com> <20141112200911.GA7720@gmail.com> Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 12 Nov 2014, Jerome Glisse wrote: > > 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. > > So GPU process will never run on CPU nor will they have a kernel task struct > 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 integration > with kernel core but it's not there yet. Right. So all of this is not relevant because the GPU manages it. You only need access from the regular processors from Linux which has and uses Page tables. > So the NUMA idea was considered early on but was discarded as it's not really > appropriate. You can have several CPU thread working with several GPU thread > 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. It is possible to ahve several threads accessing the memory in Linux. The GPU threads run on the gpu and therefore are not a Linux issue. Where did you see the problem? > 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 accessible > from the CPU (PCIE bar are too small). So there is no way to keep the memory > mapped for the CPU. We do need to mark the memory as unaccessible to the CPU > and then migrate it to the GPU memory. Ok so this is transfer issue? Isnt this like block I/O? Write to a device? > Now when there is a CPU page fault on some migrated memory we need to migrate > 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 into > HMM which will perform housekeeping and starts migration back to system > memory. Sounds like a read operation and like a major fault if you would use device semantics. You write the pages to the device and then evict them from memory (madvise can do that for you). An access then causes a page fault which leads to a read operation from the device. > So technicaly there is no task migration only memory migration. > > > Is there something i missing inside NUMA or some NUMA work in progress that > change NUMA sufficiently that it might somehow address the use case i am > describing above ? I think you need to be looking at treating GPU memory as a block device then you have the semantics you need. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/