Skip to content

RFC DAMON: Make coexistable with Idle Page Tracking

SeongJae Park linux-doc linux-mm lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest5 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5mm/damon: Separate components and apply fine-grained dependenciesMAINTAINERS include/linux/damon.h mm/Kconfig +12 more+3738 -35180 replies
2/5mm/damon: Separate DAMON schemes application to primitivesinclude/linux/damon.h mm/damon/core.c mm/damon/damon.h +1 more+82 -920 replies
3/5mm/damon: Move recording feature from core to dbgfsinclude/linux/damon.h mm/damon/core-test.h mm/damon/core.c +2 more+359 -2220 replies
4/5mm/page_idle: Avoid interferences from concurrent usersDocumentation/admin-guide/mm/idle_page_tracking.rst mm/page_idle.c+56 -60 replies
5/5mm/damon/primitives: Make coexistable with Idle Page Trackinginclude/linux/damon.h include/linux/page_idle.h mm/damon/Kconfig +3 more+51 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/5] DAMON: Make coexistable with Idle Page Tracking

From: SeongJae Park <[email protected]>

NOTE: This is an RFC for future change of DAMON patchsets[1,2,3], which is not merged in the mainline yet. The aim of this RFC is to show how the patchset would be changed in the next version. So, if you have some interest in this RFC, please consider reviewing the DAMON patchset, either.

Currently, DAMON is configured to be exclusive with Idle Page Tracking because both of the subsystems use PG_Idle flag and there is no way to synchronize with Idle Page Tracking. Though there are many use cases DAMON could do better than Idle Page Tracking, DAMON cannot fully replace Idle Page Tracking, since

- DAMON doesn't support all features of Idle Page Tracking from the beginning (e.g., physical address space is supported from the third DAMON patchset[3]), and
- there are some use cases Idle Page Tracking could be more efficient (e.g., page size granularity working set size calculation).

Therefore, this patchset makes DAMON coexistable with Idle Page Tracking. As the first decision of making DAMON exclusive was not a good idea, this change will be merged in the next versions of the original patchsets[1,2,3]. Therefore, you could skip detail of the changes but wait for postings of the next versions of the patchsets, except the 4th patch.

The changes significantly refactor the code, especially 'damon.c' and 'damon-test.c'. Though the refactoring changes are only straightforward, if you gave 'Reviewed-by' before and you want to drop it due to the changes, please let me know.

[1] https://lore.kernel.org/linux-mm/[email protected]/
[2] https://lore.kernel.org/linux-mm/[email protected]/
[3] https://lore.kernel.org/linux-mm/[email protected]/

Sequence of Patches
===================

The 1st patch separates DAMON components that unnecessarily implemented in one source file and depend on one config option (CONFIG_DAMON)
to multiple files and apply fine-grained dependency. As a result, the core framework part of DAMON becomes coexistable with Idle Page Tracking.

Following two patches further refactor the code for cleaner bound between the components.

The 4th patch implements a synchronization infrastructure for PG_idle flag users. We implement it to eventually used for DAMON, but the change is independent with DAMON and the also required for Idle Page Tracking itself. This could be picked before DAMON patchsets merged.

Finally, the 5th patch updates DAMON to use the PG_idle synchronization infrastructure and fully coexistable with Page Idle Tracking.

Baseline and Complete Git Trees
===============================

The patches are based on the v5.8 plus DAMON v20 patchset[1], RFC v14 of DAMOS patchset, RFC v8 of physical address space support patchset, RFC v1 of user space improvement[4], and some more trivial fixes (s/snprintf/scnprintf). You can also clone the complete git tree:

    $ git clone git://github.com/sjp38/linux -b damon-usi/rfc/v1

The web is also available:
https://github.com/sjp38/linux/releases/tag/damon-usi/rfc/v1

[1] https://lore.kernel.org/linux-mm/[email protected]/
[2] https://lore.kernel.org/linux-mm/[email protected]/
[3] https://lore.kernel.org/linux-mm/[email protected]/
[4] https://lore.kernel.org/linux-mm/[email protected]/

SeongJae Park (5):
mm/damon: Separate components and apply fine-grained dependencies mm/damon: Separate DAMON schemes application to primitives mm/damon: Move recording feature from core to dbgfs mm/page_idle: Avoid interferences from concurrent users mm/damon/primitives: Make coexistable with Idle Page Tracking

 .../admin-guide/mm/idle_page_tracking.rst     |   22 +-
 MAINTAINERS                                   |    3 +-
 include/linux/damon.h                         |  109 +-
 include/linux/page_idle.h                     |    2 +
 mm/Kconfig                                    |   25 +-
 mm/Makefile                                   |    2 +-
 mm/damon-test.h                               |  724 -----
 mm/damon.c                                    | 2754 -----------------
 mm/damon/Kconfig                              |   68 +
 mm/damon/Makefile                             |    5 +
 mm/damon/core-test.h                          |  253 ++
 mm/damon/core.c                               |  860 +++++
 mm/damon/damon.h                              |    7 +
 mm/damon/dbgfs-test.h                         |  264 ++
 mm/damon/dbgfs.c                              | 1158 +++++++
 mm/damon/primitives-test.h                    |  328 ++
 mm/damon/primitives.c                         |  896 ++++++
 mm/page_idle.c                                |   40 +
 18 files changed, 3982 insertions(+), 3538 deletions(-)
 delete mode 100644 mm/damon-test.h
 delete mode 100644 mm/damon.c
 create mode 100644 mm/damon/Kconfig
 create mode 100644 mm/damon/Makefile
 create mode 100644 mm/damon/core-test.h
 create mode 100644 mm/damon/core.c
 create mode 100644 mm/damon/damon.h
 create mode 100644 mm/damon/dbgfs-test.h
 create mode 100644 mm/damon/dbgfs.c
 create mode 100644 mm/damon/primitives-test.h
 create mode 100644 mm/damon/primitives.c
Signature · 1 line
2.17.1