linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Oded Gabbay <oded.gabbay@amd.com>
To: Jerome Glisse <j.glisse@gmail.com>, Christoph Lameter <cl@linux.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	paulmck@linux.vnet.ibm.com, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, jglisse@redhat.com, mgorman@suse.de,
	aarcange@redhat.com, riel@redhat.com, airlied@redhat.com,
	aneesh.kumar@linux.vnet.ibm.com,
	Cameron Buschardt <cabuschardt@nvidia.com>,
	Mark Hairgrove <mhairgrove@nvidia.com>,
	Geoffrey Gerfin <ggerfin@nvidia.com>,
	John McKenna <jmckenna@nvidia.com>,
	akpm@linux-foundation.org, "Bridgman,
	John" <John.Bridgman@amd.com>
Subject: Re: Interacting with coherent memory on external devices
Date: Fri, 24 Apr 2015 21:41:38 +0300	[thread overview]
Message-ID: <553A8E62.4060802@amd.com> (raw)
In-Reply-To: <20150423162245.GC2399@gmail.com>



On 04/23/2015 07:22 PM, Jerome Glisse wrote:
> On Thu, Apr 23, 2015 at 09:20:55AM -0500, Christoph Lameter wrote:
>> On Thu, 23 Apr 2015, Benjamin Herrenschmidt wrote:
>>
>>>> There are hooks in glibc where you can replace the memory
>>>> management of the apps if you want that.
>>>
>>> We don't control the app. Let's say we are doing a plugin for libfoo
>>> which accelerates "foo" using GPUs.
>>
>> There are numerous examples of malloc implementation that can be used for
>> apps without modifying the app.
>
> What about share memory pass btw process ? Or mmaped file ? Or
> a library that is loaded through dlopen and thus had no way to
> control any allocation that happen before it became active ?
>
>>>
>>> Now some other app we have no control on uses libfoo. So pointers
>>> already allocated/mapped, possibly a long time ago, will hit libfoo (or
>>> the plugin) and we need GPUs to churn on the data.
>>
>> IF the GPU would need to suspend one of its computation thread to wait on
>> a mapping to be established on demand or so then it looks like the
>> performance of the parallel threads on a GPU will be significantly
>> compromised. You would want to do the transfer explicitly in some fashion
>> that meshes with the concurrent calculation in the GPU. You do not want
>> stalls while GPU number crunching is ongoing.
>
> You do not understand how GPU works. GPU have a pools of thread, and they
> always try to have the pool as big as possible so that when a group of
> thread is waiting for some memory access, there are others thread ready
> to perform some operation. GPU are about hidding memory latency that's
> what they are good at. But they only achieve that when they have more
> thread in flight than compute unit. The whole thread scheduling is done
> by hardware and barely control by the device driver.
>
> So no having the GPU wait for a page fault is not as dramatic as you
> think. If you use GPU as they are intended to use you might even never
> notice the pagefault and reach close to the theoritical throughput of
> the GPU nonetheless.
>
>
>>
>>> The point I'm making is you are arguing against a usage model which has
>>> been repeatedly asked for by large amounts of customer (after all that's
>>> also why HMM exists).
>>
>> I am still not clear what is the use case for this would be. Who is asking
>> for this?
>
> Everyone but you ? OpenCL 2.0 specific request it and have several level
> of support about transparent address space. The lowest one is the one
> implemented today in which application needs to use a special memory
> allocator.
>
> The most advance one imply integration with the kernel in which any
> memory (mmaped file, share memory or anonymous memory) can be use by
> the GPU and does not need to come from a special allocator.
>
> Everyone in the industry is moving toward the most advance one. That
> is the raison d'être of HMM, to provide this functionality on hw
> platform that do not have things such as CAPI. Which is x86/arm.
>
> So use case is all application using OpenCL or Cuda. So pretty much
> everyone doing GPGPU wants this. I dunno how you can't see that.
> Share address space is so much easier. Believe it or not most coders
> do not have deep knowledge of how things work and if you can remove
> the complexity of different memory allocation and different address
> space from them they will be happy.
>
> Cheers,
> Jérôme
I second what Jerome said, and add that one of the key features of HSA 
is the ptr-is-a-ptr scheme, where the applications do *not* need to 
handle different address spaces. Instead, all the memory is seen as a 
unified address space.

See slide 6 on the following presentation:
http://www.slideshare.net/hsafoundation/hsa-overview

Thanks,
	Oded
>
> --
> 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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
>

--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2015-04-24 18:41 UTC|newest]

Thread overview: 97+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-21 21:44 Interacting with coherent memory on external devices Paul E. McKenney
2015-04-21 23:46 ` Jerome Glisse
2015-04-22  0:36   ` Benjamin Herrenschmidt
2015-04-22 12:42   ` Paul E. McKenney
2015-04-21 23:49 ` Christoph Lameter
2015-04-22  0:05   ` Jerome Glisse
2015-04-22  0:50     ` Christoph Lameter
2015-04-22  1:01       ` Benjamin Herrenschmidt
2015-04-22 13:35         ` Paul E. McKenney
2015-04-22 13:18       ` Paul E. McKenney
2015-04-22 16:16         ` Christoph Lameter
2015-04-22 17:07           ` Jerome Glisse
2015-04-22 18:17             ` Christoph Lameter
2015-04-22 18:52               ` Paul E. McKenney
2015-04-23 14:12                 ` Christoph Lameter
2015-04-23 19:24                   ` Paul E. McKenney
2015-04-24 14:01                     ` Christoph Lameter
2015-04-24 14:13                       ` Paul E. McKenney
2015-04-24 15:53                       ` Rik van Riel
2015-04-23  2:36               ` Benjamin Herrenschmidt
2015-04-23 14:10                 ` Christoph Lameter
2015-04-23 15:42                   ` Jerome Glisse
2015-04-24 14:04                     ` Christoph Lameter
2015-04-23 22:29                   ` Benjamin Herrenschmidt
2015-04-23  2:30           ` Benjamin Herrenschmidt
2015-04-23 14:25             ` Christoph Lameter
2015-04-23 15:25               ` Austin S Hemmelgarn
2015-04-23 19:33                 ` Paul E. McKenney
2015-04-24 14:12                   ` Christoph Lameter
2015-04-24 14:57                     ` Paul E. McKenney
2015-04-24 15:09                       ` Jerome Glisse
2015-04-25 11:20                         ` Paul E. McKenney
2015-04-24 15:52                       ` Christoph Lameter
2015-04-23 22:37                 ` Benjamin Herrenschmidt
2015-04-24 14:09                 ` Christoph Lameter
2015-04-23 16:04       ` Rik van Riel
2015-04-22  0:42   ` Benjamin Herrenschmidt
2015-04-22  0:57     ` Paul E. McKenney
2015-04-22  1:04       ` Benjamin Herrenschmidt
2015-04-22 15:25         ` Christoph Lameter
2015-04-22 16:31           ` Jerome Glisse
2015-04-22 17:14             ` Christoph Lameter
2015-04-22 19:07               ` Jerome Glisse
2015-04-23  2:34               ` Benjamin Herrenschmidt
2015-04-23 14:38                 ` Christoph Lameter
2015-04-23 16:11                   ` Jerome Glisse
2015-04-24 14:29                     ` Christoph Lameter
2015-04-24 15:08                       ` Jerome Glisse
2015-04-24 16:03                         ` Christoph Lameter
2015-04-24 16:43                           ` Jerome Glisse
2015-04-24 16:58                             ` Christoph Lameter
2015-04-24 17:19                               ` Jerome Glisse
2015-04-24 18:56                                 ` Christoph Lameter
2015-04-24 19:29                                   ` Jerome Glisse
2015-04-24 20:00                                     ` Christoph Lameter
2015-04-24 20:32                                       ` Jerome Glisse
2015-04-25 11:46                                       ` Paul E. McKenney
2015-04-27 15:08                                         ` Christoph Lameter
2015-04-27 15:47                                           ` Jerome Glisse
2015-04-27 16:17                                             ` Christoph Lameter
2015-04-27 16:29                                               ` Rik van Riel
2015-04-27 16:48                                                 ` Christoph Lameter
2015-04-27 23:54                                                   ` Benjamin Herrenschmidt
2015-05-13 14:10                                                     ` Vlastimil Babka
2015-05-13 23:38                                                       ` Benjamin Herrenschmidt
2015-05-14  7:39                                                         ` Vlastimil Babka
2015-05-14  7:51                                                           ` Benjamin Herrenschmidt
2015-05-28 18:18                                                             ` Paul E. McKenney
2015-04-27 16:43                                               ` Jerome Glisse
2015-04-27 16:51                                                 ` Christoph Lameter
2015-04-27 17:21                                                   ` Jerome Glisse
2015-04-27 19:26                                                     ` Christoph Lameter
2015-04-27 19:35                                                       ` Rik van Riel
2015-04-27 20:52                                                       ` Jerome Glisse
2015-04-28 14:18                                                         ` Christoph Lameter
2015-04-28 17:20                                                           ` Jerome Glisse
2015-04-27 16:15                                           ` Paul E. McKenney
2015-04-27 16:31                                             ` Christoph Lameter
2015-04-24 23:45                               ` Benjamin Herrenschmidt
2015-04-23 18:52                   ` Paul E. McKenney
2015-04-24 14:30                     ` Christoph Lameter
2015-04-24 14:54                       ` Paul E. McKenney
2015-04-24 15:49                         ` Christoph Lameter
2015-04-24 16:06                           ` Rik van Riel
2015-04-25 11:49                           ` Paul E. McKenney
2015-04-24 16:00                       ` Jerome Glisse
2015-04-24 16:08                       ` Rik van Riel
2015-04-23 17:28               ` Rik van Riel
2015-04-23  2:27           ` Benjamin Herrenschmidt
2015-04-23 14:20             ` Christoph Lameter
2015-04-23 16:22               ` Jerome Glisse
2015-04-24 18:41                 ` Oded Gabbay [this message]
2015-04-23 19:00               ` Paul E. McKenney
2015-04-22 15:20       ` Christoph Lameter
2015-04-25  2:32 ` Rik van Riel
2015-04-25  3:32   ` Benjamin Herrenschmidt
2015-04-25 11:55     ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=553A8E62.4060802@amd.com \
    --to=oded.gabbay@amd.com \
    --cc=John.Bridgman@amd.com \
    --cc=aarcange@redhat.com \
    --cc=airlied@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=cabuschardt@nvidia.com \
    --cc=cl@linux.com \
    --cc=ggerfin@nvidia.com \
    --cc=j.glisse@gmail.com \
    --cc=jglisse@redhat.com \
    --cc=jmckenna@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=mhairgrove@nvidia.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=riel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).