From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,lianux.mm@gmail.com,jm5905938@gmail.com,
sj@kernel.org,akpm@linux-foundation.org
Subject: + mm-damon-core-introduce-damon_report_exist.patch added to mm-new branch
Date: Tue, 24 Nov 2026 09:23:29 -0800 [thread overview]
Message-ID: <20261124172330.3CFC41F000E0@smtp.kernel.org> (raw)
In-Reply-To: <20261124153636.91854-14-sj@kernel.org>
The patch titled
Subject: mm/damon/core: introduce damon_report_exist()
has been added to the -mm mm-new branch. Its filename is
mm-damon-core-introduce-damon_report_exist.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-damon-core-introduce-damon_report_exist.patch
This patch will later appear in the mm-new branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Note, mm-new is a provisional staging ground for work-in-progress
patches, and acceptance into mm-new is a notification for others take
notice and to finish up reviews. Please do not hesitate to respond to
review feedback and post updated versions to replace or incrementally
fixup patches in mm-new.
The mm-new branch of mm.git is not included in linux-next
If a few days of testing in mm-new is successful, the patch will me moved
into mm.git's mm-unstable branch, which is included in linux-next
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: SJ Park <sj@kernel.org>
Subject: mm/damon/core: introduce damon_report_exist()
Date: Tue, 24 Nov 2026 07:36:19 -0800
Implement and expose a new DAMON API function for searching data
attribute reports from the report queue. The purpose is to let
operation sets use it for supporting the REPORT_MADE type probe filters.
The caller can specify the type, associated memory address range, and
the creation time range of reports to search.
The function uses CAS-based try-locking for the mutual-exclusive
synchronization. If any parallel access to the queue is detected, it
forgives searching.
Link: https://patch.msgid.link/20261124153636.91854-14-sj@kernel.org
Signed-off-by: SJ Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Aveline Noir <jm5905938@gmail.com>
Cc: Lian Wang <lianux.mm@gmail.com>
include/linux/damon.h | 3 ++
mm/damon/core.c | 46 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 49 insertions(+)
--- a/include/linux/damon.h~mm-damon-core-introduce-damon_report_exist
+++ a/include/linux/damon.h
@@ -1199,6 +1199,9 @@ int damon_call(struct damon_ctx *ctx, st
int damos_walk(struct damon_ctx *ctx, struct damos_walk_control *control);
int damon_submit_report(struct damon_report *report);
+bool damon_report_exist(enum damon_report_type report_type,
+ struct damon_addr_range *addr_range,
+ unsigned long jiffies_old);
int damon_set_region_system_rams_default(struct damon_target *t,
unsigned long *start, unsigned long *end,
--- a/mm/damon/core.c~mm-damon-core-introduce-damon_report_exist
+++ a/mm/damon/core.c
@@ -2392,6 +2392,52 @@ int damon_submit_report(struct damon_rep
return 0;
}
+/**
+ * damon_report_exist() - Find if a report of a given condition exists.
+ *
+ * @report_type: Type of the report.
+ * @addr_range: Address range of the report.
+ * @jiffies_old: Oldest jiffies to find the report for.
+ *
+ * Returns true if the report is found, false otherwise.
+ */
+bool damon_report_exist(enum damon_report_type report_type,
+ struct damon_addr_range *addr_range, unsigned long jiffies_old)
+{
+ struct damon_report_queue *queue;
+ int lock_old_val;
+ unsigned int idx, nr_read;
+ struct damon_report *report;
+ bool found = false;
+
+ queue = &damon_report_queue;
+ lock_old_val = atomic_cmpxchg(&queue->lock, 0, 1);
+
+ if (lock_old_val)
+ return false;
+ idx = queue->tail;
+ for (nr_read = 0; nr_read < queue->nr_reports; nr_read++) {
+ if (idx)
+ idx--;
+ else
+ idx = queue->size - 1;
+ report = &queue->reports[idx];
+
+ if (time_before(report->jiffies, jiffies_old))
+ break;
+ if (report->type != report_type)
+ continue;
+ if (addr_range->end <= report->addr_range.start ||
+ report->addr_range.end <= addr_range->start)
+ continue;
+ found = true;
+ break;
+ }
+
+ atomic_cmpxchg(&queue->lock, 1, 0);
+ return found;
+}
+
/*
* Reset the aggregated monitoring results ('nr_accesses' of each region).
*/
_
Patches currently in -mm which might be from sj@kernel.org are
mm-damon-core-copy-only-installed-probe-in-damon_split_region_at.patch
mm-damon-core-add-damos_filter_type_age_ms.patch
mm-damon-sysfs-schemes-support-damos_filter_type_age_ms.patch
docs-mm-damon-design-update-for-age_ms-damos-core-filter-type.patch
docs-admin-guide-mm-damon-usage-update-for-age_ms-damos-core-filter.patch
mm-damon-api-define-damon_filter_type_active.patch
mm-damon-ops-common-implement-damon_filter_type_active-operation.patch
mm-damon-sysfs-support-lru-activeness-based-damon-filter-setup.patch
docs-mm-damon-design-update-for-damon_filter_type_active.patch
maintainers-change-damon-scm-tree-to-mm-damongit.patch
docs-mm-damon-maintainer-profile-use-damongit-for-patch-baselines.patch
docs-mm-damon-maintainer-profile-drop-scm-trees-section.patch
docs-mm-damon-maintainer-profile-update-key-cycle-dates-for-damongit.patch
mm-damon-api-introduce-struct-damon_report.patch
mm-damon-core-implement-data-attribute-report-queue.patch
mm-damon-core-introduce-damon_submit_report.patch
mm-damon-sysfs-add-admin-reports-directory.patch
mm-damon-sysfs-add-reports-producers-directory.patch
mm-damon-sysfs-add-producers-nr_producers-file.patch
mm-damon-sysfs-implement-report-producer-directory.patch
mm-damon-sysfs-implement-report-producer-type-and-state-files.patch
docs-mm-damon-design-update-for-report-system.patch
docs-admin-guide-mm-damon-usage-update-for-report-producer-sysfs.patch
docs-abi-damon-update-for-report-producer-sysfs-files.patch
mm-damon-core-introduce-damon_filter_type_report_made.patch
mm-damon-core-introduce-damon_report_exist.patch
mm-damon-paddr-support-report_made-type-probe-filter.patch
mm-damon-sysfs-add-filter_report_type-file-under-probe-filter-directory.patch
mm-damon-sysfs-support-report_made-type-probe-filter-setup.patch
docs-mm-damon-design-update-for-report_made-probe-filter-type.patch
docs-admin-guide-mm-damon-usage-update-for-report_made-probe-filter.patch
docs-abi-damon-update-for-report_made-probe-filter.patch
mm-damon-api-introduce-user_report-report-type.patch
mm-damon-sysfs-add-user_report-support-for-report-type-input.patch
mm-damon-sysfs-implement-report-producer-addr_startend-files.patch
mm-damon-sysfs-implement-submit-command-for-report-producer.patch
selftests-damon-sysfssh-add-basic-tests-for-admin-reports.patch
docs-mm-damon-design-update-for-user-report-support.patch
docs-admin-guide-mm-damon-usage-update-for-user_report-report-support.patch
docs-abi-damon-update-for-user_report-report-support.patch
next prev parent reply other threads:[~2026-11-24 17:23 UTC|newest]
Thread overview: 87+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 15:36 [PATCH v2 00/27] mm/damon: let users report their data attribute findings SJ Park
2026-11-24 15:36 ` [PATCH v2 01/27] mm/damon/api: introduce struct damon_report SJ Park
2026-11-24 17:22 ` + mm-damon-api-introduce-struct-damon_report.patch added to mm-new branch Andrew Morton
2026-11-25 10:06 ` [PATCH v2 01/27] mm/damon/api: introduce struct damon_report Enze Li
2026-11-24 15:36 ` [PATCH v2 02/27] mm/damon/core: implement data attribute report queue SJ Park
2026-11-24 17:22 ` + mm-damon-core-implement-data-attribute-report-queue.patch added to mm-new branch Andrew Morton
2026-11-26 2:09 ` [PATCH v2 02/27] mm/damon/core: implement data attribute report queue Enze Li
2026-11-24 15:36 ` [PATCH v2 03/27] mm/damon/core: introduce damon_submit_report() SJ Park
2026-11-24 17:23 ` + mm-damon-core-introduce-damon_submit_report.patch added to mm-new branch Andrew Morton
2026-11-26 5:36 ` [PATCH v2 03/27] mm/damon/core: introduce damon_submit_report() Enze Li
2026-11-24 15:36 ` [PATCH v2 04/27] mm/damon/sysfs: add admin/reports/ directory SJ Park
2026-11-24 17:23 ` + mm-damon-sysfs-add-admin-reports-directory.patch added to mm-new branch Andrew Morton
2026-11-26 7:26 ` [PATCH v2 04/27] mm/damon/sysfs: add admin/reports/ directory Enze Li
2026-11-24 15:36 ` [PATCH v2 05/27] mm/damon/sysfs: add reports/producers/ directory SJ Park
2026-11-24 17:23 ` + mm-damon-sysfs-add-reports-producers-directory.patch added to mm-new branch Andrew Morton
2026-11-26 7:55 ` [PATCH v2 05/27] mm/damon/sysfs: add reports/producers/ directory Enze Li
2026-11-24 15:36 ` [PATCH v2 06/27] mm/damon/sysfs: add producers/nr_producers file SJ Park
2026-11-24 17:23 ` + mm-damon-sysfs-add-producers-nr_producers-file.patch added to mm-new branch Andrew Morton
2026-11-26 9:13 ` [PATCH v2 06/27] mm/damon/sysfs: add producers/nr_producers file Enze Li
2026-11-24 15:36 ` [PATCH v2 07/27] mm/damon/sysfs: implement report producer directory SJ Park
2026-11-24 17:23 ` + mm-damon-sysfs-implement-report-producer-directory.patch added to mm-new branch Andrew Morton
2026-11-26 9:56 ` [PATCH v2 07/27] mm/damon/sysfs: implement report producer directory Enze Li
2026-11-24 15:36 ` [PATCH v2 08/27] mm/damon/sysfs: implement report producer type and state files SJ Park
2026-11-24 17:23 ` + mm-damon-sysfs-implement-report-producer-type-and-state-files.patch added to mm-new branch Andrew Morton
2026-11-27 2:39 ` [PATCH v2 08/27] mm/damon/sysfs: implement report producer type and state files Enze Li
2026-11-24 15:36 ` [PATCH v2 09/27] Docs/mm/damon/design: update for report system SJ Park
2026-11-24 17:23 ` + docs-mm-damon-design-update-for-report-system.patch added to mm-new branch Andrew Morton
2026-11-27 2:51 ` [PATCH v2 09/27] Docs/mm/damon/design: update for report system Enze Li
2026-11-24 15:36 ` [PATCH v2 10/27] Docs/admin-guide/mm/damon/usage: update for report producer sysfs SJ Park
2026-11-24 17:23 ` + docs-admin-guide-mm-damon-usage-update-for-report-producer-sysfs.patch added to mm-new branch Andrew Morton
2026-11-27 3:02 ` [PATCH v2 10/27] Docs/admin-guide/mm/damon/usage: update for report producer sysfs Enze Li
2026-11-24 15:36 ` [PATCH v2 11/27] Docs/ABI/damon: update for report producer sysfs files SJ Park
2026-11-24 17:23 ` + docs-abi-damon-update-for-report-producer-sysfs-files.patch added to mm-new branch Andrew Morton
2026-11-27 3:10 ` [PATCH v2 11/27] Docs/ABI/damon: update for report producer sysfs files Enze Li
2026-11-24 15:36 ` [PATCH v2 12/27] mm/damon/core: introduce DAMON_FILTER_TYPE_REPORT_MADE SJ Park
2026-11-24 17:23 ` + mm-damon-core-introduce-damon_filter_type_report_made.patch added to mm-new branch Andrew Morton
2026-11-27 5:46 ` [PATCH v2 12/27] mm/damon/core: introduce DAMON_FILTER_TYPE_REPORT_MADE Enze Li
2026-11-24 15:36 ` [PATCH v2 13/27] mm/damon/core: introduce damon_report_exist() SJ Park
2026-11-24 17:23 ` Andrew Morton [this message]
2026-11-27 8:12 ` Enze Li
2026-11-24 15:36 ` [PATCH v2 14/27] mm/damon/paddr: support REPORT_MADE type probe filter SJ Park
2026-11-24 17:23 ` + mm-damon-paddr-support-report_made-type-probe-filter.patch added to mm-new branch Andrew Morton
2026-11-24 15:36 ` [PATCH v2 15/27] mm/damon/sysfs: add filter_report_type file under probe filter directory SJ Park
2026-11-24 17:23 ` + mm-damon-sysfs-add-filter_report_type-file-under-probe-filter-directory.patch added to mm-new branch Andrew Morton
2026-11-28 14:19 ` [PATCH v2 15/27] mm/damon/sysfs: add filter_report_type file under probe filter directory Enze Li
2026-11-24 15:36 ` [PATCH v2 16/27] mm/damon/sysfs: support REPORT_MADE type probe filter setup SJ Park
2026-11-24 17:23 ` + mm-damon-sysfs-support-report_made-type-probe-filter-setup.patch added to mm-new branch Andrew Morton
2026-11-28 14:27 ` [PATCH v2 16/27] mm/damon/sysfs: support REPORT_MADE type probe filter setup Enze Li
2026-11-24 15:36 ` [PATCH v2 17/27] Docs/mm/damon/design: update for report_made probe filter type SJ Park
2026-11-24 17:23 ` + docs-mm-damon-design-update-for-report_made-probe-filter-type.patch added to mm-new branch Andrew Morton
2026-11-28 14:30 ` [PATCH v2 17/27] Docs/mm/damon/design: update for report_made probe filter type Enze Li
2026-11-24 15:36 ` [PATCH v2 18/27] Docs/admin-guide/mm/damon/usage: update for REPORT_MADE probe filter SJ Park
2026-11-24 17:23 ` + docs-admin-guide-mm-damon-usage-update-for-report_made-probe-filter.patch added to mm-new branch Andrew Morton
2026-11-28 14:34 ` [PATCH v2 18/27] Docs/admin-guide/mm/damon/usage: update for REPORT_MADE probe filter Enze Li
2026-11-24 15:36 ` [PATCH v2 19/27] Docs/ABI/damon: " SJ Park
2026-11-24 17:23 ` + docs-abi-damon-update-for-report_made-probe-filter.patch added to mm-new branch Andrew Morton
2026-11-28 14:41 ` [PATCH v2 19/27] Docs/ABI/damon: update for REPORT_MADE probe filter Enze Li
2026-11-24 15:36 ` [PATCH v2 20/27] mm/damon/api: introduce user_report report type SJ Park
2026-11-24 17:23 ` + mm-damon-api-introduce-user_report-report-type.patch added to mm-new branch Andrew Morton
2026-11-28 15:20 ` [PATCH v2 20/27] mm/damon/api: introduce user_report report type Enze Li
2026-11-28 18:04 ` SJ Park
2026-11-24 15:36 ` [PATCH v2 21/27] mm/damon/sysfs: add user_report support for report type input SJ Park
2026-11-24 17:23 ` + mm-damon-sysfs-add-user_report-support-for-report-type-input.patch added to mm-new branch Andrew Morton
2026-11-28 15:23 ` [PATCH v2 21/27] mm/damon/sysfs: add user_report support for report type input Enze Li
2026-11-24 15:36 ` [PATCH v2 22/27] mm/damon/sysfs: implement report producer addr_{start,end} files SJ Park
2026-11-24 17:23 ` + mm-damon-sysfs-implement-report-producer-addr_startend-files.patch added to mm-new branch Andrew Morton
2026-11-28 15:34 ` [PATCH v2 22/27] mm/damon/sysfs: implement report producer addr_{start,end} files Enze Li
2026-11-24 15:36 ` [PATCH v2 23/27] mm/damon/sysfs: implement submit command for report producer SJ Park
2026-11-24 17:23 ` + mm-damon-sysfs-implement-submit-command-for-report-producer.patch added to mm-new branch Andrew Morton
2026-11-28 15:44 ` [PATCH v2 23/27] mm/damon/sysfs: implement submit command for report producer Enze Li
2026-11-24 15:36 ` [PATCH v2 24/27] selftests/damon/sysfs.sh: add basic tests for admin/reports/ SJ Park
2026-11-24 17:24 ` + selftests-damon-sysfssh-add-basic-tests-for-admin-reports.patch added to mm-new branch Andrew Morton
2026-11-28 23:39 ` [PATCH v2 24/27] selftests/damon/sysfs.sh: add basic tests for admin/reports/ Enze Li
2026-11-24 15:36 ` [PATCH v2 25/27] Docs/mm/damon/design: update for user report support SJ Park
2026-11-24 17:24 ` + docs-mm-damon-design-update-for-user-report-support.patch added to mm-new branch Andrew Morton
2026-11-28 23:45 ` [PATCH v2 25/27] Docs/mm/damon/design: update for user report support Enze Li
2026-11-24 15:36 ` [PATCH v2 26/27] Docs/admin-guide/mm/damon/usage: update for user_report " SJ Park
2026-11-24 17:24 ` + docs-admin-guide-mm-damon-usage-update-for-user_report-report-support.patch added to mm-new branch Andrew Morton
2026-11-28 23:48 ` [PATCH v2 26/27] Docs/admin-guide/mm/damon/usage: update for user_report report support Enze Li
2026-11-24 15:36 ` [PATCH v2 27/27] Docs/ABI/damon: " SJ Park
2026-11-24 17:24 ` + docs-abi-damon-update-for-user_report-report-support.patch added to mm-new branch Andrew Morton
2026-11-28 23:51 ` [PATCH v2 27/27] Docs/ABI/damon: update for user_report report support Enze Li
2026-11-24 15:53 ` [PATCH v2 00/27] mm/damon: let users report their data attribute findings sashiko-bot
2026-11-25 22:10 ` Ravi Jonnalagadda
2026-11-26 2:04 ` SJ Park
2026-11-26 7:03 ` Ravi Jonnalagadda
2026-11-26 21:05 ` SJ 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=20261124172330.3CFC41F000E0@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=jm5905938@gmail.com \
--cc=lianux.mm@gmail.com \
--cc=mm-commits@vger.kernel.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 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.