mbox series

[0/4] Remove the type-unclear target id concept

Message ID 20211230100723.2238-1-sj@kernel.org (mailing list archive)
Headers show
Series Remove the type-unclear target id concept | expand

Message

SeongJae Park Dec. 30, 2021, 10:07 a.m. UTC
DAMON asks each monitoring target ('struct damon_target') to have one
'unsigned long' integer called 'id', which should be unique among the
targets of same monitoring context.  Meaning of it is, however, totally
up to the monitoring primitives that registered to the monitoring
context.  For example, the virtual address spaces monitoring primitives
treats the id as a 'struct pid' pointer.

This makes the code flexible but ugly, not well-documented, and
type-unsafe[1].  Also, identification of each target can be done via its
index.  For the reason, this patchset removes the concept and uses clear
type definition.

[1] https://lore.kernel.org/linux-mm/20211013154535.4aaeaaf9d0182922e405dd1e@linux-foundation.org/

SeongJae Park (4):
  mm/damon/dbgfs/init_regions: Use target index instead of target id
  Docs/admin-guide/mm/damon/usage: Update for changed initail_regions
    file input
  mm/damon/core: Move damon_set_targets() into dbgfs
  mm/damon: Remove the target id concept

 Documentation/admin-guide/mm/damon/usage.rst |  24 ++-
 include/linux/damon.h                        |  13 +-
 mm/damon/core-test.h                         |  21 +-
 mm/damon/core.c                              |  36 +---
 mm/damon/dbgfs-test.h                        |  83 +++-----
 mm/damon/dbgfs.c                             | 202 ++++++++++++-------
 mm/damon/reclaim.c                           |   3 +-
 mm/damon/vaddr-test.h                        |   6 +-
 mm/damon/vaddr.c                             |   4 +-
 9 files changed, 199 insertions(+), 193 deletions(-)

Comments

Andrew Morton Dec. 31, 2021, 2:20 a.m. UTC | #1
On Thu, 30 Dec 2021 10:07:19 +0000 SeongJae Park <sj@kernel.org> wrote:

> DAMON asks each monitoring target ('struct damon_target') to have one
> 'unsigned long' integer called 'id', which should be unique among the
> targets of same monitoring context.  Meaning of it is, however, totally
> up to the monitoring primitives that registered to the monitoring
> context.  For example, the virtual address spaces monitoring primitives
> treats the id as a 'struct pid' pointer.
> 
> This makes the code flexible but ugly, not well-documented, and
> type-unsafe[1].  Also, identification of each target can be done via its
> index.  For the reason, this patchset removes the concept and uses clear
> type definition.

Thanks.  This doesn't appear to be urgent, so I'll park it until after 5.17-rc1.
SeongJae Park Jan. 26, 2022, 4:37 p.m. UTC | #2
On Thu, 30 Dec 2021 18:20:59 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:

> On Thu, 30 Dec 2021 10:07:19 +0000 SeongJae Park <sj@kernel.org> wrote:
> 
> > DAMON asks each monitoring target ('struct damon_target') to have one
> > 'unsigned long' integer called 'id', which should be unique among the
> > targets of same monitoring context.  Meaning of it is, however, totally
> > up to the monitoring primitives that registered to the monitoring
> > context.  For example, the virtual address spaces monitoring primitives
> > treats the id as a 'struct pid' pointer.
> > 
> > This makes the code flexible but ugly, not well-documented, and
> > type-unsafe[1].  Also, identification of each target can be done via its
> > index.  For the reason, this patchset removes the concept and uses clear
> > type definition.
> 
> Thanks.  This doesn't appear to be urgent, so I'll park it until after 5.17-rc1.

Just for a remind.  I confirmed this patchset is cleanly applicable on the
latest -next tree.


Thanks,
SJ