From: Christoph Lameter <cl@linux.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Balbir Singh <bsingharora@gmail.com>,
linux-mm@kvack.org, akpm@linux-foundation.org,
khandual@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.ibm.com,
paulmck@linux.vnet.ibm.com, srikar@linux.vnet.ibm.com,
haren@linux.vnet.ibm.com, jglisse@redhat.com,
mgorman@techsingularity.net, mhocko@kernel.org,
arbab@linux.vnet.ibm.com, vbabka@suse.cz
Subject: Re: [RFC 0/4] RFC - Coherent Device Memory (Not for inclusion)
Date: Fri, 21 Apr 2017 11:13:29 -0500 (CDT) [thread overview]
Message-ID: <alpine.DEB.2.20.1704211108120.14734@east.gentwo.org> (raw)
In-Reply-To: <1492723609.25766.152.camel@kernel.crashing.org>
On Fri, 21 Apr 2017, Benjamin Herrenschmidt wrote:
> On Thu, 2017-04-20 at 10:29 -0500, Christoph Lameter wrote:
> > On Thu, 20 Apr 2017, Balbir Singh wrote:
> > > Couple of things are needed
> > >
> > > 1. Isolation of allocation
> >
> > cgroups, memory policy and cpuset provide that
>
> Can these be configured appropriately by the accelerator or GPU driver
> at the point where it hot plugs the memory ?
A driver could be able to setup a memory policy. Sure.
> The problem is we need to ensure there is no window in which the kernel
> will start putting things like skb's etc... in there.
skbs are not put into user space pages. They are unmovable and thus
hotplugged memory will not be used.
> Basically the whole debate at the moment revolves around whether to use
> HMM/CDM/ZONE_DEVICE vs. making it just a NUMA nodes with a sprinkle of
> added foo.
I think the memory hotplug idea should be making this easy to do. Not
much rigging around needed.
> What we have here is effectively a bit more like a NUMA node, whose
> processing unit is just not a CPU but a GPU or some kind of
> accelerator.
Its like a memory only node. That is a common usecase for NUMA nodes (HP
has made use of memory only nodes in a large scale)
> The difference boils down to how we want to use is. We want any page,
> anonymous memory, mapped file, you name it... to be able to migrate
> back and forth depending on which piece of HW is most actively
> accessing it. This is helped by a bunch of things such as very fast DMA
> engines to facilitate migration, and HW counter to detect when parts of
> that memory are accessed "remotely" (and thus request migrations).
Well that migration can even be done from userspace. See the
migrate_pages() syscall.
> So the NUMA model fits reasonably well, with that memory being overall
> treated normally. The ZONE_DEVICE model on the other hand creates those
> "special" pages which require a pile of special casing in all sort of
> places as Balbir has mentioned, with still a bunch of rather standard
> stuff not working with them.
Right.
> However, we do need to address a few quirks, which is what this is
> about.
>
> Mostly we want to keep kernel allocations away from it, in part because
> the memory is more prone to fail and not terribly fast for direct CPU
> access, in part because we want to maximize the availability of it for
> dedicated applications.
Hotplugged memory is containing only movable pages. This means kernel
allocations do not occur there. You are fine.
> Other things are possibly more realistic to do that way, such as taking
> KSM and AutoNuma off the picture for it.
Well just pinning those pages or mlocking those will stop these scans.
--
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>
next prev parent reply other threads:[~2017-04-21 16:13 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-19 7:52 Balbir Singh
2017-04-19 7:52 ` [RFC 1/4] mm: create N_COHERENT_MEMORY Balbir Singh
2017-04-27 18:42 ` Reza Arbab
2017-04-28 5:07 ` Balbir Singh
2017-04-19 7:52 ` [RFC 2/4] arch/powerpc/mm: add support for coherent memory Balbir Singh
2017-04-19 7:52 ` [RFC 3/4] mm: Integrate N_COHERENT_MEMORY with mempolicy and the rest of the system Balbir Singh
2017-04-19 7:52 ` [RFC 4/4] mm: Add documentation for coherent memory Balbir Singh
2017-04-19 19:02 ` [RFC 0/4] RFC - Coherent Device Memory (Not for inclusion) Christoph Lameter
2017-04-20 1:25 ` Balbir Singh
2017-04-20 15:29 ` Christoph Lameter
2017-04-20 21:26 ` Benjamin Herrenschmidt
2017-04-21 16:13 ` Christoph Lameter [this message]
2017-04-21 21:15 ` Benjamin Herrenschmidt
2017-04-24 13:57 ` Christoph Lameter
2017-04-24 0:20 ` Balbir Singh
2017-04-24 14:00 ` Christoph Lameter
2017-04-25 0:52 ` Balbir Singh
2017-05-01 20:41 ` John Hubbard
2017-05-01 21:04 ` Reza Arbab
2017-05-01 21:56 ` John Hubbard
2017-05-01 23:51 ` Reza Arbab
2017-05-01 23:58 ` John Hubbard
2017-05-02 0:04 ` Reza Arbab
2017-05-02 1:29 ` Balbir Singh
2017-05-02 5:47 ` John Hubbard
2017-05-02 7:23 ` Balbir Singh
2017-05-02 17:50 ` John Hubbard
2017-05-02 14:36 ` Michal Hocko
2017-05-04 5:26 ` Balbir Singh
2017-05-04 12:52 ` Michal Hocko
2017-05-04 15:49 ` Benjamin Herrenschmidt
2017-05-04 17:33 ` Dave Hansen
2017-05-05 3:17 ` Balbir Singh
2017-05-05 14:51 ` Dave Hansen
2017-05-05 7:49 ` Benjamin Herrenschmidt
2017-05-05 14:52 ` Michal Hocko
2017-05-05 15:57 ` Benjamin Herrenschmidt
2017-05-05 17:48 ` Jerome Glisse
2017-05-05 17:59 ` Benjamin Herrenschmidt
2017-05-09 11:36 ` Michal Hocko
2017-05-09 13:43 ` Benjamin Herrenschmidt
2017-05-15 12:55 ` Michal Hocko
2017-05-15 15:53 ` Christoph Lameter
2017-05-10 23:04 ` Balbir Singh
2017-05-09 7:51 ` Balbir Singh
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=alpine.DEB.2.20.1704211108120.14734@east.gentwo.org \
--to=cl@linux.com \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=arbab@linux.vnet.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=bsingharora@gmail.com \
--cc=haren@linux.vnet.ibm.com \
--cc=jglisse@redhat.com \
--cc=khandual@linux.vnet.ibm.com \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=mhocko@kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=srikar@linux.vnet.ibm.com \
--cc=vbabka@suse.cz \
/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