diff options
author | Christoph Hellwig <hch@lst.de> | 2019-06-26 08:27:13 -0400 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2019-07-02 13:32:44 -0400 |
commit | 514caf23a70fd697fa2ece238b2cd8dcc73fb16f (patch) | |
tree | 8e41e9dd323e5117baf1bdc044c2ce035c740483 /mm/page_alloc.c | |
parent | 80a72d0af05ae97a8b106c172e431072ba587492 (diff) |
memremap: replace the altmap_valid field with a PGMAP_ALTMAP_VALID flag
Add a flags field to struct dev_pagemap to replace the altmap_valid
boolean to be a little more extensible. Also add a pgmap_altmap() helper
to find the optional altmap and clean up the code using the altmap using
it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Tested-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index d66bc8abe0af..17a39d40a556 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -5853,6 +5853,7 @@ void __ref memmap_init_zone_device(struct zone *zone, | |||
5853 | { | 5853 | { |
5854 | unsigned long pfn, end_pfn = start_pfn + size; | 5854 | unsigned long pfn, end_pfn = start_pfn + size; |
5855 | struct pglist_data *pgdat = zone->zone_pgdat; | 5855 | struct pglist_data *pgdat = zone->zone_pgdat; |
5856 | struct vmem_altmap *altmap = pgmap_altmap(pgmap); | ||
5856 | unsigned long zone_idx = zone_idx(zone); | 5857 | unsigned long zone_idx = zone_idx(zone); |
5857 | unsigned long start = jiffies; | 5858 | unsigned long start = jiffies; |
5858 | int nid = pgdat->node_id; | 5859 | int nid = pgdat->node_id; |
@@ -5865,9 +5866,7 @@ void __ref memmap_init_zone_device(struct zone *zone, | |||
5865 | * of the pages reserved for the memmap, so we can just jump to | 5866 | * of the pages reserved for the memmap, so we can just jump to |
5866 | * the end of that region and start processing the device pages. | 5867 | * the end of that region and start processing the device pages. |
5867 | */ | 5868 | */ |
5868 | if (pgmap->altmap_valid) { | 5869 | if (altmap) { |
5869 | struct vmem_altmap *altmap = &pgmap->altmap; | ||
5870 | |||
5871 | start_pfn = altmap->base_pfn + vmem_altmap_offset(altmap); | 5870 | start_pfn = altmap->base_pfn + vmem_altmap_offset(altmap); |
5872 | size = end_pfn - start_pfn; | 5871 | size = end_pfn - start_pfn; |
5873 | } | 5872 | } |