#ifndef LINUX_MM_INLINE_H
#define LINUX_MM_INLINE_H
#include <linux/atomic.h>
#include <linux/huge_mm.h>
#include <linux/mm_types.h>
#include <linux/swap.h>
#include <linux/string.h>
#include <linux/userfaultfd_k.h>
#include <linux/swapops.h>
static inline int folio_is_file_lru(struct folio *folio)
{ … }
static inline int page_is_file_lru(struct page *page)
{ … }
static __always_inline void __update_lru_size(struct lruvec *lruvec,
enum lru_list lru, enum zone_type zid,
long nr_pages)
{ … }
static __always_inline void update_lru_size(struct lruvec *lruvec,
enum lru_list lru, enum zone_type zid,
long nr_pages)
{ … }
static __always_inline void __folio_clear_lru_flags(struct folio *folio)
{ … }
static __always_inline enum lru_list folio_lru_list(struct folio *folio)
{ … }
#ifdef CONFIG_LRU_GEN
#ifdef CONFIG_LRU_GEN_ENABLED
static inline bool lru_gen_enabled(void)
{ … }
#else
static inline bool lru_gen_enabled(void)
{
DECLARE_STATIC_KEY_FALSE(lru_gen_caps[NR_LRU_GEN_CAPS]);
return static_branch_unlikely(&lru_gen_caps[LRU_GEN_CORE]);
}
#endif
static inline bool lru_gen_in_fault(void)
{ … }
static inline int lru_gen_from_seq(unsigned long seq)
{ … }
static inline int lru_hist_from_seq(unsigned long seq)
{ … }
static inline int lru_tier_from_refs(int refs)
{ … }
static inline int folio_lru_refs(struct folio *folio)
{ … }
static inline int folio_lru_gen(struct folio *folio)
{ … }
static inline bool lru_gen_is_active(struct lruvec *lruvec, int gen)
{ … }
static inline void lru_gen_update_size(struct lruvec *lruvec, struct folio *folio,
int old_gen, int new_gen)
{ … }
static inline bool lru_gen_add_folio(struct lruvec *lruvec, struct folio *folio, bool reclaiming)
{ … }
static inline bool lru_gen_del_folio(struct lruvec *lruvec, struct folio *folio, bool reclaiming)
{ … }
#else
static inline bool lru_gen_enabled(void)
{
return false;
}
static inline bool lru_gen_in_fault(void)
{
return false;
}
static inline bool lru_gen_add_folio(struct lruvec *lruvec, struct folio *folio, bool reclaiming)
{
return false;
}
static inline bool lru_gen_del_folio(struct lruvec *lruvec, struct folio *folio, bool reclaiming)
{
return false;
}
#endif
static __always_inline
void lruvec_add_folio(struct lruvec *lruvec, struct folio *folio)
{ … }
static __always_inline
void lruvec_add_folio_tail(struct lruvec *lruvec, struct folio *folio)
{ … }
static __always_inline
void lruvec_del_folio(struct lruvec *lruvec, struct folio *folio)
{ … }
#ifdef CONFIG_ANON_VMA_NAME
static inline void anon_vma_name_get(struct anon_vma_name *anon_name)
{ … }
static inline void anon_vma_name_put(struct anon_vma_name *anon_name)
{ … }
static inline
struct anon_vma_name *anon_vma_name_reuse(struct anon_vma_name *anon_name)
{ … }
static inline void dup_anon_vma_name(struct vm_area_struct *orig_vma,
struct vm_area_struct *new_vma)
{ … }
static inline void free_anon_vma_name(struct vm_area_struct *vma)
{ … }
static inline bool anon_vma_name_eq(struct anon_vma_name *anon_name1,
struct anon_vma_name *anon_name2)
{ … }
#else
static inline void anon_vma_name_get(struct anon_vma_name *anon_name) {}
static inline void anon_vma_name_put(struct anon_vma_name *anon_name) {}
static inline void dup_anon_vma_name(struct vm_area_struct *orig_vma,
struct vm_area_struct *new_vma) {}
static inline void free_anon_vma_name(struct vm_area_struct *vma) {}
static inline bool anon_vma_name_eq(struct anon_vma_name *anon_name1,
struct anon_vma_name *anon_name2)
{
return true;
}
#endif
static inline void init_tlb_flush_pending(struct mm_struct *mm)
{ … }
static inline void inc_tlb_flush_pending(struct mm_struct *mm)
{ … }
static inline void dec_tlb_flush_pending(struct mm_struct *mm)
{ … }
static inline bool mm_tlb_flush_pending(struct mm_struct *mm)
{ … }
static inline bool mm_tlb_flush_nested(struct mm_struct *mm)
{ … }
#ifdef CONFIG_MMU
static inline pte_marker copy_pte_marker(
swp_entry_t entry, struct vm_area_struct *dst_vma)
{ … }
#endif
static inline void
pte_install_uffd_wp_if_needed(struct vm_area_struct *vma, unsigned long addr,
pte_t *pte, pte_t pteval)
{ … }
static inline bool vma_has_recency(struct vm_area_struct *vma)
{ … }
#endif