From nobody Tue Oct 7 21:18:07 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B95EF215175; Sat, 5 Jul 2025 17:50:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751737804; cv=none; b=Ola3pbEgaFva6P8SKs/MfqBJP0LYKeu1lfgf9PlyJtZB9UAMUAua3qg4eBXgSatp3Qz1xdhqWfsnkWBVgjrXEYIpIJIO+EalB2rMuejKkjLNqjmU975W9hkgneRoOxsoFVkBF+X2D18NnuCH7a6+IroZEceYZjdr2Arp/Y4vtNY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751737804; c=relaxed/simple; bh=oSMtWErfIBi3GCTzH1g2nB4nfGeEaP/5IAI//7YlQF4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Xtgb8wXHLjt7TT9zr2xagTUp5+xib6VmONyxswJBYoVnS5QEkKjAeN5lobBOGMS5RkOwqmXYprGBBYnXy/vBpi18J9fUXrvwVWp0+9oQCpiA5eJTKHyJiSGFPnUZKjPh4m/idtgw4iQIkOtYIgEijSvjIQbWSN55nbQX0dYYisY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ozWJMjEh; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ozWJMjEh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F955C4CEE7; Sat, 5 Jul 2025 17:50:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1751737804; bh=oSMtWErfIBi3GCTzH1g2nB4nfGeEaP/5IAI//7YlQF4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ozWJMjEhmXzKMXrMGj9bprytQjdSO5GhuM2/HF+/O/EVLS3lcMvCUKDxdw16/jrcA h35ew3vAOfMme4JwwoNoTi7rssbqqKgJTE7D+eUYZ+HR4ygw6fv9n40IgSQESlFzz7 GYLx/zjrTfXa3vjjoAg7Cva7Dkb61LTAkLi5tjebYOowQHLi/0D7SPHvkMcgVgvidZ Rgs9br3Rt1odqOO9qci6gg02XlPguJQi3utX45bY9f+gyRjLkkv39l7Y3JIAUZRH9Q NWk1juSDa4fvZkAw0sszoNQETVyupNZPTTxJXrenzrmVbP1SmJjV2hbevQwicCjWPl +m6raNZNW2TAw== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, kernel-team@meta.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 1/6] samples/damon/wsse: rename to have damon_sample_ prefix Date: Sat, 5 Jul 2025 10:49:55 -0700 Message-Id: <20250705175000.56259-2-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250705175000.56259-1-sj@kernel.org> References: <20250705175000.56259-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" DAMON sample module, wsse has its name 'wsse'. It could conflict with future modules, and not very easy to identify it by name. Use a prefix, "damon_sample_" for the name. Note that this could break users if they depend on the old name. But it is just a sample, so no such usage is expected, or known. Even if such usage exists, updating it for the new name should be straightforward. Signed-off-by: SeongJae Park --- samples/damon/wsse.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/samples/damon/wsse.c b/samples/damon/wsse.c index e20238a249e7..1e8969a0a626 100644 --- a/samples/damon/wsse.c +++ b/samples/damon/wsse.c @@ -12,6 +12,11 @@ #include #include =20 +#ifdef MODULE_PARAM_PREFIX +#undef MODULE_PARAM_PREFIX +#endif +#define MODULE_PARAM_PREFIX "damon_sample_wsse." + static int target_pid __read_mostly; module_param(target_pid, int, 0600); =20 --=20 2.39.5 From nobody Tue Oct 7 21:18:07 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92A54215798; Sat, 5 Jul 2025 17:50:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751737805; cv=none; b=FFfcT5a1HouYSkdCRY7biiiEpyydIzYsgJb6r1R6ehnPaP2KXT15LFp93hmr+T90hdo868n5KFLx8r5eiPL6iRKeIt3T7dVOzz7VVNdQWq2xVkX04hC6jT4KeX5mN9yo9FCFtwNfd8KjRExXxVw46YuS4SY55asZLrdTjKEVRWA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751737805; c=relaxed/simple; bh=x1UOtr++wfnnN2w2/rHB31NtHodnV1W7q4cMr5UyQ+w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lw5vNccLlOciUaDEHwBlSjK+LG4GtWJFls2hdYS/8kSw+nIGZsSgcgCl0tc8GdZMwH09tRhlBqNR4m2+jqS0lxs3ahtwclofENm9NOesSkEcbvjH/x8OV+QaipDK9LURNkLz5BRpjNX41gI2XEJR/lN1l5QA9UHvTg2bZ/R0sjc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HaJpRuFQ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HaJpRuFQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42C59C4CEF0; Sat, 5 Jul 2025 17:50:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1751737805; bh=x1UOtr++wfnnN2w2/rHB31NtHodnV1W7q4cMr5UyQ+w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HaJpRuFQgiIS/Wy3YSZ6W52FL3zmNA7C8hvfCVKmE+Mof46roplzZl0hmHUTdIPDh fPdnDsS0mcg29H06Nk8drmmD3/d51Dn8JqpM08nxkrDn0af/7+vLtjpLzliQhI1E1S +0esrwdNSIB37HKMiQNPsk2t6ClgjO3JH7ROK7PKiHIwb07GMA/JSX9AP423Ws1ywd 4w2/Y3LmTIsRsUAAaXxlpyGAkRbUmfoOSgZGhaBJ+1Z9TcytzJenKeQjQzRGywLi3F 6aCSgYcdM0Z6XUg358gDvBlQlbt+zkI3MzwGJcg9ixuFz3bwYzo5tDjpeqKJNthvcx c4d+sKEi9oOXA== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, kernel-team@meta.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 2/6] samples/damon/prcl: rename to have damon_sample_ prefix Date: Sat, 5 Jul 2025 10:49:56 -0700 Message-Id: <20250705175000.56259-3-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250705175000.56259-1-sj@kernel.org> References: <20250705175000.56259-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" DAMON sample module, prcl has its name 'prcl'. It could conflict with future modules, and not very easy to identify it by name. Use a prefix, "damon_sample_" for the name. Note that this could break users if they depend on the old name. But it is just a sample, so no such usage is expected, or known. Even if such usage exists, updating it for the new name should be straightforward. Signed-off-by: SeongJae Park --- samples/damon/prcl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/samples/damon/prcl.c b/samples/damon/prcl.c index 5597e6a08ab2..447ccba09e8a 100644 --- a/samples/damon/prcl.c +++ b/samples/damon/prcl.c @@ -11,6 +11,11 @@ #include #include =20 +#ifdef MODULE_PARAM_PREFIX +#undef MODULE_PARAM_PREFIX +#endif +#define MODULE_PARAM_PREFIX "damon_sample_prcl." + static int target_pid __read_mostly; module_param(target_pid, int, 0600); =20 --=20 2.39.5 From nobody Tue Oct 7 21:18:07 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 918EB218596; Sat, 5 Jul 2025 17:50:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751737806; cv=none; b=hOQYaeFkgM8XLurXaj3XMS7avd4mVlS4GWSC0QgiMknBn7u70gvSx8Dsl7P3MPKymFEclBk17qsqTedWN/NvuzqwN3fLv3/v0bau3FQQjAyQMgi/RvaG412C1QbPgR9TxFMuL8QymuodifpXAVs6InQlRcFLtVH4dhCLlkQwfyc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751737806; c=relaxed/simple; bh=fYETpL+f1upa3B/qXNGXnfx6lOT4biyhqR1VQD/Q4xU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=p6GC2XWLqxGQ6im227VQ9sSXPbWiCfDfUKbbpjJTLUc1zCaCEWtatrzUI7ZN5b6Do1oHvMXgLHkVue7vmAPAa1YjnEInUQWcLyue5VUxnv3gVxNNYoFEa+92hnB1PZ8fKYklxsxKMrdJTDoGtqI+kQMcpMV36DPXM5FVWwGywfE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GeEsYZlU; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GeEsYZlU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F142C4CEF1; Sat, 5 Jul 2025 17:50:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1751737806; bh=fYETpL+f1upa3B/qXNGXnfx6lOT4biyhqR1VQD/Q4xU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GeEsYZlUVA4ComSOYsPQItCAvirwszoClXY2ztKs1dphKOrlRbcupiEEwoxIHDnXv alPyXDmu84zR7mwF0fepsVZmeCxeZtSmndnLTv+1F2c0BfsqhE7RtiS8VoAnz4OeDM WJB4OBBBSbOsXucZGtyeqMSas2OYT91d9IT1ywQqIhy/LCevGwTwFu6dWGE+p8Y8ot KIwsRHBwOnXadhV6XEt1WKgrcMWKnzYSd3Upg+cg6NoN2eQCy03KA3NBLY4rHcOCEM zMug6Wp0Ol5e4bSiYRuSg/lUBKkgZzNe8LFfXCbJ80GvIxd5KwvtdctuUPMwDh/PpZ ZQrbQlt61q8XQ== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, kernel-team@meta.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 3/6] samples/damon/mtier: rename to have damon_sample_ prefix Date: Sat, 5 Jul 2025 10:49:57 -0700 Message-Id: <20250705175000.56259-4-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250705175000.56259-1-sj@kernel.org> References: <20250705175000.56259-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" DAMON sample module, mtier has its name 'mtier'. It could conflict with future modules, and not very easy to identify it by name. Use a prefix, "damon_sample_" for the name. Note that this could break users if they depend on the old name. But it is just a sample, so no such usage is expected, or known. Even if such usage exists, updating it for the new name should be straightforward. Signed-off-by: SeongJae Park --- samples/damon/mtier.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/samples/damon/mtier.c b/samples/damon/mtier.c index 97892ade7f31..af168e887f73 100644 --- a/samples/damon/mtier.c +++ b/samples/damon/mtier.c @@ -12,6 +12,11 @@ #include #include =20 +#ifdef MODULE_PARAM_PREFIX +#undef MODULE_PARAM_PREFIX +#endif +#define MODULE_PARAM_PREFIX "damon_sample_mtier." + static unsigned long node0_start_addr __read_mostly; module_param(node0_start_addr, ulong, 0600); =20 --=20 2.39.5 From nobody Tue Oct 7 21:18:07 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0DA521B9D6; Sat, 5 Jul 2025 17:50:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751737808; cv=none; b=l1aVX7YXp0h+RH3SSKcIc/tqVkD91EEvrS14KO0mcRaBtXX29siduOqDvT0nFEt/Fj2wh1BdMGIi86Vj6ReaTaA8NaOv9ZL+UK85WCHgvTvzsD5dN1vcJ35PZf4s17Xq9aaQcRKgcGt3guX16pcEx35fRZS079dyhwYzz83yMQM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751737808; c=relaxed/simple; bh=UlQxor/ZrTo1LCopX/vs+QBnkrkfnY6J7q+nqa5X2vM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Zv2Fv3eGh1r08RvjKdgckwMsoBHB+FaEBo9Y5sGHO6VA30FdVM0Rq1s/GGDW/Elfnq/yvqXBRG2ZjZhV2UoCFI7k6ZlXaf9gMCeOtgqNEXwlunNtYui9qyaehI8MSEd0VMEO/YHpdYsWADoHjX54GV2l6D+JnMPlSaAgFv/6sSU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=f24XUX+m; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="f24XUX+m" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59F21C4CEE7; Sat, 5 Jul 2025 17:50:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1751737807; bh=UlQxor/ZrTo1LCopX/vs+QBnkrkfnY6J7q+nqa5X2vM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f24XUX+m23bN8Hmsz3jagw7Q/aGUMDMsDJm9/A+gXpG+aiU8IR7acWQGda1f6YRQu O5vPJ47LfdF1QwhCU6STQWLvEdZ6/847dJpoWR/IbnEcBws3eN06uJ95aAfnPp2tsB 6ETkcJyDuQ6g2eI9nX8ptCiG5qdZ/endL9+s2oJNgtKMaA9HnvQQMPxRWKfWkaXeA2 NRXHywTAoygU+Xq3sAJi1rq4eEu1S6zZK2osbK2aYi06wYQ7ZYezpmuhpBxP+RyIMa 7Sd7yrglH/Om3V3KtgLT1on3xpbOpw84+lb23bjFsjJOKE+G/gtVdsUseZEtdRkN2B HVI8QZC/gipEQ== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, kernel-team@meta.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 4/6] mm/damon/sysfs: use DAMON core API damon_is_running() Date: Sat, 5 Jul 2025 10:49:58 -0700 Message-Id: <20250705175000.56259-5-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250705175000.56259-1-sj@kernel.org> References: <20250705175000.56259-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" DAMON core implements a static function to see if a given DAMON context is running. DAMON sysfs interface is implementing the same one on its own. Make the core function non-static and reuse it from the DAMON sysfs interface. Signed-off-by: SeongJae Park --- include/linux/damon.h | 1 + mm/damon/core.c | 8 +++++++- mm/damon/sysfs.c | 14 ++------------ 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/include/linux/damon.h b/include/linux/damon.h index bb58e36f019e..e1fea3119538 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -934,6 +934,7 @@ static inline unsigned int damon_max_nr_accesses(const = struct damon_attrs *attrs =20 int damon_start(struct damon_ctx **ctxs, int nr_ctxs, bool exclusive); int damon_stop(struct damon_ctx **ctxs, int nr_ctxs); +bool damon_is_running(struct damon_ctx *ctx); =20 int damon_call(struct damon_ctx *ctx, struct damon_call_control *control); int damos_walk(struct damon_ctx *ctx, struct damos_walk_control *control); diff --git a/mm/damon/core.c b/mm/damon/core.c index dc0ee2dd55d3..5357a18066b0 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -1311,7 +1311,13 @@ int damon_stop(struct damon_ctx **ctxs, int nr_ctxs) return err; } =20 -static bool damon_is_running(struct damon_ctx *ctx) +/** + * damon_is_running() - Returns if a given DAMON context is running. + * @ctx: The DAMON context to see if running. + * + * Return: true if @ctx is running, false otherwise. + */ +bool damon_is_running(struct damon_ctx *ctx) { bool running; =20 diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c index 1b1476b79cdb..79d65dcc9dd0 100644 --- a/mm/damon/sysfs.c +++ b/mm/damon/sysfs.c @@ -1189,16 +1189,6 @@ static void damon_sysfs_kdamond_rm_dirs(struct damon= _sysfs_kdamond *kdamond) kobject_put(&kdamond->contexts->kobj); } =20 -static bool damon_sysfs_ctx_running(struct damon_ctx *ctx) -{ - bool running; - - mutex_lock(&ctx->kdamond_lock); - running =3D ctx->kdamond !=3D NULL; - mutex_unlock(&ctx->kdamond_lock); - return running; -} - /* * enum damon_sysfs_cmd - Commands for a specific kdamond. */ @@ -1275,7 +1265,7 @@ static ssize_t state_show(struct kobject *kobj, struc= t kobj_attribute *attr, if (!ctx) running =3D false; else - running =3D damon_sysfs_ctx_running(ctx); + running =3D damon_is_running(ctx); =20 return sysfs_emit(buf, "%s\n", running ? damon_sysfs_cmd_strs[DAMON_SYSFS_CMD_ON] : @@ -1429,7 +1419,7 @@ static inline bool damon_sysfs_kdamond_running( struct damon_sysfs_kdamond *kdamond) { return kdamond->damon_ctx && - damon_sysfs_ctx_running(kdamond->damon_ctx); + damon_is_running(kdamond->damon_ctx); } =20 static int damon_sysfs_apply_inputs(struct damon_ctx *ctx, --=20 2.39.5 From nobody Tue Oct 7 21:18:07 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA2E520012B; Sat, 5 Jul 2025 17:50:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751737808; cv=none; b=aYCLpkRSb/FpKle9MXNRwRoagxShk/q1ZLbOG9QsHW/4WrA9yO4H8RfIUHK+cNl18JqPnMtFikct7Xb27bIZTvSDC8eQxVpQnrvY8i/zOP3fYc1GsNoBvU2LSde2T85stsRUentNd7U5DEjEq8MVWn7LG9TvoXBWTWHK5pRYxbA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751737808; c=relaxed/simple; bh=caVLtvekI2dzKAOKguvjHyIU7EwG2c4nf8nQzeNWT3A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kqxdIKzO1XXRFwd3+fKEjb64yFrejyH6hp0VV0k5sz56o/wfDOn9vdM4kW2YOYAJo8noX3ea3HgepjgLot2Dw/hQO75hS8TjY37qAdaV0LWBgyHJ76+KaReZ0YOykwXWceKN1xlYKwlCfYbwMJa+OMfPftvJrkXL2pI7hB0Jmio= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=W8nDk0gF; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="W8nDk0gF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 64686C4CEE7; Sat, 5 Jul 2025 17:50:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1751737808; bh=caVLtvekI2dzKAOKguvjHyIU7EwG2c4nf8nQzeNWT3A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W8nDk0gFwQeLCYbtF1Ywc2Mz43fM1+I0QceZxnPvEobJuN90FWckiRruTCUJhwQ0L nAG0r7kprHtPRSZUV+7l8rsFbc4H5MhhN2Oc20WYhG8u3ozv6qLcw/TVQLMGl0lmsN Tm+yNTWMKdrVpYYG/RuCSWKVMbwOfYMbDzae5/wE/mzGbKMvbuWdigABUN2OR7gqJS NKSbboGyZXC8RRISuj0rFhwJxGAyPDpNhc7zN3P3jSV/uuS/Bfso7IE5Ebm4Djkgd6 svBkcm0ZxUvFwvmi8gYZhQw5LOpdkq59Qr47iuu62BzI/LlsV0KXlzJK6HvbxDAQ5l A1hoil7Qvj5Zg== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, kernel-team@meta.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 5/6] mm/damon/sysfs: don't hold kdamond_lock in before_terminate() Date: Sat, 5 Jul 2025 10:49:59 -0700 Message-Id: <20250705175000.56259-6-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250705175000.56259-1-sj@kernel.org> References: <20250705175000.56259-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" damon_sysfs_before_terminate() is a DAMON callback that is executed from the kdamond's context. Hence it is safe to access DAMON context internal data. But the function is unnecessarily holding kdamond_lock of the context. It is just unnecessary. Remove the locking code. Signed-off-by: SeongJae Park --- mm/damon/sysfs.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c index 79d65dcc9dd0..c0193de6fb9a 100644 --- a/mm/damon/sysfs.c +++ b/mm/damon/sysfs.c @@ -1387,12 +1387,10 @@ static void damon_sysfs_before_terminate(struct dam= on_ctx *ctx) if (!damon_target_has_pid(ctx)) return; =20 - mutex_lock(&ctx->kdamond_lock); damon_for_each_target_safe(t, next, ctx) { put_pid(t->pid); damon_destroy_target(t); } - mutex_unlock(&ctx->kdamond_lock); } =20 /* --=20 2.39.5 From nobody Tue Oct 7 21:18:07 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1A36B223DC6; Sat, 5 Jul 2025 17:50:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751737811; cv=none; b=L1rCYtTgy/oZEA7KZovr3B/33MB8uxVDgCYfJtOj5qVRHrFRmbrRCOSrvoOZp/+NDnoKWxxvxwJoQY5pSM8cdJ2DaOD8lk6SPFwKx7KsHn2/MZBKWpAiE7eUaUhEp7dhPMgcnQt6cslbmSm1qL6mO/SRr+WlIDS+WxBO7OrFDW0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751737811; c=relaxed/simple; bh=MRKp90zy+fE+PWnSNoK2r9DKEixr7CxXd4ejww/Kp3E=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=JKIbtPYYzNH+9F7yjTtR3IoqhS4VHPtUtY+dTpgXrzBIdVuQI3xHhKUpy8j1HgeNvlLTHcF3m97cIVy6RYNhyj0yBJewqev93OVPfWh8SSwpYUllHaM0yAdrvZpQIVWX7mj6iZX/VTj/i9i8t+pUEJ02E46teODPSAKbvYYyNWs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IjJFbB/T; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IjJFbB/T" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E4DEC4CEF3; Sat, 5 Jul 2025 17:50:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1751737809; bh=MRKp90zy+fE+PWnSNoK2r9DKEixr7CxXd4ejww/Kp3E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IjJFbB/TJgHOYYvTK4YKFHCIUHLhMNugNwmXSN/PoYsxblJdV9jSKbEBoC3WEWCAQ H4WraXru11vTaJADsbmR3Dm60hIxQYGWidUqu2yowRN+RRfwjlMW3MDBgJjPdsORNu r00b6pduZ3vLynjChv0HZU512cKsoTIgslhwimQWiE+dma2seS3kb6L5x5LCnNqJp2 yJyHjq8wkhy+qGWOaQ3riCtLFjRJlH7ZE8kXhKy9DvshmQxolZ7gF/OSQ9XnGe9Q4s u17RRhawo3BvKqvDXZtJE5n8F0wUONIdVRuqvGM523wnAiPIaYP1GX+PlbLemwF9wN qFoA1ti7wtdEA== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Jonathan Corbet , damon@lists.linux.dev, kernel-team@meta.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 6/6] Docs/mm/damon/maintainer-profile: update for mm-new tree Date: Sat, 5 Jul 2025 10:50:00 -0700 Message-Id: <20250705175000.56259-7-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250705175000.56259-1-sj@kernel.org> References: <20250705175000.56259-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Recently a new mm tree for new patches, namely mm-new, has been added. Update DAMON maintainer's profile doc for DAMON patches life cycle, which depend on those of mm trees. Signed-off-by: SeongJae Park --- Documentation/mm/damon/maintainer-profile.rst | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/Documentation/mm/damon/maintainer-profile.rst b/Documentation/= mm/damon/maintainer-profile.rst index ce3e98458339..5cd07905a193 100644 --- a/Documentation/mm/damon/maintainer-profile.rst +++ b/Documentation/mm/damon/maintainer-profile.rst @@ -7,9 +7,9 @@ The DAMON subsystem covers the files that are listed in 'DA= TA ACCESS MONITOR' section of 'MAINTAINERS' file. =20 The mailing lists for the subsystem are damon@lists.linux.dev and -linux-mm@kvack.org. Patches should be made against the `mm-unstable tree -`_ whenever possible and pos= ted -to the mailing lists. +linux-mm@kvack.org. Patches should be made against the `mm-new tree +`_ whenever possible and posted t= o the +mailing lists. =20 SCM Trees --------- @@ -17,17 +17,19 @@ SCM Trees There are multiple Linux trees for DAMON development. Patches under development or testing are queued in `damon/next `_ by the DAMON maintainer. -Sufficiently reviewed patches will be queued in `mm-unstable -`_ by the memory management -subsystem maintainer. After more sufficient tests, the patches will be qu= eued -in `mm-stable `_, and finally -pull-requested to the mainline by the memory management subsystem maintain= er. - -Note again the patches for `mm-unstable tree -`_ are queued by the memory -management subsystem maintainer. If the patches requires some patches in -`damon/next tree `_ which not yet = merged -in mm-unstable, please make sure the requirement is clearly specified. +Sufficiently reviewed patches will be queued in `mm-new +`_ by the memory management subsy= stem +maintainer. As more sufficient tests are done, the patches will move to +`mm-unstable `_ and then to +`mm-stable `_. And finally th= ose +will be pull-requested to the mainline by the memory management subsystem +maintainer. + +Note again the patches for `mm-new tree +`_ are queued by the memory manag= ement +subsystem maintainer. If the patches requires some patches in `damon/next= tree +`_ which not yet merged in mm-new, +please make sure the requirement is clearly specified. =20 Submit checklist addendum ------------------------- @@ -53,8 +55,9 @@ Further doing below and putting the results will be helpf= ul. Key cycle dates --------------- =20 -Patches can be sent anytime. Key cycle dates of the `mm-unstable -`_ and `mm-stable +Patches can be sent anytime. Key cycle dates of the `mm-new +`_, `mm-unstable +`_and `mm-stable `_ trees depend on the memory management subsystem maintainer. =20 --=20 2.39.5