Loading Documentation/vm/page_migration +6 −5 Original line number Diff line number Diff line Loading @@ -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. Loading drivers/virtio/virtio_balloon.c +1 −1 Original line number Diff line number Diff line Loading @@ -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, Loading include/linux/balloon_compaction.h +1 −2 Original line number Diff line number Diff line Loading @@ -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> Loading include/linux/compaction.h +0 −16 Original line number Diff line number Diff line Loading @@ -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); Loading Loading @@ -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, Loading include/linux/migrate.h +15 −0 Original line number Diff line number Diff line Loading @@ -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, Loading Loading
Documentation/vm/page_migration +6 −5 Original line number Diff line number Diff line Loading @@ -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. Loading
drivers/virtio/virtio_balloon.c +1 −1 Original line number Diff line number Diff line Loading @@ -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, Loading
include/linux/balloon_compaction.h +1 −2 Original line number Diff line number Diff line Loading @@ -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> Loading
include/linux/compaction.h +0 −16 Original line number Diff line number Diff line Loading @@ -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); Loading Loading @@ -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, Loading
include/linux/migrate.h +15 −0 Original line number Diff line number Diff line Loading @@ -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, Loading