mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-08 06:53:30 -04:00
memory tiering: introduce folio_use_access_time() check
If memory tiering mode is on and a folio is not in the top tier memory, folio's cpupid field is repurposed to store page access time. Instead of an open coded check, use a function to encapsulate the check. Link: https://lkml.kernel.org/r/20240724130115.793641-3-ziy@nvidia.com Signed-off-by: Zi Yan <ziy@nvidia.com> Reviewed-by: "Huang, Ying" <ying.huang@intel.com> Acked-by: David Hildenbrand <david@redhat.com> Reviewed-by: Kefeng Wang <wangkefeng.wang@huawei.com> Cc: Baolin Wang <baolin.wang@linux.alibaba.com> Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
@@ -1745,6 +1745,8 @@ static inline void vma_set_access_pid_bit(struct vm_area_struct *vma)
|
||||
__set_bit(pid_bit, &vma->numab_state->pids_active[1]);
|
||||
}
|
||||
}
|
||||
|
||||
bool folio_use_access_time(struct folio *folio);
|
||||
#else /* !CONFIG_NUMA_BALANCING */
|
||||
static inline int folio_xchg_last_cpupid(struct folio *folio, int cpupid)
|
||||
{
|
||||
@@ -1798,6 +1800,10 @@ static inline bool cpupid_match_pid(struct task_struct *task, int cpupid)
|
||||
static inline void vma_set_access_pid_bit(struct vm_area_struct *vma)
|
||||
{
|
||||
}
|
||||
static inline bool folio_use_access_time(struct folio *folio)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif /* CONFIG_NUMA_BALANCING */
|
||||
|
||||
#if defined(CONFIG_KASAN_SW_TAGS) || defined(CONFIG_KASAN_HW_TAGS)
|
||||
|
||||
Reference in New Issue
Block a user