linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: cuiyangpei <cuiyangpei@gmail.com>
To: SeongJae Park <sj@kernel.org>
Cc: akpm@linux-foundation.org, damon@lists.linux.dev,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	xiongping1@xiaomi.com
Subject: Re: [PATCH 1/2] mm/damon/sysfs: Implement recording feature
Date: Mon, 29 Jan 2024 20:13:16 +0800	[thread overview]
Message-ID: <20240129121316.GA9706@cuiyangpei> (raw)
In-Reply-To: <20240128162804.17866-1-sj@kernel.org>

On Sun, Jan 28, 2024 at 08:28:04AM -0800, SeongJae Park wrote:
> On Sun, 28 Jan 2024 17:13:00 +0800 cuiyangpei <cuiyangpei@gmail.com> wrote:
> 
> > On Fri, Jan 26, 2024 at 12:04:54AM -0800, SeongJae Park wrote:
> [...]
> > > So, 'update_schemes_tried_regions' command is firstly handled by
> > > 'damon_sysfs_cmd_request_callback()', which is registered as
> > > after_wmarks_check() and after_aggregation() callback.  Hence
> > > 'update_schemes_tried_regions' command is still effectively working in
> > > aggregation interval granularity.  I think this is what you found, right?
> > > 
> > Yes.
> > > If I'm not wrongly understanding your point, I think the concern is valid.  I
> > > think we should make it works in sampling interval granularity.  I will try to
> > > make so.  Would that work for your use case?
> > > 
> > It's much better than working in aggregation interval.
> 
> Thank you for confirming.  I will start working on this.
> 

Great, looking forward to seeing the progress.

> > 
> > I have a question. Why does the 'update_schemes_tried_regions' command need to work
> > in the sampling time or aggregation time? 'update_schemes_tried_regions' is a
> > relatively special state that updates the regions that corresponding operation scheme.
> > Can it be separated from other states and controlled by sysfs node to respond immediately
> > after being written?
> 
> Mainly because the region data is updated by a kdamond thread.  To safely
> access the region, the accessor should do some kind of synchronization with the
> kdamond thread.  To minimize such synchronization overhead, DAMON let the API
> users (kernel components) to register callbacks which kdamond invokes under
> specific events including 'after_sampling' or 'after_aggregate'.  Because the
> callback is executed in the kdamond thread, callbacks can safely access the
> data without additional synchronization.  DAMON sysfs interface is using the
> callback mechanism, and hence need to work in the sampling or aggregation
> times.
> 
Thank you for the detailed explanation.

> Thanks,
> SJ
> 
> [...]


  reply	other threads:[~2024-01-29 12:13 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-28  7:34 [PATCH 1/2] mm/damon/sysfs: Implement recording feature cuiyangpei
2023-11-28  7:34 ` [PATCH 2/2] mm/damon/core: add sysfs nodes to set last_nr_accesses weight cuiyangpei
2023-11-28 16:11 ` [PATCH 1/2] mm/damon/sysfs: Implement recording feature kernel test robot
2023-11-28 16:21 ` kernel test robot
2023-11-28 18:57 ` SeongJae Park
2023-11-29  7:58   ` Cui Yangpei
2023-11-29 13:13   ` cuiyangpei
2023-11-29 17:10     ` SeongJae Park
2023-11-30  9:14       ` cuiyangpei
2023-11-30 19:44         ` SeongJae Park
2023-12-01 12:25           ` cuiyangpei
2023-12-01 17:31             ` SeongJae Park
2023-12-03  5:43               ` cuiyangpei
2023-12-03 19:37                 ` SeongJae Park
2024-01-22  5:46                   ` cuiyangpei
2024-01-22 17:56                     ` SeongJae Park
2024-01-26  6:57                       ` cuiyangpei
2024-01-26  8:04                         ` SeongJae Park
2024-01-28  9:13                           ` cuiyangpei
2024-01-28 16:28                             ` SeongJae Park
2024-01-29 12:13                               ` cuiyangpei [this message]
2024-02-06  2:56                                 ` SeongJae Park
2024-02-06  3:26                                   ` cuiyangpei

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=20240129121316.GA9706@cuiyangpei \
    --to=cuiyangpei@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sj@kernel.org \
    --cc=xiongping1@xiaomi.com \
    /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;
as well as URLs for NNTP newsgroup(s).