From: Jerome Glisse <jglisse@redhat.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, John Hubbard <jhubbard@nvidia.com>,
Dan Williams <dan.j.williams@intel.com>,
David Nellans <dnellans@nvidia.com>,
Evgeny Baskakov <ebaskakov@nvidia.com>,
Mark Hairgrove <mhairgrove@nvidia.com>,
Sherry Cheung <SCheung@nvidia.com>,
Subhash Gutti <sgutti@nvidia.com>
Subject: Re: [PATCH 09/15] mm/hmm/devmem: device memory hotplug using ZONE_DEVICE v6
Date: Mon, 31 Jul 2017 13:21:24 -0400 [thread overview]
Message-ID: <20170731172122.GA24626@redhat.com> (raw)
In-Reply-To: <20170728111003.GA2278@dhcp22.suse.cz>
On Fri, Jul 28, 2017 at 01:10:03PM +0200, Michal Hocko wrote:
> I haven't seen a newer version posted but the same comment applies on
> your hmm-v25-4.9 git version from
> git://people.freedesktop.org/~glisse/linux
>
> On Wed 28-06-17 14:00:41, Jerome Glisse wrote:
> > This introduce a simple struct and associated helpers for device driver
> > to use when hotpluging un-addressable device memory as ZONE_DEVICE. It
> > will find a unuse physical address range and trigger memory hotplug for
> > it which allocates and initialize struct page for the device memory.
>
> Please document the hotplug semantic some more please (who is in charge,
> what is the lifetime, userspace API to add/remove this memory if any
> etc...).
>
> I can see you call add_pages. Please document why arch_add_memory (like
> devm_memremap_pages) is not used. You also never seem to online the
> range which is in line with nvdim usage and it is OK. But then I fail to
> understand why you need
I added documentation in function and in commit message:
https://cgit.freedesktop.org/~glisse/linux/commit/?h=hmm-next&id=33e236a64da84423c83db401fc62ea13877111f2
Not much to say i am affraid as everything is under control of the device
driver (when hotplug/hotremove happens, memory management, userspace API,
...).
>
> [...]
> > + mem_hotplug_begin();
> > + ret = add_pages(nid, align_start >> PAGE_SHIFT,
> > + align_size >> PAGE_SHIFT, false);
> > + if (ret) {
> > + mem_hotplug_done();
> > + goto error_add_memory;
> > + }
> > + move_pfn_range_to_zone(&NODE_DATA(nid)->node_zones[ZONE_DEVICE],
> > + align_start >> PAGE_SHIFT,
> > + align_size >> PAGE_SHIFT);
> > + mem_hotplug_done();
> > +
> > + for (pfn = devmem->pfn_first; pfn < devmem->pfn_last; pfn++) {
> > + struct page *page = pfn_to_page(pfn);
> > +
> > + /*
> > + * ZONE_DEVICE pages union ->lru with a ->pgmap back
> > + * pointer. It is a bug if a ZONE_DEVICE page is ever
> > + * freed or placed on a driver-private list. Therefore,
> > + * seed the storage with LIST_POISON* values.
> > + */
> > + list_del(&page->lru);
>
> this? The page is not on any list yet - it hasn't been added to the page
> allocator.
Like comments says it was to init page->lru.next|prev with poison values
it is not important so i remove it.
Jerome
--
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-07-31 17:21 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-28 18:00 [PATCH 00/15] HMM (Heterogeneous Memory Management) v24 Jérôme Glisse
2017-06-28 18:00 ` [PATCH 01/15] hmm: heterogeneous memory management documentation v2 Jérôme Glisse
2017-06-28 18:00 ` [PATCH 02/15] mm/hmm: heterogeneous memory management (HMM for short) v4 Jérôme Glisse
2017-06-28 18:00 ` [PATCH 03/15] mm/hmm/mirror: mirror process address space on device with HMM helpers v3 Jérôme Glisse
2017-06-28 18:00 ` [PATCH 04/15] mm/hmm/mirror: helper to snapshot CPU page table v3 Jérôme Glisse
2017-06-28 18:00 ` [PATCH 05/15] mm/hmm/mirror: device page fault handler Jérôme Glisse
2017-06-28 18:00 ` [PATCH 06/15] mm/memory_hotplug: introduce add_pages Jérôme Glisse
2017-06-28 18:00 ` [PATCH 07/15] mm/ZONE_DEVICE: new type of ZONE_DEVICE for unaddressable memory v4 Jérôme Glisse
2017-07-01 0:16 ` kbuild test robot
2017-06-28 18:00 ` [PATCH 08/15] mm/ZONE_DEVICE: special case put_page() for device private pages v2 Jérôme Glisse
2017-06-28 18:00 ` [PATCH 09/15] mm/hmm/devmem: device memory hotplug using ZONE_DEVICE v6 Jérôme Glisse
2017-07-18 21:41 ` Evgeny Baskakov
2017-07-28 11:10 ` Michal Hocko
2017-07-31 17:21 ` Jerome Glisse [this message]
2017-08-01 12:17 ` Michal Hocko
2017-06-28 18:00 ` [PATCH 10/15] mm/hmm/devmem: dummy HMM device for ZONE_DEVICE memory v3 Jérôme Glisse
2017-06-28 18:00 ` [PATCH 11/15] mm/migrate: new migrate mode MIGRATE_SYNC_NO_COPY Jérôme Glisse
2017-06-28 18:00 ` [PATCH 12/15] mm/migrate: new memory migration helper for use with device memory v4 Jérôme Glisse
2017-06-28 18:00 ` [PATCH 13/15] mm/migrate: migrate_vma() unmap page from vma while collecting pages Jérôme Glisse
2017-06-28 18:00 ` [PATCH 14/15] mm/migrate: support un-addressable ZONE_DEVICE page in migration v2 Jérôme Glisse
2017-06-28 18:00 ` [PATCH 15/15] mm/migrate: allow migrate_vma() to alloc new page on empty entry v3 Jérôme Glisse
2017-06-30 5:32 ` [PATCH 00/15] HMM (Heterogeneous Memory Management) v24 John Hubbard
2017-06-30 19:49 ` Jerome Glisse
2017-07-19 11:48 ` Yisheng Xie
2017-07-20 17:18 ` Jerome Glisse
2017-07-21 9:03 ` Yisheng Xie
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=20170731172122.GA24626@redhat.com \
--to=jglisse@redhat.com \
--cc=SCheung@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=dan.j.williams@intel.com \
--cc=dnellans@nvidia.com \
--cc=ebaskakov@nvidia.com \
--cc=jhubbard@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhairgrove@nvidia.com \
--cc=mhocko@kernel.org \
--cc=sgutti@nvidia.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).