diff options
| author | Dmitry Torokhov <[email protected]> | 2023-05-01 15:20:08 -0700 | 
|---|---|---|
| committer | Dmitry Torokhov <[email protected]> | 2023-05-01 15:20:08 -0700 | 
| commit | 9a87ffc99ec8eb8d35eed7c4f816d75f5cc9662e (patch) | |
| tree | d57f3a63479a07b4e0cece029886e76e04feb984 /include/linux/mm_inline.h | |
| parent | 5dc63e56a9cf8df0b59c234a505a1653f1bdf885 (diff) | |
| parent | 53bea86b5712c7491bb3dae12e271666df0a308c (diff) | |
Merge branch 'next' into for-linus
Prepare input updates for 6.4 merge window.
Diffstat (limited to 'include/linux/mm_inline.h')
| -rw-r--r-- | include/linux/mm_inline.h | 22 | 
1 files changed, 16 insertions, 6 deletions
diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index e8ed225d8f7c..de1e622dd366 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h @@ -178,7 +178,7 @@ static inline void lru_gen_update_size(struct lruvec *lruvec, struct folio *foli  	int zone = folio_zonenum(folio);  	int delta = folio_nr_pages(folio);  	enum lru_list lru = type * LRU_INACTIVE_FILE; -	struct lru_gen_struct *lrugen = &lruvec->lrugen; +	struct lru_gen_folio *lrugen = &lruvec->lrugen;  	VM_WARN_ON_ONCE(old_gen != -1 && old_gen >= MAX_NR_GENS);  	VM_WARN_ON_ONCE(new_gen != -1 && new_gen >= MAX_NR_GENS); @@ -224,7 +224,7 @@ static inline bool lru_gen_add_folio(struct lruvec *lruvec, struct folio *folio,  	int gen = folio_lru_gen(folio);  	int type = folio_is_file_lru(folio);  	int zone = folio_zonenum(folio); -	struct lru_gen_struct *lrugen = &lruvec->lrugen; +	struct lru_gen_folio *lrugen = &lruvec->lrugen;  	VM_WARN_ON_ONCE_FOLIO(gen != -1, folio); @@ -256,9 +256,9 @@ static inline bool lru_gen_add_folio(struct lruvec *lruvec, struct folio *folio,  	lru_gen_update_size(lruvec, folio, -1, gen);  	/* for folio_rotate_reclaimable() */  	if (reclaiming) -		list_add_tail(&folio->lru, &lrugen->lists[gen][type][zone]); +		list_add_tail(&folio->lru, &lrugen->folios[gen][type][zone]);  	else -		list_add(&folio->lru, &lrugen->lists[gen][type][zone]); +		list_add(&folio->lru, &lrugen->folios[gen][type][zone]);  	return true;  } @@ -413,8 +413,7 @@ static inline void free_anon_vma_name(struct vm_area_struct *vma)  	 * Not using anon_vma_name because it generates a warning if mmap_lock  	 * is not held, which might be the case here.  	 */ -	if (!vma->vm_file) -		anon_vma_name_put(vma->anon_name); +	anon_vma_name_put(vma->anon_name);  }  static inline bool anon_vma_name_eq(struct anon_vma_name *anon_name1, @@ -578,4 +577,15 @@ pte_install_uffd_wp_if_needed(struct vm_area_struct *vma, unsigned long addr,  #endif  } +static inline bool vma_has_recency(struct vm_area_struct *vma) +{ +	if (vma->vm_flags & (VM_SEQ_READ | VM_RAND_READ)) +		return false; + +	if (vma->vm_file && (vma->vm_file->f_mode & FMODE_NOREUSE)) +		return false; + +	return true; +} +  #endif  |