linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: SeongJae Park <sj@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
	damon@lists.linux.dev, linux-mm@kvack.org,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/9] Docs/mm/damon/design: clarify regions merging operation
Date: Mon,  1 Jul 2024 12:26:59 -0700	[thread overview]
Message-ID: <20240701192706.51415-3-sj@kernel.org> (raw)
In-Reply-To: <20240701192706.51415-1-sj@kernel.org>

DAMON design document is not explaining how min_nr_regions limit is
kept, and what happens if the number of regions exceeds max_nr_regions.
Add more clarification for those.

Signed-off-by: SeongJae Park <sj@kernel.org>
---
 Documentation/mm/damon/design.rst | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst
index 6beb245cbb62..fe08a3796e60 100644
--- a/Documentation/mm/damon/design.rst
+++ b/Documentation/mm/damon/design.rst
@@ -209,11 +209,18 @@ the data access pattern can be dynamically changed.  This will result in low
 monitoring quality.  To keep the assumption as much as possible, DAMON
 adaptively merges and splits each region based on their access frequency.
 
-For each ``aggregation interval``, it compares the access frequencies of
-adjacent regions and merges those if the frequency difference is small.  Then,
-after it reports and clears the aggregated access frequency of each region, it
-splits each region into two or three regions if the total number of regions
-will not exceed the user-specified maximum number of regions after the split.
+For each ``aggregation interval``, it compares the access frequencies
+(``nr_accesses``) of adjacent regions.  If the difference is small, and if the
+sum of the two regions' sizes is smaller than the size of total regions divided
+by the ``minimum number of regions``, DAMON merges the two regions.  If the
+resulting number of total regions is still higher than ``maximum number of
+regions``, it repeats the merging with increasing access frequenceis difference
+threshold until the upper-limit of the number of regions is met, or the
+threshold becomes higher than possible maximum value (``aggregation interval``
+divided by ``sampling interval``).   Then, after it reports and clears the
+aggregated access frequency of each region, it splits each region into two or
+three regions if the total number of regions will not exceed the user-specified
+maximum number of regions after the split.
 
 In this way, DAMON provides its best-effort quality and minimal overhead while
 keeping the bounds users set for their trade-off.
-- 
2.39.2



  parent reply	other threads:[~2024-07-01 19:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01 19:26 [PATCH 0/9] Docs/damon: minor fixups and improvements SeongJae Park
2024-07-01 19:26 ` [PATCH 1/9] Docs/mm/damon/design: fix two typos SeongJae Park
2024-07-01 19:26 ` SeongJae Park [this message]
2024-07-01 19:27 ` [PATCH 3/9] Docs/admin-guide/mm/damon/start: add access pattern snapshot example SeongJae Park
2024-07-01 19:27 ` [PATCH 4/9] Docs/mm/damon/design: add links from overall architecture to sections of details SeongJae Park
2024-07-01 19:27 ` [PATCH 5/9] Docs/mm/damon/design: move 'Configurable Operations Set' section into 'Operations Set Layer' section SeongJae Park
2024-07-01 19:27 ` [PATCH 6/9] Docs/mm/damon/design: Remove 'Programmable Modules' section in favor of 'Modules' section SeongJae Park
2024-07-01 19:27 ` [PATCH 7/9] Docs/mm/damon/design: add links to sections of DAMON sysfs interface usage doc SeongJae Park
2024-07-01 19:27 ` [PATCH 8/9] Docs/mm/damon/index: add links to design SeongJae Park
2024-07-01 19:27 ` [PATCH 9/9] Docs/mm/damon/index: add links to admin-guide doc 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=20240701192706.51415-3-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=damon@lists.linux.dev \
    --cc=linux-doc@vger.kernel.org \
    --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 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).