#define pr_fmt(fmt) …
#include <linux/mmu_notifier.h>
#include <linux/page_idle.h>
#include <linux/pagemap.h>
#include <linux/rmap.h>
#include <linux/swap.h>
#include <linux/memory-tiers.h>
#include <linux/migrate.h>
#include <linux/mm_inline.h>
#include "../internal.h"
#include "ops-common.h"
static bool damon_folio_mkold_one(struct folio *folio,
struct vm_area_struct *vma, unsigned long addr, void *arg)
{ … }
static void damon_folio_mkold(struct folio *folio)
{ … }
static void damon_pa_mkold(unsigned long paddr)
{ … }
static void __damon_pa_prepare_access_check(struct damon_region *r)
{ … }
static void damon_pa_prepare_access_checks(struct damon_ctx *ctx)
{ … }
static bool damon_folio_young_one(struct folio *folio,
struct vm_area_struct *vma, unsigned long addr, void *arg)
{ … }
static bool damon_folio_young(struct folio *folio)
{ … }
static bool damon_pa_young(unsigned long paddr, unsigned long *folio_sz)
{ … }
static void __damon_pa_check_access(struct damon_region *r,
struct damon_attrs *attrs)
{ … }
static unsigned int damon_pa_check_accesses(struct damon_ctx *ctx)
{ … }
static bool __damos_pa_filter_out(struct damos_filter *filter,
struct folio *folio)
{ … }
static bool damos_pa_filter_out(struct damos *scheme, struct folio *folio)
{ … }
static unsigned long damon_pa_pageout(struct damon_region *r, struct damos *s)
{ … }
static inline unsigned long damon_pa_mark_accessed_or_deactivate(
struct damon_region *r, struct damos *s, bool mark_accessed)
{ … }
static unsigned long damon_pa_mark_accessed(struct damon_region *r,
struct damos *s)
{ … }
static unsigned long damon_pa_deactivate_pages(struct damon_region *r,
struct damos *s)
{ … }
static unsigned int __damon_pa_migrate_folio_list(
struct list_head *migrate_folios, struct pglist_data *pgdat,
int target_nid)
{ … }
static unsigned int damon_pa_migrate_folio_list(struct list_head *folio_list,
struct pglist_data *pgdat,
int target_nid)
{ … }
static unsigned long damon_pa_migrate_pages(struct list_head *folio_list,
int target_nid)
{ … }
static unsigned long damon_pa_migrate(struct damon_region *r, struct damos *s)
{ … }
static unsigned long damon_pa_apply_scheme(struct damon_ctx *ctx,
struct damon_target *t, struct damon_region *r,
struct damos *scheme)
{ … }
static int damon_pa_scheme_score(struct damon_ctx *context,
struct damon_target *t, struct damon_region *r,
struct damos *scheme)
{ … }
static int __init damon_pa_initcall(void)
{
struct damon_operations ops = {
.id = DAMON_OPS_PADDR,
.init = NULL,
.update = NULL,
.prepare_access_checks = damon_pa_prepare_access_checks,
.check_accesses = damon_pa_check_accesses,
.reset_aggregated = NULL,
.target_valid = NULL,
.cleanup = NULL,
.apply_scheme = damon_pa_apply_scheme,
.get_scheme_score = damon_pa_scheme_score,
};
return damon_register_ops(&ops);
};
subsys_initcall(damon_pa_initcall);