[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170801124111.28881-6-mhocko@kernel.org>
Date: Tue, 1 Aug 2017 14:41:10 +0200
From: Michal Hocko <mhocko@...nel.org>
To: linux-mm@...ck.org
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Mel Gorman <mgorman@...e.de>, Vlastimil Babka <vbabka@...e.cz>,
Andrea Arcangeli <aarcange@...hat.com>,
Jerome Glisse <jglisse@...hat.com>,
Reza Arbab <arbab@...ux.vnet.ibm.com>,
Yasuaki Ishimatsu <yasu.isimatu@...il.com>,
qiuxishi@...wei.com, Kani Toshimitsu <toshi.kani@....com>,
slaoub@...il.com, Joonsoo Kim <js1304@...il.com>,
Andi Kleen <ak@...ux.intel.com>,
Daniel Kiper <daniel.kiper@...cle.com>,
Igor Mammedov <imammedo@...hat.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
LKML <linux-kernel@...r.kernel.org>,
Michal Hocko <mhocko@...e.com>
Subject: [PATCH 5/6] mm, sparse: complain about implicit altmap usage in vmemmap_populate
From: Michal Hocko <mhocko@...e.com>
All current users of the altmap are in the memory hotplug code and
they use __vmemmap_populate explicitly (via __sparse_mem_map_populate).
Complain if somebody uses vmemmap_populate with altmap registered
because that could be an unexpected usage. Also call __vmemmap_populate
with NULL from that code path.
Signed-off-by: Michal Hocko <mhocko@...e.com>
---
include/linux/mm.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 3ce673570fb8..ae1fa053d09e 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2456,8 +2456,12 @@ int __vmemmap_populate(unsigned long start, unsigned long end, int node,
static inline int vmemmap_populate(unsigned long start, unsigned long end,
int node)
{
- struct vmem_altmap *altmap = to_vmem_altmap(start);
- return __vmemmap_populate(start, end, node, altmap);
+ /*
+ * All users of the altmap have to be explicit and use
+ * __vmemmap_populate directly
+ */
+ WARN_ON(to_vmem_altmap(start));
+ return __vmemmap_populate(start, end, node, NULL);
}
void vmemmap_populate_print_last(void);
--
2.13.2
Powered by blists - more mailing lists