DAMON for Write-only or Given CPUs-only Monitoring

Table of Contents

From the very early days of DAMON, there were attempts to extend it for cpus-aware monitoring and write-only monitoring.

In 2022, Xin Hao proposed extending DAMON for NUMA access statistics.

In 2022 and 2025, Pedro Demarchi Gomes proposed extending DAMON for writes-only monitoring.

Those proposals are not yet upstreamed though. We continued similar DAMON extension discussions publicly and privately, with multiple parties, though.

I was recently taking some time on these, and happy to announce the first working prototype for the extensions. Please note that it is working in a way that you can at least try, but the implementation is gross, unupstreamable, and may contain many bugs.

On Linux kernel that built with some hacks that exist in damon/next tree as of this writing (2025-08-03), users can do data access monitoring for only writes, or for accesses made by given set of CPUs using the latest version of DAMON user-space tool, damo, on its development branch.

Write-only Access Monitoring

Users can do write-only data access monitoring by adding --exp_ops_use_reports and --exp_ops_write_only options with value y to the usual DAMON parameters setup commands including damo start and damo tune, like below.

damo start --exp_ops_use_reports y --exp_ops_write_only y

Then DAMON will silently ignore read accesses, and show only the accesses that made for writes.

Note that only physical address space monitoring is supported for now.

CPUs-only Access Monitoring

Users can monitor the data accesses made by only specific CPUs by adding --exp_ops_use_reports and --exp_ops_cpus options to the usual DAMON parameters setup commands including damo start and damo tune, like below.

damo start --exp_ops_use_reports y --exp_ops_cpus 0-3,5-7,9

--exp_ops_use_reports argument should always be y.

--exp_ops_cpus option should be given with a list of the desired CPUs. In this example, accesses that made by only CPUs of id 0, 1, 2, 3, 5, 6, 7, or 9 will be monitored and reported. The format of the cpus list is same to that for cpuset.cpus file of cgroup v2.

Note that only physical address space monitoring is supported for now.

Cautions and Plan to Drop Experimental Tag

The write-only and cpus-only monitoring features require changes in Linux kernel that not yet upstreamed. The changes are available at damon/next tree, which is for containing under-development DAMON works, as of this writing (2025-08-03). To make those upstreamed, we may need significant amount of efforts. Many changes could be made on the upstreamed version. In the worst case, we would forgive upstreaming the changes to mainline kernel, and drop the support on the damon/next tree.

The user interface for these features on damo will definitely be changed in future. At least, --exp_ part will be removed.

Finally, as of this writing (2025-08-03), the features are nearly not tested, so there could be many bugs.

So, please feel free to try and let us know bugs that you found, and if it is useful and worthy enough to make the upstream efforts. But, please don’t make your long term important works depend on these.