Skip to content

RFC mm/damon/core: hide core-private struct fields

SJ Park damon linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest10 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10mm/damon/core: hide private damon_region fieldsinclude/linux/damon.h+4 -30 replies
2/10mm/damon/core: hide private damon_target fieldsinclude/linux/damon.h+5 -40 replies
3/10mm/damon/core: hide private damos_quota_goal fieldsinclude/linux/damon.h+6 -30 replies
4/10mm/damon/core: hide private damos_quota fieldsinclude/linux/damon.h+4 -30 replies
5/10mm/damon/core: hide private damos_filter fieldsinclude/linux/damon.h+2 -10 replies
6/10mm/damon/core: hide private damos fieldsinclude/linux/damon.h+27 -252 replies
7/10mm/damon/core: hide private damon_filter fieldsinclude/linux/damon.h+2 -10 replies
8/10mm/damon/core: hide private damon_probe fieldsinclude/linux/damon.h+3 -20 replies
9/10mm/damon/sysfs: do not directly access damon_ctx->opsmm/damon/sysfs.c+1 -10 replies
10/10mm/damon/core: hide core-private damon_ctx fieldsinclude/linux/damon.h+8 -70 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 00/10] mm/damon/core: hide core-private struct fields

DAMON core structs hide core-private fields using 'private:' comment tags. It is incomplete and inconsistent. The linked list heads in a few structs, for example, are intended to be hidden, and always be used using the wrapper macros like damon_for_each_region(). But those were mistakenly marked as non-private. A few core layer-only fields were also mistakenly added as non-private.

This only encourages callers to directly use the private fields. It is easy to make mistakes, and difficult to control. Mark all such DAMON core struct fields as private.

Patches 1-8 mark the private fields for damon_region, damon_target, damos_quota_goal, damos_quota, damos_filter, damos, damon_filter and damon_probe, respectively. Patch 9 removes DAMON_SYSFS's direct access to core-private field, damon_ctx->ops. Finally patch 10 mark the private fields for damon_ctx.

SJ Park (10):
mm/damon/core: hide private damon_region fields mm/damon/core: hide private damon_target fields mm/damon/core: hide private damos_quota_goal fields mm/damon/core: hide private damos_quota fields mm/damon/core: hide private damos_filter fields mm/damon/core: hide private damos fields mm/damon/core: hide private damon_filter fields mm/damon/core: hide private damon_probe fields mm/damon/sysfs: do not directly access damon_ctx->ops mm/damon/core: hide core-private damon_ctx fields

 include/linux/damon.h | 110 +++++++++++++++++++++++-------------------
 mm/damon/sysfs.c      |   2 +-
 2 files changed, 62 insertions(+), 50 deletions(-)

base-commit: ddf3f75c217672edd46466c9156d64abf5119b68

Signature · 1 line
2.47.3