diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/hugetlb.h | 19 | ||||
-rw-r--r-- | include/linux/mm_types.h | 3 |
2 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 5e35379f58a5..685c262e0be8 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -483,6 +483,17 @@ static inline spinlock_t *huge_pte_lockptr(struct hstate *h, | |||
483 | #define hugepages_supported() (HPAGE_SHIFT != 0) | 483 | #define hugepages_supported() (HPAGE_SHIFT != 0) |
484 | #endif | 484 | #endif |
485 | 485 | ||
486 | void hugetlb_report_usage(struct seq_file *m, struct mm_struct *mm); | ||
487 | |||
488 | static inline void hugetlb_count_add(long l, struct mm_struct *mm) | ||
489 | { | ||
490 | atomic_long_add(l, &mm->hugetlb_usage); | ||
491 | } | ||
492 | |||
493 | static inline void hugetlb_count_sub(long l, struct mm_struct *mm) | ||
494 | { | ||
495 | atomic_long_sub(l, &mm->hugetlb_usage); | ||
496 | } | ||
486 | #else /* CONFIG_HUGETLB_PAGE */ | 497 | #else /* CONFIG_HUGETLB_PAGE */ |
487 | struct hstate {}; | 498 | struct hstate {}; |
488 | #define alloc_huge_page(v, a, r) NULL | 499 | #define alloc_huge_page(v, a, r) NULL |
@@ -519,6 +530,14 @@ static inline spinlock_t *huge_pte_lockptr(struct hstate *h, | |||
519 | { | 530 | { |
520 | return &mm->page_table_lock; | 531 | return &mm->page_table_lock; |
521 | } | 532 | } |
533 | |||
534 | static inline void hugetlb_report_usage(struct seq_file *f, struct mm_struct *m) | ||
535 | { | ||
536 | } | ||
537 | |||
538 | static inline void hugetlb_count_sub(long l, struct mm_struct *mm) | ||
539 | { | ||
540 | } | ||
522 | #endif /* CONFIG_HUGETLB_PAGE */ | 541 | #endif /* CONFIG_HUGETLB_PAGE */ |
523 | 542 | ||
524 | static inline spinlock_t *huge_pte_lock(struct hstate *h, | 543 | static inline spinlock_t *huge_pte_lock(struct hstate *h, |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 3d6baa7d4534..0a85da25a822 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -486,6 +486,9 @@ struct mm_struct { | |||
486 | /* address of the bounds directory */ | 486 | /* address of the bounds directory */ |
487 | void __user *bd_addr; | 487 | void __user *bd_addr; |
488 | #endif | 488 | #endif |
489 | #ifdef CONFIG_HUGETLB_PAGE | ||
490 | atomic_long_t hugetlb_usage; | ||
491 | #endif | ||
489 | }; | 492 | }; |
490 | 493 | ||
491 | static inline void mm_init_cpumask(struct mm_struct *mm) | 494 | static inline void mm_init_cpumask(struct mm_struct *mm) |