All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/10] mm/damon/core: hide core-private struct fields
@ 2026-07-14 14:35 SJ Park
  2026-07-14 14:35 ` [PATCH 01/10] mm/damon/core: hide private damon_region fields SJ Park
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: SJ Park @ 2026-07-14 14:35 UTC (permalink / raw)
  To: Andrew Morton; +Cc: SJ Park, damon, linux-kernel, linux-mm

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.

Changes from RFC v1
- RFC v1: https://lore.kernel.org/20260714043437.95811-1-sj@kernel.org
- Drop RFC tag.

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: 4c0f8c26ecc149f268b6c488e6cbde2a4e58160a
-- 
2.47.3

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-07-14 14:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-14 14:35 [PATCH 00/10] mm/damon/core: hide core-private struct fields SJ Park
2026-07-14 14:35 ` [PATCH 01/10] mm/damon/core: hide private damon_region fields SJ Park
2026-07-14 14:35 ` [PATCH 02/10] mm/damon/core: hide private damon_target fields SJ Park
2026-07-14 14:35 ` [PATCH 03/10] mm/damon/core: hide private damos_quota_goal fields SJ Park
2026-07-14 14:35 ` [PATCH 04/10] mm/damon/core: hide private damos_quota fields SJ Park
2026-07-14 14:35 ` [PATCH 05/10] mm/damon/core: hide private damos_filter fields SJ Park
2026-07-14 14:35 ` [PATCH 06/10] mm/damon/core: hide private damos fields SJ Park
2026-07-14 14:35 ` [PATCH 07/10] mm/damon/core: hide private damon_filter fields SJ Park
2026-07-14 14:35 ` [PATCH 08/10] mm/damon/core: hide private damon_probe fields SJ Park
2026-07-14 14:35 ` [PATCH 09/10] mm/damon/sysfs: do not directly access damon_ctx->ops SJ Park
2026-07-14 14:35 ` [PATCH 10/10] mm/damon/core: hide core-private damon_ctx fields SJ Park

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.