summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSJ Park <sj@kernel.org>2026-09-10 07:22:28 -0700
committerAndrew Morton <akpm@linux-foundation.org>2026-10-08 22:55:04 -0700
commitf8facff65cb3f17e1c5fd01b81d578bca25d8a01 (patch)
treee8fc4e115f2c636a89cc39ce6a89a71aecd4c584
parent82e64b8a1bf035a9ce57217ac5c7b64af8c1794f (diff)
downloadlinux-next-f8facff65cb3f17e1c5fd01b81d578bca25d8a01.tar.gz
linux-next-f8facff65cb3f17e1c5fd01b81d578bca25d8a01.zip
mm/damon/api: introduce DAMON_FILTER_TYPE_PGIDLE_SET
Patch series "mm/damon: introduce pgidle_set probe filter type". Users can do effective access monitoring with DAMON, using set_pgidle probe prep operation and pgidle_unset allowing probe filter. In the setup, high probe_hits means the region was accessed frequently. Zero probe_hits means the region was not accessed. The filter, however, matches only the memory that can show the idleness. Regions of zero probe_hits may contain memory that was just unable to show the idleness. On virtual address space based monitoring, for example, non-present pages are reported as cold. It is truly cold, but if the purpose is to make some operations like reclaiming or compressing the data, this is not really useful. Introduce a new probe filter type, pgidle_set, that confirms the page is marked as idle. Using it instead of pgidle_unset, users can find cold pages that can effectively be processed. Patch 1 introduces the pgidle_set probe filter type to DAMON kernel API. Patches 2 and 3 add support for it on physical and virtual address space operation sets, respectively. Patch 4 adds support for it on the DAMON sysfs interface. Finally, patch 5 updates the documentation for the new filter type. This patch (of 5): DAMON_FILTER_TYPE_PGIDLE_UNSET matches only memory that was able to confirm if it is marked as idle. If the memory cannot be marked as idle, it simply doesn't match. Hence, finding memory that was marked as idle with only DAMON_FILTER_TYPE_PGIDLE_UNSET is impossible. Introduce a new filter for the purpose, DAMON_FILTER_TYPE_PGIDLE_SET. Link: https://lore.kernel.org/20260910142234.171562-1-sj@kernel.org Link: https://lore.kernel.org/20260910142234.171562-2-sj@kernel.org Signed-off-by: SJ Park <sj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: David Hildenbrand <david@kernel.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Liam R. Howlett <liam@infradead.org> Cc: Lorenzo Stoakes <ljs@kernel.org> Cc: Michal Hocko <mhocko@suse.com> Cc: Mike Rapoport <rppt@kernel.org> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Suren Baghdasaryan <surenb@google.com> Cc: Vlastimil Babka <vbabka@kernel.org>
-rw-r--r--include/linux/damon.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/damon.h b/include/linux/damon.h
index 871d26adf6ae..16800b3dc379 100644
--- a/include/linux/damon.h
+++ b/include/linux/damon.h
@@ -774,11 +774,13 @@ struct damon_prep {
* @DAMON_FILTER_TYPE_ANON: Anonymous pages.
* @DAMON_FILTER_TYPE_MEMCG: Specific memcg's pages.
* @DAMON_FILTER_TYPE_PGIDLE_UNSET: Pgidle is unset.
+ * @DAMON_FILTER_TYPE_PGIDLE_SET: Pgidle is set.
*/
enum damon_filter_type {
DAMON_FILTER_TYPE_ANON,
DAMON_FILTER_TYPE_MEMCG,
DAMON_FILTER_TYPE_PGIDLE_UNSET,
+ DAMON_FILTER_TYPE_PGIDLE_SET,
};
/**