xref: /linux/Documentation/mm/damon/faq.rst (revision 69bfec7548f4c1595bac0e3ddfc0458a5af31f4c)
1.. SPDX-License-Identifier: GPL-2.0
2
3==========================
4Frequently Asked Questions
5==========================
6
7Why a new subsystem, instead of extending perf or other user space tools?
8=========================================================================
9
10First, because it needs to be lightweight as much as possible so that it can be
11used online, any unnecessary overhead such as kernel - user space context
12switching cost should be avoided.  Second, DAMON aims to be used by other
13programs including the kernel.  Therefore, having a dependency on specific
14tools like perf is not desirable.  These are the two biggest reasons why DAMON
15is implemented in the kernel space.
16
17
18Can 'idle pages tracking' or 'perf mem' substitute DAMON?
19=========================================================
20
21Idle page tracking is a low level primitive for access check of the physical
22address space.  'perf mem' is similar, though it can use sampling to minimize
23the overhead.  On the other hand, DAMON is a higher-level framework for the
24monitoring of various address spaces.  It is focused on memory management
25optimization and provides sophisticated accuracy/overhead handling mechanisms.
26Therefore, 'idle pages tracking' and 'perf mem' could provide a subset of
27DAMON's output, but cannot substitute DAMON.
28
29
30Does DAMON support virtual memory only?
31=======================================
32
33No.  The core of the DAMON is address space independent.  The address space
34specific monitoring operations including monitoring target regions
35constructions and actual access checks can be implemented and configured on the
36DAMON core by the users.  In this way, DAMON users can monitor any address
37space with any access check technique.
38
39Nonetheless, DAMON provides vma/rmap tracking and PTE Accessed bit check based
40implementations of the address space dependent functions for the virtual memory
41and the physical memory by default, for a reference and convenient use.
42
43
44Can I simply monitor page granularity?
45======================================
46
47Yes.  You can do so by setting the ``min_nr_regions`` attribute higher than the
48working set size divided by the page size.  Because the monitoring target
49regions size is forced to be ``>=page size``, the region split will make no
50effect.
51