Warning: This file is not a C or C++ file. It does not have highlighting.

1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _LINUX_KHUGEPAGED_H
3#define _LINUX_KHUGEPAGED_H
4
5#include <linux/sched/coredump.h> /* MMF_VM_HUGEPAGE */
6
7#ifdef CONFIG_TRANSPARENT_HUGEPAGE
8extern struct attribute_group khugepaged_attr_group;
9
10extern int khugepaged_init(void);
11extern void khugepaged_destroy(void);
12extern int start_stop_khugepaged(void);
13extern void __khugepaged_enter(struct mm_struct *mm);
14extern void __khugepaged_exit(struct mm_struct *mm);
15extern void khugepaged_enter_vma(struct vm_area_struct *vma,
16 unsigned long vm_flags);
17extern void khugepaged_min_free_kbytes_update(void);
18#ifdef CONFIG_SHMEM
19extern void collapse_pte_mapped_thp(struct mm_struct *mm, unsigned long addr);
20#else
21static inline void collapse_pte_mapped_thp(struct mm_struct *mm,
22 unsigned long addr)
23{
24}
25#endif
26
27static inline void khugepaged_fork(struct mm_struct *mm, struct mm_struct *oldmm)
28{
29 if (test_bit(MMF_VM_HUGEPAGE, &oldmm->flags))
30 __khugepaged_enter(mm);
31}
32
33static inline void khugepaged_exit(struct mm_struct *mm)
34{
35 if (test_bit(MMF_VM_HUGEPAGE, &mm->flags))
36 __khugepaged_exit(mm);
37}
38#else /* CONFIG_TRANSPARENT_HUGEPAGE */
39static inline void khugepaged_fork(struct mm_struct *mm, struct mm_struct *oldmm)
40{
41}
42static inline void khugepaged_exit(struct mm_struct *mm)
43{
44}
45static inline void khugepaged_enter_vma(struct vm_area_struct *vma,
46 unsigned long vm_flags)
47{
48}
49static inline void collapse_pte_mapped_thp(struct mm_struct *mm,
50 unsigned long addr)
51{
52}
53
54static inline void khugepaged_min_free_kbytes_update(void)
55{
56}
57#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
58
59#endif /* _LINUX_KHUGEPAGED_H */
60

Warning: This file is not a C or C++ file. It does not have highlighting.

source code of linux/include/linux/khugepaged.h