Skip to contentSkip to conversation

mm: page_alloc: remove unneeded header files

PATCH Superseded Miaohe Lin 2 participants 3 messages May 27, 2023 – Jun 3, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Miaohe Lin

author
#0 lore raw

PATCH 1/1 mm: page_alloc: remove unneeded header files

Remove some unneeded header files. No functional change intended.

---
 mm/page_alloc.c | 6 ------
 1 file changed, 6 deletions(-)
mm/page_alloc.c +0 -6
index e671c747892f..beb6db613238 100644
@@ -24,9 +24,7 @@
 #include <linux/kernel.h>
 #include <linux/kasan.h>
 #include <linux/kmsan.h>
-#include <linux/module.h>
 #include <linux/suspend.h>
-#include <linux/pagevec.h>
 #include <linux/ratelimit.h>
 #include <linux/oom.h>
 #include <linux/topology.h>
@@ -36,8 +34,6 @@
 #include <linux/memory_hotplug.h>
 #include <linux/nodemask.h>
 #include <linux/vmstat.h>
-#include <linux/sort.h>
-#include <linux/pfn.h>
 #include <linux/fault-inject.h>
 #include <linux/compaction.h>
 #include <trace/events/kmem.h>
@@ -52,11 +48,9 @@
 #include <linux/memcontrol.h>
 #include <linux/ftrace.h>
 #include <linux/lockdep.h>
-#include <linux/nmi.h>
 #include <linux/psi.h>
 #include <linux/khugepaged.h>
 #include <linux/delayacct.h>
-#include <asm/div64.h>
 #include "internal.h"
 #include "shuffle.h"
 #include "page_reporting.h"
Signature · 1 line
2.27.0
maintainer
#1 lore raw
Quoted 12 lines · On Sat, 27 May 2023 18:07:28 +0800 Miaohe Lin <[email protected]> wrote:

Remove some unneeded header files. No functional change intended.

---
 mm/page_alloc.c | 6 ------
 1 file changed, 6 deletions(-)
mm/page_alloc.c +0 -0
index e671c747892f..beb6db613238 100644

mm/page_alloc.c line 27

Quoted 4 lines
mm/page_alloc.c +0 -1
@@ -24,9 +24,7 @@
 #include <linux/kernel.h>
 #include <linux/kasan.h>
 #include <linux/kmsan.h>
-#include <linux/module.h>

This contains the prototype for print_modules(). So we're now reliant upon module.h being included via some other header, which is fragile.

Quoted 15 lines
mm/page_alloc.c +0 -3
 #include <linux/suspend.h>
-#include <linux/pagevec.h>
 #include <linux/ratelimit.h>
 #include <linux/oom.h>
 #include <linux/topology.h>
@@ -36,8 +34,6 @@
 #include <linux/memory_hotplug.h>
 #include <linux/nodemask.h>
 #include <linux/vmstat.h>
-#include <linux/sort.h>
-#include <linux/pfn.h>
 #include <linux/fault-inject.h>
 #include <linux/compaction.h>
 #include <trace/events/kmem.h>

mm/page_alloc.c line 59

Quoted 8 lines
mm/page_alloc.c +0 -2
@@ -52,11 +48,9 @@
 #include <linux/memcontrol.h>
 #include <linux/ftrace.h>
 #include <linux/lockdep.h>
-#include <linux/nmi.h>
 #include <linux/psi.h>
 #include <linux/khugepaged.h>
 #include <linux/delayacct.h>
-#include <asm/div64.h>

Needed for do_div()?

Quoted 5 lines
mm/page_alloc.c +0 -0
 #include "internal.h"
 #include "shuffle.h"
 #include "page_reporting.h"
Signature · 1 line
2.27.0
author
#2 lore raw
Quoted 9 lines · Andrew Morton
Quoted 7 lines · On Sat, 27 May 2023 18:07:28 +0800 Miaohe Lin <[email protected]> wrote:

Remove some unneeded header files. No functional change intended.

---
 mm/page_alloc.c | 6 ------
 1 file changed, 6 deletions(-)
Quoted 12 lines

mm/page_alloc.c line 27

Quoted 9 lines
mm/page_alloc.c +0 -1
index e671c747892f..beb6db613238 100644
@@ -24,9 +24,7 @@
 #include <linux/kernel.h>
 #include <linux/kasan.h>
 #include <linux/kmsan.h>
-#include <linux/module.h>

This contains the prototype for print_modules(). So we're now reliant upon module.h being included via some other header, which is fragile.

Will keep it.

Quoted 18 lines
Quoted 18 lines
mm/page_alloc.c +0 -3
 #include <linux/suspend.h>
-#include <linux/pagevec.h>
 #include <linux/ratelimit.h>
 #include <linux/oom.h>
 #include <linux/topology.h>
@@ -36,8 +34,6 @@
 #include <linux/memory_hotplug.h>
 #include <linux/nodemask.h>
 #include <linux/vmstat.h>
-#include <linux/sort.h>
-#include <linux/pfn.h>
 #include <linux/fault-inject.h>
 #include <linux/compaction.h>
 #include <trace/events/kmem.h>
@@ -52,11 +48,9 @@
 #include <linux/memcontrol.h>
 #include <linux/ftrace.h>
Quoted 8 lines

mm/page_alloc.c line 59

Quoted 6 lines
mm/page_alloc.c +0 -2
 #include <linux/lockdep.h>
-#include <linux/nmi.h>
 #include <linux/psi.h>
 #include <linux/khugepaged.h>
 #include <linux/delayacct.h>
-#include <asm/div64.h>

Needed for do_div()?

Will add it back. Depending on "asm/div64.h" being included via some other headers is fragile too. Many thanks for your comment.