diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2017-02-25 01:09:54 -0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-02-25 01:09:53 -0800 |
| commit | 45db08b7dee5b815c241fe2e7e3133287327ba91 (patch) | |
| tree | fc1a946420ad2635331f36ba7b0e5d8456de899d | |
| parent | a53139379186a7f48cbac6321a8cc73bf94c9f1b (diff) | |
| parent | 55ebcd4f03a36ba60908d6505fa646997822f4d5 (diff) | |
Merge "mm: fix build warnings in <linux/compaction.h>"
| -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. The function of migratepage is to move content of the old page to new page and set up fields of struct page newpage. Keep in mind that you should indicate to the VM the oldpage is no longer movable via __ClearPageMovable() -under page_lock if you migrated the oldpage successfully and returns 0. -If driver cannot migrate the page at the moment, driver can return -EAGAIN. -On -EAGAIN, VM will retry page migration in a short time because VM interprets --EAGAIN as "temporal migration failure". On returning any error except -EAGAIN, -VM will give up the page migration without retrying in this time. +under page_lock if you migrated the oldpage successfully and returns +MIGRATEPAGE_SUCCESS. If driver cannot migrate the page at the moment, driver +can return -EAGAIN. On -EAGAIN, VM will retry page migration in a short time +because VM interprets -EAGAIN as "temporal migration failure". On returning +any error except -EAGAIN, VM will give up the page migration without retrying +in this time. Driver shouldn't touch page.lru field VM using in the functions. diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 9ceab6c24415..8959b320d472 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -489,7 +489,7 @@ static int virtballoon_migratepage(struct balloon_dev_info *vb_dev_info, put_page(page); /* balloon reference */ - return 0; + return MIGRATEPAGE_SUCCESS; } 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 @@ #define _LINUX_BALLOON_COMPACTION_H #include <linux/pagemap.h> #include <linux/page-flags.h> -#include <linux/node.h> -#include <linux/compaction.h> +#include <linux/migrate.h> #include <linux/gfp.h> #include <linux/err.h> #include <linux/fs.h> diff --git a/include/linux/compaction.h b/include/linux/compaction.h index c81e4e061801..e864751d870a 100644 --- a/include/linux/compaction.h +++ b/include/linux/compaction.h @@ -29,9 +29,6 @@ struct alloc_context; /* in mm/internal.h */ #ifdef CONFIG_COMPACTION -extern int PageMovable(struct page *page); -extern void __SetPageMovable(struct page *page, struct address_space *mapping); -extern void __ClearPageMovable(struct page *page); extern int sysctl_compact_memory; extern int sysctl_compaction_handler(struct ctl_table *table, int write, void __user *buffer, size_t *length, loff_t *ppos); @@ -60,19 +57,6 @@ extern void kcompactd_stop(int nid); extern void wakeup_kcompactd(pg_data_t *pgdat, int order, int classzone_idx); #else -static inline int PageMovable(struct page *page) -{ - return 0; -} -static inline void __SetPageMovable(struct page *page, - struct address_space *mapping) -{ -} - -static inline void __ClearPageMovable(struct page *page) -{ -} - static inline unsigned long try_to_compact_pages(gfp_t gfp_mask, unsigned int order, int alloc_flags, const struct alloc_context *ac, diff --git a/include/linux/migrate.h b/include/linux/migrate.h index f10fd92860ac..5219df44cfec 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h @@ -67,6 +67,21 @@ static inline int migrate_huge_page_move_mapping(struct address_space *mapping, #endif /* CONFIG_MIGRATION */ +#ifdef CONFIG_COMPACTION +extern int PageMovable(struct page *page); +extern void __SetPageMovable(struct page *page, struct address_space *mapping); +extern void __ClearPageMovable(struct page *page); +#else +static inline int PageMovable(struct page *page) { return 0; }; +static inline void __SetPageMovable(struct page *page, + struct address_space *mapping) +{ +} +static inline void __ClearPageMovable(struct page *page) +{ +} +#endif + #ifdef CONFIG_NUMA_BALANCING extern bool pmd_trans_migrating(pmd_t pmd); extern int migrate_misplaced_page(struct page *page, diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 25fcc613a770..1eb00e343523 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -48,7 +48,7 @@ #include <linux/zsmalloc.h> #include <linux/zpool.h> #include <linux/mount.h> -#include <linux/compaction.h> +#include <linux/migrate.h> #include <linux/pagemap.h> #define ZSPAGE_MAGIC 0x58 @@ -2101,7 +2101,7 @@ int zs_page_migrate(struct address_space *mapping, struct page *newpage, put_page(page); page = newpage; - ret = 0; + ret = MIGRATEPAGE_SUCCESS; unpin_objects: for (addr = s_addr + offset; addr < s_addr + pos; addr += class->size) { |
