Re: [PATCH 1/5] selftests/damon: prevent cross-context state pollution in DamonCtx
From: SeongJae Park
Date: Sun May 31 2026 - 12:31:20 EST
On Sun, 31 May 2026 17:17:20 +0800 Kunwu Chan <kunwu.chan@xxxxxxxxx> wrote:
> From: Kunwu Chan <kunwu.chan@xxxxxxxxx>
>
> DamonCtx.__init__() uses mutable default values for
> monitoring_attrs, targets, and schemes. In Python these are
> evaluated once at function definition time, so multiple
> DamonCtx instances can unintentionally share the same lists
> and DamonAttrs instance.
>
> Replace the mutable defaults with None sentinels and
> initialize the objects when needed.
Nice change, thank you!
>
> Co-developed-by: Wang Lian <lianux.mm@xxxxxxxxx>
> Signed-off-by: Wang Lian <lianux.mm@xxxxxxxxx>
> Signed-off-by: Kunwu Chan <chentao@xxxxxxxxxx>
checkpatch.pl complains as below:
WARNING: From:/Signed-off-by: email address mismatch: 'From: Kunwu Chan <kunwu.chan@xxxxxxxxx>' != 'Signed-off-by: Kunwu Chan <chentao@xxxxxxxxxx>'
Other than that,
Reviewed-by: SeongJae Park <sj@xxxxxxxxxx>
Thanks,
SJ
[...]