summaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2015-08-09 15:29:06 -0400
committerDan Williams <dan.j.williams@intel.com>2015-08-27 19:40:58 -0400
commit033fbae988fcb67e5077203512181890848b8e90 (patch)
treed0b9e418ab4f1df15435c098edf5ad687b426b3f /arch/powerpc
parent012dcef3f058385268630c0003e9b7f8dcafbeb4 (diff)
mm: ZONE_DEVICE for "device memory"
While pmem is usable as a block device or via DAX mappings to userspace there are several usage scenarios that can not target pmem due to its lack of struct page coverage. In preparation for "hot plugging" pmem into the vmemmap add ZONE_DEVICE as a new zone to tag these pages separately from the ones that are subject to standard page allocations. Importantly "device memory" can be removed at will by userspace unbinding the driver of the device. Having a separate zone prevents allocation and otherwise marks these pages that are distinct from typical uniform memory. Device memory has different lifetime and performance characteristics than RAM. However, since we have run out of ZONES_SHIFT bits this functionality currently depends on sacrificing ZONE_DMA. Cc: H. Peter Anvin <hpa@zytor.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: Rik van Riel <riel@redhat.com> Cc: Mel Gorman <mgorman@suse.de> Cc: Jerome Glisse <j.glisse@gmail.com> [hch: various simplifications in the arch interface] Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/mm/mem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 0f11819d8f1d..6571cfb05668 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -113,7 +113,7 @@ int memory_add_physaddr_to_nid(u64 start)
113} 113}
114#endif 114#endif
115 115
116int arch_add_memory(int nid, u64 start, u64 size) 116int arch_add_memory(int nid, u64 start, u64 size, bool for_device)
117{ 117{
118 struct pglist_data *pgdata; 118 struct pglist_data *pgdata;
119 struct zone *zone; 119 struct zone *zone;
@@ -128,7 +128,7 @@ int arch_add_memory(int nid, u64 start, u64 size)
128 128
129 /* this should work for most non-highmem platforms */ 129 /* this should work for most non-highmem platforms */
130 zone = pgdata->node_zones + 130 zone = pgdata->node_zones +
131 zone_for_memory(nid, start, size, 0); 131 zone_for_memory(nid, start, size, 0, for_device);
132 132
133 return __add_pages(nid, zone, start_pfn, nr_pages); 133 return __add_pages(nid, zone, start_pfn, nr_pages);
134} 134}