aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2021-08-11 13:25:56 +0200
committerIngo Molnar <mingo@kernel.org>2022-03-15 12:57:31 +0100
commitd463c9e4ef1b867ad6dce83e8d4515f5e3936069 (patch)
tree4ec030c4c5682f8996457d10d07cc5b962f32b8d
parentb7206480c9f86297ff76f843ea47bcfc02671e2e (diff)
downloadtip-d463c9e4ef1b867ad6dce83e8d4515f5e3936069.tar.gz
headers/deps: mm/flatmem: Move the max_mapnr definitions from <linux/mm_api.h> to <linux/mmzone_types.h>
CONFIG_FLATMEM on x86-32 has a historic layering violation: #ifdef CONFIG_FLATMEM #define pfn_valid(pfn) ((pfn) < max_mapnr) #endif /* CONFIG_FLATMEM */ while max_mapnr was defined in <linux/mm.h> - now <linux/mm_api.h>. This was hidden by a maze of header dependencies & macro definitions that delayed to a later stage where max_mapnr would (hopefully) be included. Move the max_mapnr definitions to <linux/mmzone_types.h> instead, so that it's a straightforward dependency. Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--include/linux/mm_api.h11
-rw-r--r--include/linux/mmzone_types.h11
2 files changed, 11 insertions, 11 deletions
diff --git a/include/linux/mm_api.h b/include/linux/mm_api.h
index 006dea6a57407..d211f06fd8c17 100644
--- a/include/linux/mm_api.h
+++ b/include/linux/mm_api.h
@@ -60,17 +60,6 @@ extern int sysctl_page_lock_unfairness;
void init_mm_internals(void);
-#ifndef CONFIG_NUMA /* Don't use mapnrs, do it properly */
-extern unsigned long max_mapnr;
-
-static inline void set_max_mapnr(unsigned long limit)
-{
- max_mapnr = limit;
-}
-#else
-static inline void set_max_mapnr(unsigned long limit) { }
-#endif
-
extern atomic_long_t _totalram_pages;
static inline unsigned long totalram_pages(void)
{
diff --git a/include/linux/mmzone_types.h b/include/linux/mmzone_types.h
index 830cc652fad9f..993288d7bd957 100644
--- a/include/linux/mmzone_types.h
+++ b/include/linux/mmzone_types.h
@@ -812,6 +812,17 @@ enum meminit_context {
extern int movable_zone;
+#ifndef CONFIG_NUMA /* Don't use mapnrs, do it properly */
+extern unsigned long max_mapnr;
+
+static inline void set_max_mapnr(unsigned long limit)
+{
+ max_mapnr = limit;
+}
+#else
+static inline void set_max_mapnr(unsigned long limit) { }
+#endif
+
#endif /* !__GENERATING_BOUNDS.H */
#endif /* _LINUX_MMZONE_TYPES_H */