* [PATCH] mm/damon/sysfs: use the wrapper directly to check if the kdamond is running
@ 2022-09-12 15:11 xiakaixu1987
2022-09-13 14:41 ` SeongJae Park
2022-09-14 7:09 ` Muchun Song
0 siblings, 2 replies; 3+ messages in thread
From: xiakaixu1987 @ 2022-09-12 15:11 UTC (permalink / raw)
To: sj, akpm; +Cc: damon, linux-mm, linux-kernel, Kaixu Xia
From: Kaixu Xia <kaixuxia@tencent.com>
We can use the 'damon_sysfs_kdamond_running()' wrapper directly to
check if the kdamond is running in 'damon_sysfs_turn_damon_on()'.
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
---
mm/damon/sysfs.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c
index 7488e27c87c3..84861c4085a5 100644
--- a/mm/damon/sysfs.c
+++ b/mm/damon/sysfs.c
@@ -2455,8 +2455,7 @@ static int damon_sysfs_turn_damon_on(struct damon_sysfs_kdamond *kdamond)
struct damon_ctx *ctx;
int err;
- if (kdamond->damon_ctx &&
- damon_sysfs_ctx_running(kdamond->damon_ctx))
+ if (damon_sysfs_kdamond_running(kdamond))
return -EBUSY;
if (damon_sysfs_cmd_request.kdamond == kdamond)
return -EBUSY;
--
2.27.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mm/damon/sysfs: use the wrapper directly to check if the kdamond is running
2022-09-12 15:11 [PATCH] mm/damon/sysfs: use the wrapper directly to check if the kdamond is running xiakaixu1987
@ 2022-09-13 14:41 ` SeongJae Park
2022-09-14 7:09 ` Muchun Song
1 sibling, 0 replies; 3+ messages in thread
From: SeongJae Park @ 2022-09-13 14:41 UTC (permalink / raw)
To: xiakaixu1987; +Cc: sj, akpm, damon, linux-mm, linux-kernel, Kaixu Xia
Hi Kaixu,
On Mon, 12 Sep 2022 23:11:53 +0800 xiakaixu1987@gmail.com wrote:
> From: Kaixu Xia <kaixuxia@tencent.com>
>
> We can use the 'damon_sysfs_kdamond_running()' wrapper directly to
> check if the kdamond is running in 'damon_sysfs_turn_damon_on()'.
>
> Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Thanks,
SJ
> ---
> mm/damon/sysfs.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c
> index 7488e27c87c3..84861c4085a5 100644
> --- a/mm/damon/sysfs.c
> +++ b/mm/damon/sysfs.c
> @@ -2455,8 +2455,7 @@ static int damon_sysfs_turn_damon_on(struct damon_sysfs_kdamond *kdamond)
> struct damon_ctx *ctx;
> int err;
>
> - if (kdamond->damon_ctx &&
> - damon_sysfs_ctx_running(kdamond->damon_ctx))
> + if (damon_sysfs_kdamond_running(kdamond))
> return -EBUSY;
> if (damon_sysfs_cmd_request.kdamond == kdamond)
> return -EBUSY;
> --
> 2.27.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm/damon/sysfs: use the wrapper directly to check if the kdamond is running
2022-09-12 15:11 [PATCH] mm/damon/sysfs: use the wrapper directly to check if the kdamond is running xiakaixu1987
2022-09-13 14:41 ` SeongJae Park
@ 2022-09-14 7:09 ` Muchun Song
1 sibling, 0 replies; 3+ messages in thread
From: Muchun Song @ 2022-09-14 7:09 UTC (permalink / raw)
To: xiakaixu1987; +Cc: sj, Andrew Morton, damon, Linux MM, linux-kernel, Kaixu Xia
> On Sep 12, 2022, at 23:11, xiakaixu1987@gmail.com wrote:
>
> From: Kaixu Xia <kaixuxia@tencent.com>
>
> We can use the 'damon_sysfs_kdamond_running()' wrapper directly to
> check if the kdamond is running in 'damon_sysfs_turn_damon_on()'.
>
> Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-09-14 7:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-12 15:11 [PATCH] mm/damon/sysfs: use the wrapper directly to check if the kdamond is running xiakaixu1987
2022-09-13 14:41 ` SeongJae Park
2022-09-14 7:09 ` Muchun Song
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).