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