diff options
author | Minchan Kim <minchan@kernel.org> | 2016-07-26 18:26:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-07-26 19:19:19 -0400 |
commit | dd4123f324bbaec7618b677b7bce2b11aee9594e (patch) | |
tree | ccc798b953a7c1eaff8b53d01bc26ceb8e5940da | |
parent | 0db501f7a34c11d3b964205e5b6d00692a648035 (diff) |
mm: fix build warnings in <linux/compaction.h>
Randy reported below build error.
> In file included from ../include/linux/balloon_compaction.h:48:0,
> from ../mm/balloon_compaction.c:11:
> ../include/linux/compaction.h:237:51: warning: 'struct node' declared inside parameter list [enabled by default]
> static inline int compaction_register_node(struct node *node)
> ../include/linux/compaction.h:237:51: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
> ../include/linux/compaction.h:242:54: warning: 'struct node' declared inside parameter list [enabled by default]
> static inline void compaction_unregister_node(struct node *node)
>
It was caused by non-lru page migration which needs compaction.h but
compaction.h doesn't include any header to be standalone.
I think proper header for non-lru page migration is migrate.h rather
than compaction.h because migrate.h has already headers needed to work
non-lru page migration indirectly like isolate_mode_t, migrate_mode
MIGRATEPAGE_SUCCESS.
[akpm@linux-foundation.org: revert mm-balloon-use-general-non-lru-movable-page-feature-fix.patch temp fix]
Link: http://lkml.kernel.org/r/20160610003304.GE29779@bbox
Signed-off-by: Minchan Kim <minchan@kernel.org>
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Gioh Kim <gi-oh.kim@profitbricks.com>
Cc: Rafael Aquini <aquini@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | Documentation/vm/page_migration | 11 | ||||
-rw-r--r-- | drivers/virtio/virtio_balloon.c | 2 | ||||
-rw-r--r-- | include/linux/balloon_compaction.h | 3 | ||||
-rw-r--r-- | include/linux/compaction.h | 16 | ||||
-rw-r--r-- | include/linux/migrate.h | 15 | ||||
-rw-r--r-- | mm/zsmalloc.c | 4 |
6 files changed, 25 insertions, 26 deletions
diff --git a/Documentation/vm/page_migration b/Documentation/vm/page_migration index 18d37c7ac50b..94bd9c11c4e0 100644 --- a/Documentation/vm/page_migration +++ b/Documentation/vm/page_migration | |||
@@ -181,11 +181,12 @@ After isolation, VM calls migratepage of driver with isolated page. | |||
181 | The function of migratepage is to move content of the old page to new page | 181 | The function of migratepage is to move content of the old page to new page |
182 | and set up fields of struct page newpage. Keep in mind that you should | 182 | and set up fields of struct page newpage. Keep in mind that you should |
183 | indicate to the VM the oldpage is no longer movable via __ClearPageMovable() | 183 | indicate to the VM the oldpage is no longer movable via __ClearPageMovable() |
184 | under page_lock if you migrated the oldpage successfully and returns 0. | 184 | under page_lock if you migrated the oldpage successfully and returns |
185 | If driver cannot migrate the page at the moment, driver can return -EAGAIN. | 185 | MIGRATEPAGE_SUCCESS. If driver cannot migrate the page at the moment, driver |
186 | On -EAGAIN, VM will retry page migration in a short time because VM interprets | 186 | can return -EAGAIN. On -EAGAIN, VM will retry page migration in a short time |
187 | -EAGAIN as "temporal migration failure". On returning any error except -EAGAIN, | 187 | because VM interprets -EAGAIN as "temporal migration failure". On returning |
188 | VM will give up the page migration without retrying in this time. | 188 | any error except -EAGAIN, VM will give up the page migration without retrying |
189 | in this time. | ||
189 | 190 | ||
190 | Driver shouldn't touch page.lru field VM using in the functions. | 191 | Driver shouldn't touch page.lru field VM using in the functions. |
191 | 192 | ||
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 88d5609375de..888d5f8322ce 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c | |||
@@ -493,7 +493,7 @@ static int virtballoon_migratepage(struct balloon_dev_info *vb_dev_info, | |||
493 | 493 | ||
494 | put_page(page); /* balloon reference */ | 494 | put_page(page); /* balloon reference */ |
495 | 495 | ||
496 | return 0; | 496 | return MIGRATEPAGE_SUCCESS; |
497 | } | 497 | } |
498 | 498 | ||
499 | static struct dentry *balloon_mount(struct file_system_type *fs_type, | 499 | static struct dentry *balloon_mount(struct file_system_type *fs_type, |
diff --git a/include/linux/balloon_compaction.h b/include/linux/balloon_compaction.h index 504bd724e6ab..79542b2698ec 100644 --- a/include/linux/balloon_compaction.h +++ b/include/linux/balloon_compaction.h | |||
@@ -45,8 +45,7 @@ | |||
45 | #define _LINUX_BALLOON_COMPACTION_H | 45 | #define _LINUX_BALLOON_COMPACTION_H |
46 | #include <linux/pagemap.h> | 46 | #include <linux/pagemap.h> |
47 | #include <linux/page-flags.h> | 47 | #include <linux/page-flags.h> |
48 | #include <linux/node.h> | 48 | #include <linux/migrate.h> |
49 | #include <linux/compaction.h> | ||
50 | #include <linux/gfp.h> | 49 | #include <linux/gfp.h> |
51 | #include <linux/err.h> | 50 | #include <linux/err.h> |
52 | #include <linux/fs.h> | 51 | #include <linux/fs.h> |
diff --git a/include/linux/compaction.h b/include/linux/compaction.h index c6b47c861cea..1a02dab16646 100644 --- a/include/linux/compaction.h +++ b/include/linux/compaction.h | |||
@@ -54,9 +54,6 @@ enum compact_result { | |||
54 | struct alloc_context; /* in mm/internal.h */ | 54 | struct alloc_context; /* in mm/internal.h */ |
55 | 55 | ||
56 | #ifdef CONFIG_COMPACTION | 56 | #ifdef CONFIG_COMPACTION |
57 | extern int PageMovable(struct page *page); | ||
58 | extern void __SetPageMovable(struct page *page, struct address_space *mapping); | ||
59 | extern void __ClearPageMovable(struct page *page); | ||
60 | extern int sysctl_compact_memory; | 57 | extern int sysctl_compact_memory; |
61 | extern int sysctl_compaction_handler(struct ctl_table *table, int write, | 58 | extern int sysctl_compaction_handler(struct ctl_table *table, int write, |
62 | void __user *buffer, size_t *length, loff_t *ppos); | 59 | void __user *buffer, size_t *length, loff_t *ppos); |
@@ -154,19 +151,6 @@ extern void kcompactd_stop(int nid); | |||
154 | extern void wakeup_kcompactd(pg_data_t *pgdat, int order, int classzone_idx); | 151 | extern void wakeup_kcompactd(pg_data_t *pgdat, int order, int classzone_idx); |
155 | 152 | ||
156 | #else | 153 | #else |
157 | static inline int PageMovable(struct page *page) | ||
158 | { | ||
159 | return 0; | ||
160 | } | ||
161 | static inline void __SetPageMovable(struct page *page, | ||
162 | struct address_space *mapping) | ||
163 | { | ||
164 | } | ||
165 | |||
166 | static inline void __ClearPageMovable(struct page *page) | ||
167 | { | ||
168 | } | ||
169 | |||
170 | static inline enum compact_result try_to_compact_pages(gfp_t gfp_mask, | 154 | static inline enum compact_result try_to_compact_pages(gfp_t gfp_mask, |
171 | unsigned int order, int alloc_flags, | 155 | unsigned int order, int alloc_flags, |
172 | const struct alloc_context *ac, | 156 | const struct alloc_context *ac, |
diff --git a/include/linux/migrate.h b/include/linux/migrate.h index 404fbfefeb33..ae8d475a9385 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h | |||
@@ -71,6 +71,21 @@ static inline int migrate_huge_page_move_mapping(struct address_space *mapping, | |||
71 | 71 | ||
72 | #endif /* CONFIG_MIGRATION */ | 72 | #endif /* CONFIG_MIGRATION */ |
73 | 73 | ||
74 | #ifdef CONFIG_COMPACTION | ||
75 | extern int PageMovable(struct page *page); | ||
76 | extern void __SetPageMovable(struct page *page, struct address_space *mapping); | ||
77 | extern void __ClearPageMovable(struct page *page); | ||
78 | #else | ||
79 | static inline int PageMovable(struct page *page) { return 0; }; | ||
80 | static inline void __SetPageMovable(struct page *page, | ||
81 | struct address_space *mapping) | ||
82 | { | ||
83 | } | ||
84 | static inline void __ClearPageMovable(struct page *page) | ||
85 | { | ||
86 | } | ||
87 | #endif | ||
88 | |||
74 | #ifdef CONFIG_NUMA_BALANCING | 89 | #ifdef CONFIG_NUMA_BALANCING |
75 | extern bool pmd_trans_migrating(pmd_t pmd); | 90 | extern bool pmd_trans_migrating(pmd_t pmd); |
76 | extern int migrate_misplaced_page(struct page *page, | 91 | extern int migrate_misplaced_page(struct page *page, |
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index e4e8081b160b..04176de6df70 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c | |||
@@ -50,7 +50,7 @@ | |||
50 | #include <linux/zsmalloc.h> | 50 | #include <linux/zsmalloc.h> |
51 | #include <linux/zpool.h> | 51 | #include <linux/zpool.h> |
52 | #include <linux/mount.h> | 52 | #include <linux/mount.h> |
53 | #include <linux/compaction.h> | 53 | #include <linux/migrate.h> |
54 | #include <linux/pagemap.h> | 54 | #include <linux/pagemap.h> |
55 | 55 | ||
56 | #define ZSPAGE_MAGIC 0x58 | 56 | #define ZSPAGE_MAGIC 0x58 |
@@ -2107,7 +2107,7 @@ int zs_page_migrate(struct address_space *mapping, struct page *newpage, | |||
2107 | put_page(page); | 2107 | put_page(page); |
2108 | page = newpage; | 2108 | page = newpage; |
2109 | 2109 | ||
2110 | ret = 0; | 2110 | ret = MIGRATEPAGE_SUCCESS; |
2111 | unpin_objects: | 2111 | unpin_objects: |
2112 | for (addr = s_addr + offset; addr < s_addr + pos; | 2112 | for (addr = s_addr + offset; addr < s_addr + pos; |
2113 | addr += class->size) { | 2113 | addr += class->size) { |