linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
Cc: SeongJae Park <sj@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Brendan Higgins <brendan.higgins@linux.dev>,
	David Gow <davidgow@google.com>,
	damon@lists.linux.dev, kunit-dev@googlegroups.com,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-mm@kvack.org
Subject: [RFC PATCH 0/3] mm/damon: always respect min_nr_regions from the beginning
Date: Mon, 16 Feb 2026 16:03:55 -0800	[thread overview]
Message-ID: <20260217000400.69056-1-sj@kernel.org> (raw)

DAMON core assumes min_nr_regions parameter is respected by initial user
setup or the underlying operation set.  That is, users are supposed to
set up the initial monitoring regions to have more than min_nr_regions
regions.  When the virtual address operation set (vaddr) is used, users
can ask vaddr to do the setup entirely.  For the case, vaddr finds
regions for covering the current virtual address mappings, and split
regions to meet the min_nr_regions.  DAMON core therefore does nothing
for min_nr_regions at the beginning, and only avoids the number becoming
lower than min_nr_regions, by preventing regions merge operations when
needed.

The user setup requirement is somewhat too much, however, when the
min_nr_regions value is high.  Actually there was a report [1] of the
case.  Make below three changes for resolving the issue.

First (patch 1), drop the assumption and make DAMON core split regions
at the beginning for respecting the min_nr_regions.  Second (patch 2),
drop the vaddr's split operations and related code that are no more
needed.  Third (patch 3), add kunit test for the newly introduced
function.

[1] https://lore.kernel.org/CAC5umyjmJE9SBqjbetZZecpY54bHpn2AvCGNv3aF6J=1cfoPXQ@mail.gmail.com

SeongJae Park (3):
  mm/damon/core: split regions for min_nr_regions at beginning
  mm/damon/vaddr: do not split regions for min_nr_regions
  mm/damon/test/core-kunit: add damon_apply_min_nr_regions() test

 mm/damon/core.c              | 39 ++++++++++++++++--
 mm/damon/tests/core-kunit.h  | 52 ++++++++++++++++++++++++
 mm/damon/tests/vaddr-kunit.h | 76 ------------------------------------
 mm/damon/vaddr.c             | 70 +--------------------------------
 4 files changed, 89 insertions(+), 148 deletions(-)


base-commit: b2e07b9d93a9696f78fb21f2260d5798c6040b28
-- 
2.47.3


             reply	other threads:[~2026-02-17  0:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-17  0:03 SeongJae Park [this message]
2026-02-17  0:03 ` [RFC PATCH 1/3] mm/damon/core: split regions for min_nr_regions at beginning SeongJae Park
2026-02-20 15:13   ` SeongJae Park
2026-02-21 18:07     ` SeongJae Park
2026-02-17  0:03 ` [RFC PATCH 2/3] mm/damon/vaddr: do not split regions for min_nr_regions SeongJae Park
2026-02-17  0:03 ` [RFC PATCH 3/3] mm/damon/test/core-kunit: add damon_apply_min_nr_regions() test 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=20260217000400.69056-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=brendan.higgins@linux.dev \
    --cc=damon@lists.linux.dev \
    --cc=davidgow@google.com \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@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