From: SeongJae Park <sjpark@xxxxxxxxx> DAMON[1] can be used as a primitive for data access awared memory management optimizations. That said, users who want such optimizations should run DAMON, read the monitoring results, analyze it, plan a new memory management scheme, and apply the new scheme by themselves. Such efforts will be inevitable for some complicated optimizations. However, in many other cases, the users would just want the system to apply an memory management action to a memory region of a specific size having a specific access frequency for a specific time. For example, "page out a memory region larger than 100 MiB keeping only rare accesses more than 10 minutes", or "Use THP for a memory region larger than 2 MiB maintaing frequent accesses for more than 5 seconds". This RFC patchset makes DAMON to handle such data access monitoring-based operation schemes. With this change, users can do the data access awared optimizations by simply specifying their schemes to DAMON. Sequence Of Patches =================== The patches are based on the v5.5 plus v5 DAMON patchset[1] and Minchan's ``madvise()`` factor-out patch[2]. Minchan's patch was necessary for reuse of ``madvise()`` code in DAMON. You can also clone the complete git tree: $ git clone git://github.com/sjp38/linux -b damos/rfc/v2 The web is also available: https://github.com/sjp38/linux/releases/tag/damos/rfc/v2 The first patch allows DAMON to reuse ``madvise()`` code for the actions. The second patch accounts age of each region. Third patch implements the handling of the schemes in DAMON and exports a kernel space programming interface for it. Finally, the fourth patch implements a debugfs interface for privileged people and programs. [1] https://lore.kernel.org/linux-mm/20200217103110.30817-1-sjpark@xxxxxxxxxx/ [2] https://lore.kernel.org/linux-mm/20200128001641.5086-2-minchan@xxxxxxxxxx/ Patch History ============= Changes from RFC v1 (https://lore.kernel.org/linux-mm/20200210150921.32482-1-sjpark@xxxxxxxxxx/) - Properly adjust age accounting related properties after splitting, merging, and action applying SeongJae Park (4): mm/madvise: Export madvise_common() to mm internal code mm/damon: Account age of target regions mm/damon: Implement data access monitoring-based operation schemes mm/damon/schemes: Implement a debugfs interface include/linux/damon.h | 29 ++++ mm/damon.c | 360 +++++++++++++++++++++++++++++++++++++++++- mm/internal.h | 4 + mm/madvise.c | 3 +- 4 files changed, 388 insertions(+), 8 deletions(-) -- 2.17.1