~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/migrate.h

Version: ~ [ linux-5.12-rc1 ] ~ [ linux-5.11.2 ] ~ [ linux-5.10.19 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.101 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.177 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.222 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.258 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.258 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #ifndef _LINUX_MIGRATE_H
  2 #define _LINUX_MIGRATE_H
  3 
  4 #include <linux/mm.h>
  5 #include <linux/mempolicy.h>
  6 #include <linux/migrate_mode.h>
  7 
  8 typedef struct page *new_page_t(struct page *page, unsigned long private,
  9                                 int **reason);
 10 typedef void free_page_t(struct page *page, unsigned long private);
 11 
 12 /*
 13  * Return values from addresss_space_operations.migratepage():
 14  * - negative errno on page migration failure;
 15  * - zero on page migration success;
 16  */
 17 #define MIGRATEPAGE_SUCCESS             0
 18 
 19 enum migrate_reason {
 20         MR_COMPACTION,
 21         MR_MEMORY_FAILURE,
 22         MR_MEMORY_HOTPLUG,
 23         MR_SYSCALL,             /* also applies to cpusets */
 24         MR_MEMPOLICY_MBIND,
 25         MR_NUMA_MISPLACED,
 26         MR_CMA
 27 };
 28 
 29 #ifdef CONFIG_MIGRATION
 30 
 31 extern void putback_movable_pages(struct list_head *l);
 32 extern int migrate_page(struct address_space *,
 33                         struct page *, struct page *, enum migrate_mode);
 34 extern int migrate_pages(struct list_head *l, new_page_t new, free_page_t free,
 35                 unsigned long private, enum migrate_mode mode, int reason);
 36 
 37 extern int migrate_prep(void);
 38 extern int migrate_prep_local(void);
 39 extern void migrate_page_copy(struct page *newpage, struct page *page);
 40 extern int migrate_huge_page_move_mapping(struct address_space *mapping,
 41                                   struct page *newpage, struct page *page);
 42 extern int migrate_page_move_mapping(struct address_space *mapping,
 43                 struct page *newpage, struct page *page,
 44                 struct buffer_head *head, enum migrate_mode mode,
 45                 int extra_count);
 46 #else
 47 
 48 static inline void putback_movable_pages(struct list_head *l) {}
 49 static inline int migrate_pages(struct list_head *l, new_page_t new,
 50                 free_page_t free, unsigned long private, enum migrate_mode mode,
 51                 int reason)
 52         { return -ENOSYS; }
 53 
 54 static inline int migrate_prep(void) { return -ENOSYS; }
 55 static inline int migrate_prep_local(void) { return -ENOSYS; }
 56 
 57 static inline void migrate_page_copy(struct page *newpage,
 58                                      struct page *page) {}
 59 
 60 static inline int migrate_huge_page_move_mapping(struct address_space *mapping,
 61                                   struct page *newpage, struct page *page)
 62 {
 63         return -ENOSYS;
 64 }
 65 
 66 #endif /* CONFIG_MIGRATION */
 67 
 68 #ifdef CONFIG_NUMA_BALANCING
 69 extern bool pmd_trans_migrating(pmd_t pmd);
 70 extern int migrate_misplaced_page(struct page *page,
 71                                   struct vm_area_struct *vma, int node);
 72 #else
 73 static inline bool pmd_trans_migrating(pmd_t pmd)
 74 {
 75         return false;
 76 }
 77 static inline int migrate_misplaced_page(struct page *page,
 78                                          struct vm_area_struct *vma, int node)
 79 {
 80         return -EAGAIN; /* can't migrate now */
 81 }
 82 #endif /* CONFIG_NUMA_BALANCING */
 83 
 84 #if defined(CONFIG_NUMA_BALANCING) && defined(CONFIG_TRANSPARENT_HUGEPAGE)
 85 extern int migrate_misplaced_transhuge_page(struct mm_struct *mm,
 86                         struct vm_area_struct *vma,
 87                         pmd_t *pmd, pmd_t entry,
 88                         unsigned long address,
 89                         struct page *page, int node);
 90 #else
 91 static inline int migrate_misplaced_transhuge_page(struct mm_struct *mm,
 92                         struct vm_area_struct *vma,
 93                         pmd_t *pmd, pmd_t entry,
 94                         unsigned long address,
 95                         struct page *page, int node)
 96 {
 97         return -EAGAIN;
 98 }
 99 #endif /* CONFIG_NUMA_BALANCING && CONFIG_TRANSPARENT_HUGEPAGE*/
100 
101 #endif /* _LINUX_MIGRATE_H */
102 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp