path: root/mm
diff options
authorMike Rapoport <>2020-08-06 23:22:28 -0700
committerLinus Torvalds <>2020-08-07 11:33:26 -0700
commitca15ca406f660ad5fab55b851d2b269ce915c88d (patch)
tree07b397bd42287ea67735ea632de88def5e61dc5e /mm
parent0c4123e3fb82d6014d0a70b52eb38153f658541c (diff)
mm: remove unneeded includes of <asm/pgalloc.h>
Patch series "mm: cleanup usage of <asm/pgalloc.h>" Most architectures have very similar versions of pXd_alloc_one() and pXd_free_one() for intermediate levels of page table. These patches add generic versions of these functions in <asm-generic/pgalloc.h> and enable use of the generic functions where appropriate. In addition, functions declared and defined in <asm/pgalloc.h> headers are used mostly by core mm and early mm initialization in arch and there is no actual reason to have the <asm/pgalloc.h> included all over the place. The first patch in this series removes unneeded includes of <asm/pgalloc.h> In the end it didn't work out as neatly as I hoped and moving pXd_alloc_track() definitions to <asm-generic/pgalloc.h> would require unnecessary changes to arches that have custom page table allocations, so I've decided to move lib/ioremap.c to mm/ and make pgalloc-track.h local to mm/. This patch (of 8): In most cases <asm/pgalloc.h> header is required only for allocations of page table memory. Most of the .c files that include that header do not use symbols declared in <asm/pgalloc.h> and do not require that header. As for the other header files that used to include <asm/pgalloc.h>, it is possible to move that include into the .c file that actually uses symbols from <asm/pgalloc.h> and drop the include from the header file. The process was somewhat automated using sed -i -E '/[<"]asm\/pgalloc\.h/d' \ $(grep -L -w -f /tmp/xx \ $(git grep -E -l '[<"]asm/pgalloc\.h')) where /tmp/xx contains all the symbols defined in arch/*/include/asm/pgalloc.h. [ fix powerpc warning] Signed-off-by: Mike Rapoport <> Signed-off-by: Andrew Morton <> Reviewed-by: Pekka Enberg <> Acked-by: Geert Uytterhoeven <> [m68k] Cc: Abdul Haleem <> Cc: Andy Lutomirski <> Cc: Arnd Bergmann <> Cc: Christophe Leroy <> Cc: Joerg Roedel <> Cc: Max Filippov <> Cc: Peter Zijlstra <> Cc: Satheesh Rajendran <> Cc: Stafford Horne <> Cc: Stephen Rothwell <> Cc: Steven Rostedt <> Cc: Joerg Roedel <> Cc: Matthew Wilcox <> Link: Link: Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'mm')
2 files changed, 1 insertions, 1 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 590111ea6975..27556d4d49fe 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -31,6 +31,7 @@
#include <linux/cma.h>
#include <asm/page.h>
+#include <asm/pgalloc.h>
#include <asm/tlb.h>
#include <linux/io.h>
diff --git a/mm/sparse.c b/mm/sparse.c
index b2b9a3e34696..97179d27801a 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -16,7 +16,6 @@
#include "internal.h"
#include <asm/dma.h>
-#include <asm/pgalloc.h>
* Permanent SPARSEMEM data: