Skip to contentSkip to conversation

mm, compaction: fix build errors with kcompactd

PATCH Arnd Bergmann 3 participants 3 messages Feb 9, 2016 – Feb 13, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

The newly added kcompactd code introduces multiple build errors:

include/linux/compaction.h:91:12: error: 'kcompactd_run' defined but not used [-Werror=unused-function] mm/compaction.c:1953:2: error: implicit declaration of function 'hotcpu_notifier' [-Werror=implicit-function-declaration]

This marks the new empty wrapper functions as 'inline' to avoid unused-function warnings, and includes linux/cpu.h to get the hotcpu_notifier declaration.

Fixes 8364acdfa45a ("mm, compaction: introduce kcompactd")

---
I stumbled over this while trying out the mmots patches today for an unrelated reason.

include/linux/compaction.h +3 -3
index 1367c0564d42..d7c8de583a23 100644
@@ -88,15 +88,15 @@ static inline bool compaction_deferred(struct zone *zone, int order)
 	return true;
 }
 
-static int kcompactd_run(int nid)
+static inline int kcompactd_run(int nid)
 {
 	return 0;
 }
-static void kcompactd_stop(int nid)
+static inline void kcompactd_stop(int nid)
 {
 }
 
-static void wakeup_kcompactd(pg_data_t *pgdat, int order, int classzone_idx)
+static inline void wakeup_kcompactd(pg_data_t *pgdat, int order, int classzone_idx)
 {
 }
 
mm/compaction.c +1 -0
index 67bb651c56b1..4cb1c2ef5abb 100644
@@ -7,6 +7,7 @@
  *
  * Copyright IBM Corp. 2007-2010 Mel Gorman <[email protected]>
  */
+#include <linux/cpu.h>
 #include <linux/swap.h>
 #include <linux/migrate.h>
 #include <linux/compaction.h>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#1 lore raw
Quoted 10 lines · Arnd Bergmann

The newly added kcompactd code introduces multiple build errors:

include/linux/compaction.h:91:12: error: 'kcompactd_run' defined but not used [-Werror=unused-function] mm/compaction.c:1953:2: error: implicit declaration of function 'hotcpu_notifier' [-Werror=implicit-function-declaration]

This marks the new empty wrapper functions as 'inline' to avoid unused-function warnings, and includes linux/cpu.h to get the hotcpu_notifier declaration.

Fixes 8364acdfa45a ("mm, compaction: introduce kcompactd")

Thanks a lot!
Vlastimil

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#2 lore raw
In reply to Arnd Bergmann
Quoted 9 lines · Arnd Bergmann

The newly added kcompactd code introduces multiple build errors:

include/linux/compaction.h:91:12: error: 'kcompactd_run' defined but not used [-Werror=unused-function] mm/compaction.c:1953:2: error: implicit declaration of function 'hotcpu_notifier' [-Werror=implicit-function-declaration]

This marks the new empty wrapper functions as 'inline' to avoid unused-function warnings, and includes linux/cpu.h to get the hotcpu_notifier declaration.

Fixes 8364acdfa45a ("mm, compaction: introduce kcompactd")

The 8364acdfa45a is a linux-next ID and changes on a daily basis, so you can't really use a "Fixes" here. It doesn't matter if akpm just squishes it into
the original, but I thought I'd mention it for future reference.

P.
..

include/linux/compaction.h static inline bool compaction_deferred(struct zone *zone, int order) · line 88

Quoted 10 lines

---
I stumbled over this while trying out the mmots patches today for an unrelated reason.

include/linux/compaction.h +0 -0
index 1367c0564d42..d7c8de583a23 100644
@@ -88,15 +88,15 @@ static inline bool compaction_deferred(struct zone *zone, int order)
        return true;

[...]

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>