All of lore.kernel.org
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: SeongJae Park <sj@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	honggyu.kim@sk.com, hyeongtak.ji@sk.com, kernel_team@skhynix.com,
	damon@lists.linux.dev, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 3/3] mm/damon/paddr: support DAMOS filter type YOUNG
Date: Fri,  8 Mar 2024 17:53:11 -0800	[thread overview]
Message-ID: <20240309015311.45954-1-sj@kernel.org> (raw)
In-Reply-To: <20240307030013.47041-4-sj@kernel.org>

On Wed,  6 Mar 2024 19:00:13 -0800 SeongJae Park <sj@kernel.org> wrote:

> DAMOS filter of type YOUNG is defined, but not yet implemented by any
> DAMON operations set.  Add the implementation to the DAMON operations
> set for the physical address space, paddr.
> 
> Signed-off-by: SeongJae Park <sj@kernel.org>
> ---
>  mm/damon/paddr.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c
> index deee0fdf2e5b..52e4be7351cc 100644
> --- a/mm/damon/paddr.c
> +++ b/mm/damon/paddr.c
> @@ -209,6 +209,9 @@ static bool __damos_pa_filter_out(struct damos_filter *filter,
>  			matched = filter->memcg_id == mem_cgroup_id(memcg);
>  		rcu_read_unlock();
>  		break;
> +	case DAMOS_FILTER_TYPE_YOUNG:
> +		matched = damon_folio_young(folio);
> +		break;

damon_folio_young() doesn't reset the Accessed bit of the folio.  Hence, unless
something is resetting the bit, this damon_folio_young() call will repeatedly
return true even if there was no access to the folio since last check.  We
should implement Accessed bit test-and-reset variant of this function and
replace this, or call damon_pa_mkold() when 'matched' is 'true'.

I will fix this in the next spin.


Thanks,
SJ


>  	default:
>  		break;
>  	}
> -- 
> 2.39.2

      reply	other threads:[~2024-03-09  1:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07  3:00 [RFC PATCH 0/3] mm/damon: add a DAMOS filter type for page granularity access recheck SeongJae Park
2024-03-07  3:00 ` [RFC PATCH 1/3] mm/damon: add DAMOS filter type YOUNG SeongJae Park
2024-03-07  3:00 ` [RFC PATCH 2/3] mm/damon/paddr: implement damon_folio_young() SeongJae Park
2024-03-07  3:00 ` [RFC PATCH 3/3] mm/damon/paddr: support DAMOS filter type YOUNG SeongJae Park
2024-03-09  1:53   ` SeongJae Park [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240309015311.45954-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=honggyu.kim@sk.com \
    --cc=hyeongtak.ji@sk.com \
    --cc=kernel_team@skhynix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.