lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 16 Dec 2020 10:42:08 +0100
From:   SeongJae Park <>
To:     <>
CC:     SeongJae Park <>, <>,
        <>, <>,
        <>, <>,
        <>, <>,
        <>, <>,
        <>, <>, <>,
        <>, <>, <>,
        <>, <>, <>,
        <>, <>, <>,
        <>, <>, <>,
        <>, <>,
        <>, <>, <>,
        <>, <>, <>,
        <>, <>, <>,
        <>, <>, <>,
        <>, <>,
        <>, <>,
        <>, <>,
Subject: [RFC v10 00/13] DAMON: Support Physical Memory Address Space and Page-granularity Idleness Monitoring

From: SeongJae Park <>

NOTE: This is only an RFC for future features of DAMON patchset[1], which is
not merged in the mainline yet.  The aim of this RFC is to show how DAMON would
be evolved once it is merged in.  So, if you have some interest in this RFC,
please consider reviewing the DAMON patchset, either.

Changes from Previous Version

- Rebase on v5.10 + DAMON v23[1] + DAMOS v15.1[2]
- Implement primitives for page granularity idleness monitoring


DAMON[1] programming interface users can extend DAMON for any address space by
configuring the address-space specific low level primitives with appropriate
ones.  However, because only the implementation for the virtual address spaces
is available now, the users should implement their own for other address
spaces.  Worse yet, the user space users who are using the debugfs interface of
'damon-dbgfs' module or the DAMON user space tool, cannot implement their own.
Therefore, this patchset implements reference implementation of the low level
primitives for two other common use cases.

First common use case is the physical memory address space monitoring.  This
patchset, hence, implements monitoring primitives for the physical address
space.  Further, this patchset links the implementation to the debugfs
interface and the user space tool for the user space users.

Another common use case is page-granularity idleness monitoring.  This is
already available via 'Idle Page Tracking', but it requires frequent
kernel-user context change.  DAMON can efficiently support the usecase via its
arbitrary type monitoring target feature.  This patchset, therefore, provides
yet another implementation of the monitoring primitives for the use case.
Nonetheless, this version of the patchset doesn't provide user space friendly
interface for that.  It would be included in a future version of this patchset.

Note that the primitives support only the online user memory, as same to the
Idle Page Tracking.

Baseline and Complete Git Trees

The patches are based on the v5.10 linux kernel plus DAMON v23 patchset[1] and
DAMOS RFC v15.1 patchset[2].  You can also clone the complete git tree:

    $ git clone git:// -b cdamon/rfc/v10

The web is also available:


Sequence of Patches

The sequence of patches is as follow.

The first 5 patches allow the user space users manually set the monitoring
regions.  The 1st and 2nd patches implements the features in the 'damon-dbgfs'
and the user space tool, respectively.  Following two patches update
unittests (the 3rd patch) and selftests (the 4th patch) for the new feature.
Finally, the 5th patch documents this new feature.

Following 5 patches implement the physical memory monitoring.  The 6th patch
makes some primitive functions for the virtual address spaces primitive
reusable.  The 7th patch implements the physical address space monitoring
primitive using it.  The 8th and the 9th patches links the primitives to the
'damon-dbgfs' and the user space tool, respectively.  The 10th patch further
implement a handy NUMA specific memory monitoring feature on the user space
tool.  The 11th patch documents this new features.

The 12th patch again separates some functions of the physical address space
primitives to reusable, and the 13th patch implements the page granularity
idleness monitoring primitives using those.

Patch History

Changes from RFC v9
- Rebase on v5.10 + DAMON v23[1] + DAMOS v15.1[2]
- Implement primitives for page granularity idleness monitoring

Changes from RFC v8
- s/snprintf()/scnprintf() (Marco Elver)
- Place three parts of DAMON (core, primitives, and dbgfs) in different files

Changes from RFC v7
- Add missed 'put_page()' calls
- Support unmapped LRU pages

Changes from RFC v6
- Use 42 as the fake target id for paddr instead of -1
- Fix typo

Changes from RFC v5
- Support nested iomem sections (Du Fan)
- Rebase on v5.8

Changes from RFC v4
 - Support NUMA specific physical memory monitoring

Changes from RFC v3
 - Export rmap functions
 - Reorganize for physical memory monitoring support only
 - Clean up debugfs code

Changes from RFC v2
 - Support the physical memory monitoring with the user space tool
 - Use 'pfn_to_online_page()' (David Hildenbrand)
 - Document more detail on random 'pfn' and its safeness (David Hildenbrand)

Changes from RFC v1
 - Provide the reference primitive implementations for the physical memory
 - Connect the extensions with the debugfs interface

SeongJae Park (13):
  damon/dbgfs: Allow users to set initial monitoring target regions
  tools/damon: Support init target regions specification
  damon/dbgfs-test: Add a unit test case for 'init_regions'
  selftests/damon/_chk_record: Do not check number of gaps
  Docs/admin-guide/mm/damon: Document 'init_regions' feature
  mm/damon/vaddr: Separate commonly usable functions
  mm/damon: Implement primitives for physical address space monitoring
  damon/dbgfs: Support physical memory monitoring
  tools/damon/record: Support physical memory monitoring
  tools/damon/record: Support NUMA specific recording
  Docs/DAMON: Document physical memory monitoring support
  mm/damon/paddr: Separate commonly usable functions
  mm/damon: Implement primitives for page granularity idleness

 Documentation/admin-guide/mm/damon/usage.rst |  77 ++++++-
 Documentation/vm/damon/design.rst            |  29 ++-
 Documentation/vm/damon/faq.rst               |   5 +-
 include/linux/damon.h                        |  37 +++
 include/trace/events/damon.h                 |  19 ++
 mm/damon/Kconfig                             |  20 +-
 mm/damon/Makefile                            |   4 +-
 mm/damon/dbgfs-test.h                        |  55 +++++
 mm/damon/dbgfs.c                             | 163 ++++++++++++-
 mm/damon/paddr.c                             |  98 ++++++++
 mm/damon/pgidle.c                            |  69 ++++++
 mm/damon/prmtv-common.c                      | 226 +++++++++++++++++++
 mm/damon/prmtv-common.h                      |  25 ++
 mm/damon/vaddr.c                             | 108 +--------
 tools/damon/                        |  41 ++++
 tools/damon/                 | 147 ++++++++++++
 tools/damon/                        |  57 ++++-
 tools/damon/                       |  12 +-
 tools/testing/selftests/damon/ |   6 -
 19 files changed, 1049 insertions(+), 149 deletions(-)
 create mode 100644 mm/damon/paddr.c
 create mode 100644 mm/damon/pgidle.c
 create mode 100644 mm/damon/prmtv-common.c
 create mode 100644 mm/damon/prmtv-common.h
 create mode 100644 tools/damon/


Powered by blists - more mailing lists