diff options
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r-- | include/linux/mm.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index 4af4f0b1be4c..7f4f906190bd 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -693,6 +693,36 @@ static inline int page_to_nid(const struct page *page) | |||
693 | } | 693 | } |
694 | #endif | 694 | #endif |
695 | 695 | ||
696 | #ifdef CONFIG_NUMA_BALANCING | ||
697 | static inline int page_xchg_last_nid(struct page *page, int nid) | ||
698 | { | ||
699 | return xchg(&page->_last_nid, nid); | ||
700 | } | ||
701 | |||
702 | static inline int page_last_nid(struct page *page) | ||
703 | { | ||
704 | return page->_last_nid; | ||
705 | } | ||
706 | static inline void reset_page_last_nid(struct page *page) | ||
707 | { | ||
708 | page->_last_nid = -1; | ||
709 | } | ||
710 | #else | ||
711 | static inline int page_xchg_last_nid(struct page *page, int nid) | ||
712 | { | ||
713 | return page_to_nid(page); | ||
714 | } | ||
715 | |||
716 | static inline int page_last_nid(struct page *page) | ||
717 | { | ||
718 | return page_to_nid(page); | ||
719 | } | ||
720 | |||
721 | static inline void reset_page_last_nid(struct page *page) | ||
722 | { | ||
723 | } | ||
724 | #endif | ||
725 | |||
696 | static inline struct zone *page_zone(const struct page *page) | 726 | static inline struct zone *page_zone(const struct page *page) |
697 | { | 727 | { |
698 | return &NODE_DATA(page_to_nid(page))->node_zones[page_zonenum(page)]; | 728 | return &NODE_DATA(page_to_nid(page))->node_zones[page_zonenum(page)]; |
@@ -1078,6 +1108,9 @@ extern unsigned long move_page_tables(struct vm_area_struct *vma, | |||
1078 | extern unsigned long do_mremap(unsigned long addr, | 1108 | extern unsigned long do_mremap(unsigned long addr, |
1079 | unsigned long old_len, unsigned long new_len, | 1109 | unsigned long old_len, unsigned long new_len, |
1080 | unsigned long flags, unsigned long new_addr); | 1110 | unsigned long flags, unsigned long new_addr); |
1111 | extern unsigned long change_protection(struct vm_area_struct *vma, unsigned long start, | ||
1112 | unsigned long end, pgprot_t newprot, | ||
1113 | int dirty_accountable, int prot_numa); | ||
1081 | extern int mprotect_fixup(struct vm_area_struct *vma, | 1114 | extern int mprotect_fixup(struct vm_area_struct *vma, |
1082 | struct vm_area_struct **pprev, unsigned long start, | 1115 | struct vm_area_struct **pprev, unsigned long start, |
1083 | unsigned long end, unsigned long newflags); | 1116 | unsigned long end, unsigned long newflags); |
@@ -1579,6 +1612,11 @@ static inline pgprot_t vm_get_page_prot(unsigned long vm_flags) | |||
1579 | } | 1612 | } |
1580 | #endif | 1613 | #endif |
1581 | 1614 | ||
1615 | #ifdef CONFIG_ARCH_USES_NUMA_PROT_NONE | ||
1616 | unsigned long change_prot_numa(struct vm_area_struct *vma, | ||
1617 | unsigned long start, unsigned long end); | ||
1618 | #endif | ||
1619 | |||
1582 | struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr); | 1620 | struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr); |
1583 | int remap_pfn_range(struct vm_area_struct *, unsigned long addr, | 1621 | int remap_pfn_range(struct vm_area_struct *, unsigned long addr, |
1584 | unsigned long pfn, unsigned long size, pgprot_t); | 1622 | unsigned long pfn, unsigned long size, pgprot_t); |
@@ -1600,6 +1638,7 @@ struct page *follow_page(struct vm_area_struct *, unsigned long address, | |||
1600 | #define FOLL_MLOCK 0x40 /* mark page as mlocked */ | 1638 | #define FOLL_MLOCK 0x40 /* mark page as mlocked */ |
1601 | #define FOLL_SPLIT 0x80 /* don't return transhuge pages, split them */ | 1639 | #define FOLL_SPLIT 0x80 /* don't return transhuge pages, split them */ |
1602 | #define FOLL_HWPOISON 0x100 /* check page is hwpoisoned */ | 1640 | #define FOLL_HWPOISON 0x100 /* check page is hwpoisoned */ |
1641 | #define FOLL_NUMA 0x200 /* force NUMA hinting page fault */ | ||
1603 | 1642 | ||
1604 | typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr, | 1643 | typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr, |
1605 | void *data); | 1644 | void *data); |