mm/damon: rename damon_pageout_score() to damon_cold_score()

In the beginning there is only one damos_action 'DAMOS_PAGEOUT' that need
to get the coldness score of a region for a scheme, which using
damon_pageout_score() to do that.  But now there are also other
damos_action actions need the coldness score, so rename it to
damon_cold_score() to make more sense.

Link: https://lkml.kernel.org/r/1663423014-28907-1-git-send-email-kaixuxia@tencent.com
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Kaixu Xia 2022-09-17 21:56:54 +08:00 committed by Andrew Morton
parent 2b21624fc2
commit e3e486e634
4 changed files with 5 additions and 5 deletions

View File

@ -130,7 +130,7 @@ int damon_hot_score(struct damon_ctx *c, struct damon_region *r,
return hotness; return hotness;
} }
int damon_pageout_score(struct damon_ctx *c, struct damon_region *r, int damon_cold_score(struct damon_ctx *c, struct damon_region *r,
struct damos *s) struct damos *s)
{ {
int hotness = damon_hot_score(c, r, s); int hotness = damon_hot_score(c, r, s);

View File

@ -12,7 +12,7 @@ struct page *damon_get_page(unsigned long pfn);
void damon_ptep_mkold(pte_t *pte, struct mm_struct *mm, unsigned long addr); void damon_ptep_mkold(pte_t *pte, struct mm_struct *mm, unsigned long addr);
void damon_pmdp_mkold(pmd_t *pmd, struct mm_struct *mm, unsigned long addr); void damon_pmdp_mkold(pmd_t *pmd, struct mm_struct *mm, unsigned long addr);
int damon_pageout_score(struct damon_ctx *c, struct damon_region *r, int damon_cold_score(struct damon_ctx *c, struct damon_region *r,
struct damos *s); struct damos *s);
int damon_hot_score(struct damon_ctx *c, struct damon_region *r, int damon_hot_score(struct damon_ctx *c, struct damon_region *r,
struct damos *s); struct damos *s);

View File

@ -287,11 +287,11 @@ static int damon_pa_scheme_score(struct damon_ctx *context,
{ {
switch (scheme->action) { switch (scheme->action) {
case DAMOS_PAGEOUT: case DAMOS_PAGEOUT:
return damon_pageout_score(context, r, scheme); return damon_cold_score(context, r, scheme);
case DAMOS_LRU_PRIO: case DAMOS_LRU_PRIO:
return damon_hot_score(context, r, scheme); return damon_hot_score(context, r, scheme);
case DAMOS_LRU_DEPRIO: case DAMOS_LRU_DEPRIO:
return damon_pageout_score(context, r, scheme); return damon_cold_score(context, r, scheme);
default: default:
break; break;
} }

View File

@ -673,7 +673,7 @@ static int damon_va_scheme_score(struct damon_ctx *context,
switch (scheme->action) { switch (scheme->action) {
case DAMOS_PAGEOUT: case DAMOS_PAGEOUT:
return damon_pageout_score(context, r, scheme); return damon_cold_score(context, r, scheme);
default: default:
break; break;
} }