linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yun Levi <ppbuk5246@gmail.com>
To: SeongJae Park <sj@kernel.org>
Cc: damon@lists.linux.dev, linux-mm@kvack.org,
	 Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [Question] Should we reuse target when damon's operation changed?
Date: Wed, 30 Nov 2022 15:01:29 +0900	[thread overview]
Message-ID: <CAM7-yPSL2ewn9kjaR01vq8V410G+F1taJzAqVuvNOJOkbX7URw@mail.gmail.com> (raw)

Hello SJ.

While I try to use damon, I have some questions whether it is correct
to reuse damon_target structure when damon's operation is changed.

At first, one user set up damon like below.
    echo 1 > /sys/kernel/mm/damon/admin/kdamonds/nr_kdamonds
    echo 1 > /sys/kernel/mm/damon/admin/kdamonds/0/contexts/nr_contexts
    echo 1 > /sys/kernel/mm/damon/admin/kdamonds/0/contexts/0/targets/nr_targets
    echo 1 > /sys/kernel/mm/damon/admin/kdamonds/0/contexts/0/targets/pid_target
    echo 1 > /sys/kernel/mm/damon/admin/kdamonds/0/contexts/0/targets/regions/nr_regions
    echo 0 > /sys/kernel/mm/damon/admin/kdamonds/0/contexts/0/targets/regions/nr_regions/0/start
    echo 16384 >
/sys/kernel/mm/damon/admin/kdamonds/0/contexts/0/targets/regions/nr_regions/0/end

    echo vaddr >  /sys/kernel/mm/damon/admin/kdamonds/0/contexts/0/operation
    echo on >  /sys/kernel/mm/damon/admin/kdamonds/0/contexts/0/state

And some time pass, user change the operation as "paddr" like below:
    echo paddr >  /sys/kernel/mm/damon/admin/kdamonds/0/contexts/0/operation
    echo commit >  /sys/kernel/mm/damon/admin/kdamonds/0/contexts/0/state

In that situation, the damon_target is reused and the region isn't changed,
former region information which damon_region has -- nr_accesse,
last_nr_accesss, last_sample addr is kept.

But, former accessed information is based on vaddr and changed
accessed information should be based on paddr and it seems the wrong
information to new applied operation.

IIUC, it makes some confusion to kdamond when it merges or splits
regions based on above information.

So, Is it much better to remove the target and region information when
the operation is changed? or should we check whether it's possible to
reuse former access information between former and new operation?

Thanks.

-- 
Best regards,
Levi


             reply	other threads:[~2022-11-30  6:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-30  6:01 Yun Levi [this message]
2022-11-30 23:24 ` SeongJae Park

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=CAM7-yPSL2ewn9kjaR01vq8V410G+F1taJzAqVuvNOJOkbX7URw@mail.gmail.com \
    --to=ppbuk5246@gmail.com \
    --cc=damon@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sj@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox