cregit-Linux how code gets into the kernel

Release 4.12 include/linux/khugepaged.h

Directory: include/linux
#ifndef _LINUX_KHUGEPAGED_H

#define _LINUX_KHUGEPAGED_H

#include <linux/sched/coredump.h> /* MMF_VM_HUGEPAGE */


#ifdef CONFIG_TRANSPARENT_HUGEPAGE
extern struct attribute_group khugepaged_attr_group;

extern int khugepaged_init(void);
extern void khugepaged_destroy(void);
extern int start_stop_khugepaged(void);
extern int __khugepaged_enter(struct mm_struct *mm);
extern void __khugepaged_exit(struct mm_struct *mm);
extern int khugepaged_enter_vma_merge(struct vm_area_struct *vma,
				      unsigned long vm_flags);


#define khugepaged_enabled()					       \
	(transparent_hugepage_flags &                                  \
         ((1<<TRANSPARENT_HUGEPAGE_FLAG) |                     \
          (1<<TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG)))

#define khugepaged_always()				\
	(transparent_hugepage_flags &                   \
         (1<<TRANSPARENT_HUGEPAGE_FLAG))

#define khugepaged_req_madv()					\
	(transparent_hugepage_flags &                           \
         (1<<TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG))

#define khugepaged_defrag()					\
	(transparent_hugepage_flags &                           \
         (1<<TRANSPARENT_HUGEPAGE_DEFRAG_KHUGEPAGED_FLAG))


static inline int khugepaged_fork(struct mm_struct *mm, struct mm_struct *oldmm) { if (test_bit(MMF_VM_HUGEPAGE, &oldmm->flags)) return __khugepaged_enter(mm); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Andrea Arcangeli38100.00%1100.00%
Total38100.00%1100.00%


static inline void khugepaged_exit(struct mm_struct *mm) { if (test_bit(MMF_VM_HUGEPAGE, &mm->flags)) __khugepaged_exit(mm); }

Contributors

PersonTokensPropCommitsCommitProp
Andrea Arcangeli29100.00%1100.00%
Total29100.00%1100.00%


static inline int khugepaged_enter(struct vm_area_struct *vma, unsigned long vm_flags) { if (!test_bit(MMF_VM_HUGEPAGE, &vma->vm_mm->flags)) if ((khugepaged_always() || (khugepaged_req_madv() && (vm_flags & VM_HUGEPAGE))) && !(vm_flags & VM_NOHUGEPAGE)) if (__khugepaged_enter(vma->vm_mm)) return -ENOMEM; return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Andrea Arcangeli6691.67%266.67%
David Rientjes68.33%133.33%
Total72100.00%3100.00%

#else /* CONFIG_TRANSPARENT_HUGEPAGE */
static inline int khugepaged_fork(struct mm_struct *mm, struct mm_struct *oldmm) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Andrea Arcangeli20100.00%1100.00%
Total20100.00%1100.00%


static inline void khugepaged_exit(struct mm_struct *mm) { }

Contributors

PersonTokensPropCommitsCommitProp
Andrea Arcangeli11100.00%1100.00%
Total11100.00%1100.00%


static inline int khugepaged_enter(struct vm_area_struct *vma, unsigned long vm_flags) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Andrea Arcangeli1578.95%150.00%
David Rientjes421.05%150.00%
Total19100.00%2100.00%


static inline int khugepaged_enter_vma_merge(struct vm_area_struct *vma, unsigned long vm_flags) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Andrea Arcangeli1578.95%150.00%
David Rientjes421.05%150.00%
Total19100.00%2100.00%

#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ #endif /* _LINUX_KHUGEPAGED_H */

Overall Contributors

PersonTokensPropCommitsCommitProp
Andrea Arcangeli26985.67%240.00%
Kirill A. Shutemov268.28%120.00%
David Rientjes185.73%120.00%
Ingo Molnar10.32%120.00%
Total314100.00%5100.00%
Directory: include/linux
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.