Skip to content

RFC mm/damon: allow NULL or unstarted damon_ctx parameter for damon_call()

SJ Park damon linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4mm/damon/core: handle NULL ctx parameter in damon_call()mm/damon/core.c+2 -04 replies
2/4mm/damon/core: set ctx->call_controls_obsolete in damon_new_ctx()mm/damon/core.c+1 -41 reply
3/4mm/damon/reclaim: remove unnecessary damon_call() param validationmm/damon/reclaim.c+0 -81 reply
4/4mm/damon/lru_sort: remove unnecessary damon_call() param validationmm/damon/lru_sort.c+0 -81 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/4] mm/damon: allow NULL or unstarted damon_ctx parameter for damon_call()

Callers of damon_call() should validate the damon_ctx object parameter. If it is NULL or never damon_start()-ed object, damon_call() could dereference the NULL pointer or indefinitely hang. Ensuring all callers doing the validation correctly has turned out to be difficult. Handle the corner cases inside the core layer and remove callers' validations.

Patches 1 and 2 respectively allow passing NULL and not yet damon_start()-ed ctx parameter to damon_call(). Patches 3 and 4 remove the callers side validations in DMON_RECLAIM and DASMON_LRU_SORT, respectively.

SJ Park (4):
mm/damon/core: handle NULL ctx parameter in damon_call() mm/damon/core: set ctx->call_controls_obsolete in damon_new_ctx() mm/damon/reclaim: remove unnecessary damon_call() param validation mm/damon/lru_sort: remove unnecessary damon_call() param validation

 mm/damon/core.c     | 7 +++----
 mm/damon/lru_sort.c | 8 --------
 mm/damon/reclaim.c  | 8 --------
 3 files changed, 3 insertions(+), 20 deletions(-)

base-commit: c8520e181a2aaf85290d0447656de0df112dbbea

Signature · 1 line
2.47.3