[v2,00/12] mm/damon: cleanup and refactoring code

Message ID 20221026225943.100429-1-sj@kernel.org
Headers
Series mm/damon: cleanup and refactoring code |

Message

SeongJae Park Oct. 26, 2022, 10:59 p.m. UTC
  Changes from v1
(https://lore.kernel.org/damon/20221024204919.18524-1-sj@kernel.org/):
- Add 10th patch, which splits schemes sysfs directory implementation

This patchset cleans up and refactors a range of DAMON code including
the core, DAMON sysfs interface, and DAMON modules, for better
readability and convenient future feature implementations.

In detail, this patchset splits unnecessarily long and complex functions
in core into smaller functions (patches 1-4).  Then, it cleans up the
DAMON sysfs interface by using more type-safe code (patch 5) and
removing unnecessary function parameters (patch 6).  Further, it
refactor the code by distributing the code into multiple files (patches
7-10).  Last two patches (patches 11 and 12) deduplicates and remove
unnecessary header inclusion in DAMON modules (reclaim and lru_sort).

Note that this initially posted as a part of a feature implementation
RFC patchset[1], but separated into this patchset as the amount of the
change is not small compared to the feature implementation change
itself.

[1] https://lore.kernel.org/damon/20221019001317.104270-1-sj@kernel.org/

SeongJae Park (12):
  mm/damon/core: split out DAMOS-charged region skip logic into a new
    function
  mm/damon/core: split damos application logic into a new function
  mm/damon/core: split out scheme stat update logic into a new function
  mm/damon/core: split out scheme quota adjustment logic into a new
    function
  mm/damon/sysfs: use damon_addr_range for regions' start and end values
  mm/damon/sysfs: remove parameters of damon_sysfs_region_alloc()
  mm/damon/sysfs: move sysfs_lock to common module
  mm/damon/sysfs: move unsigned long range directory to common module
  mm/damon/sysfs: split out kdamond-independent schemes stats update
    logic into a new function
  mm/damon/sysfs: split out schemes directory implementation to separate
    file
  mm/damon/modules: deduplicate init steps for DAMON context setup
  mm/damon/{reclaim,lru_sort}: remove unnecessarily included headers

 mm/damon/Makefile         |    6 +-
 mm/damon/core.c           |  262 +++++----
 mm/damon/lru_sort.c       |   19 +-
 mm/damon/modules-common.c |   42 ++
 mm/damon/modules-common.h |    3 +
 mm/damon/reclaim.c        |   19 +-
 mm/damon/sysfs-common.c   |  107 ++++
 mm/damon/sysfs-common.h   |   46 ++
 mm/damon/sysfs-schemes.c  | 1022 ++++++++++++++++++++++++++++++++
 mm/damon/sysfs.c          | 1152 +------------------------------------
 10 files changed, 1399 insertions(+), 1279 deletions(-)
 create mode 100644 mm/damon/modules-common.c
 create mode 100644 mm/damon/sysfs-common.c
 create mode 100644 mm/damon/sysfs-common.h
 create mode 100644 mm/damon/sysfs-schemes.c
  

Comments

SeongJae Park Oct. 26, 2022, 11:08 p.m. UTC | #1
Hi Andrew,

On Wed, 26 Oct 2022 22:59:31 +0000 SeongJae Park <sj@kernel.org> wrote:

> Changes from v1
> (https://lore.kernel.org/damon/20221024204919.18524-1-sj@kernel.org/):
> - Add 10th patch, which splits schemes sysfs directory implementation

As mentioned above, I mistakenly forgot adding the tenth patch of this series
in the previous version.  Could you please replace the series with this
version?

Please note that the 'synchronous damon_{reclaim,lru_sort} enable/disable'
patchset[1] relies on this patchset, so this patchset should be applied before
that.

Sorry for your inconvenience.

Also, please note that there are two minor DAMON documentation fixes[2] that
not yet picked in mm-unstable.

[1] https://lore.kernel.org/damon/20221025173650.90624-1-sj@kernel.org/
[2] https://lore.kernel.org/damon/20221024174619.15600-1-sj@kernel.org/


Thanks,
SJ

[...]