File Index
Files and directories
Sign in
FILE

khugepaged.h

File preview with syntax highlighting.

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