Skip to content

Commit 8f7dd19

Browse files
honggyukimgregkh
authored andcommitted
samples/damon: change enable parameters to enabled
[ Upstream commit 7930205 ] The damon_{lru_sort,reclaim,stat} kernel modules use "enabled" parameter knobs as follows. /sys/module/damon_lru_sort/parameters/enabled /sys/module/damon_reclaim/parameters/enabled /sys/module/damon_stat/parameters/enabled However, other sample modules of damon use "enable" parameter knobs so it'd be better to rename them from "enable" to "enabled" to keep the consistency with other damon modules. Before: /sys/module/damon_sample_wsse/parameters/enable /sys/module/damon_sample_prcl/parameters/enable /sys/module/damon_sample_mtier/parameters/enable After: /sys/module/damon_sample_wsse/parameters/enabled /sys/module/damon_sample_prcl/parameters/enabled /sys/module/damon_sample_mtier/parameters/enabled There is no functional changes in this patch. Link: https://lkml.kernel.org/r/20250707024548.1964-1-honggyu.kim@sk.com Signed-off-by: Honggyu Kim <honggyu.kim@sk.com> Reviewed-by: SeongJae Park <sj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Stable-dep-of: c62cff4 ("samples/damon/mtier: avoid starting DAMON before initialization") Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 1338fb5 commit 8f7dd19

3 files changed

Lines changed: 33 additions & 33 deletions

File tree

samples/damon/mtier.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ module_param(node1_end_addr, ulong, 0600);
2727
static int damon_sample_mtier_enable_store(
2828
const char *val, const struct kernel_param *kp);
2929

30-
static const struct kernel_param_ops enable_param_ops = {
30+
static const struct kernel_param_ops enabled_param_ops = {
3131
.set = damon_sample_mtier_enable_store,
3232
.get = param_get_bool,
3333
};
3434

35-
static bool enable __read_mostly;
36-
module_param_cb(enable, &enable_param_ops, &enable, 0600);
37-
MODULE_PARM_DESC(enable, "Enable of disable DAMON_SAMPLE_MTIER");
35+
static bool enabled __read_mostly;
36+
module_param_cb(enabled, &enabled_param_ops, &enabled, 0600);
37+
MODULE_PARM_DESC(enabled, "Enable or disable DAMON_SAMPLE_MTIER");
3838

3939
static struct damon_ctx *ctxs[2];
4040

@@ -156,20 +156,20 @@ static bool init_called;
156156
static int damon_sample_mtier_enable_store(
157157
const char *val, const struct kernel_param *kp)
158158
{
159-
bool enabled = enable;
159+
bool is_enabled = enabled;
160160
int err;
161161

162-
err = kstrtobool(val, &enable);
162+
err = kstrtobool(val, &enabled);
163163
if (err)
164164
return err;
165165

166-
if (enable == enabled)
166+
if (enabled == is_enabled)
167167
return 0;
168168

169-
if (enable) {
169+
if (enabled) {
170170
err = damon_sample_mtier_start();
171171
if (err)
172-
enable = false;
172+
enabled = false;
173173
return err;
174174
}
175175
damon_sample_mtier_stop();
@@ -181,10 +181,10 @@ static int __init damon_sample_mtier_init(void)
181181
int err = 0;
182182

183183
init_called = true;
184-
if (enable) {
184+
if (enabled) {
185185
err = damon_sample_mtier_start();
186186
if (err)
187-
enable = false;
187+
enabled = false;
188188
}
189189
return 0;
190190
}

samples/damon/prcl.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ module_param(target_pid, int, 0600);
1717
static int damon_sample_prcl_enable_store(
1818
const char *val, const struct kernel_param *kp);
1919

20-
static const struct kernel_param_ops enable_param_ops = {
20+
static const struct kernel_param_ops enabled_param_ops = {
2121
.set = damon_sample_prcl_enable_store,
2222
.get = param_get_bool,
2323
};
2424

25-
static bool enable __read_mostly;
26-
module_param_cb(enable, &enable_param_ops, &enable, 0600);
27-
MODULE_PARM_DESC(enable, "Enable of disable DAMON_SAMPLE_WSSE");
25+
static bool enabled __read_mostly;
26+
module_param_cb(enabled, &enabled_param_ops, &enabled, 0600);
27+
MODULE_PARM_DESC(enabled, "Enable or disable DAMON_SAMPLE_PRCL");
2828

2929
static struct damon_ctx *ctx;
3030
static struct pid *target_pidp;
@@ -114,20 +114,20 @@ static bool init_called;
114114
static int damon_sample_prcl_enable_store(
115115
const char *val, const struct kernel_param *kp)
116116
{
117-
bool enabled = enable;
117+
bool is_enabled = enabled;
118118
int err;
119119

120-
err = kstrtobool(val, &enable);
120+
err = kstrtobool(val, &enabled);
121121
if (err)
122122
return err;
123123

124-
if (enable == enabled)
124+
if (enabled == is_enabled)
125125
return 0;
126126

127-
if (enable) {
127+
if (enabled) {
128128
err = damon_sample_prcl_start();
129129
if (err)
130-
enable = false;
130+
enabled = false;
131131
return err;
132132
}
133133
damon_sample_prcl_stop();
@@ -139,10 +139,10 @@ static int __init damon_sample_prcl_init(void)
139139
int err = 0;
140140

141141
init_called = true;
142-
if (enable) {
142+
if (enabled) {
143143
err = damon_sample_prcl_start();
144144
if (err)
145-
enable = false;
145+
enabled = false;
146146
}
147147
return 0;
148148
}

samples/damon/wsse.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ module_param(target_pid, int, 0600);
1818
static int damon_sample_wsse_enable_store(
1919
const char *val, const struct kernel_param *kp);
2020

21-
static const struct kernel_param_ops enable_param_ops = {
21+
static const struct kernel_param_ops enabled_param_ops = {
2222
.set = damon_sample_wsse_enable_store,
2323
.get = param_get_bool,
2424
};
2525

26-
static bool enable __read_mostly;
27-
module_param_cb(enable, &enable_param_ops, &enable, 0600);
28-
MODULE_PARM_DESC(enable, "Enable or disable DAMON_SAMPLE_WSSE");
26+
static bool enabled __read_mostly;
27+
module_param_cb(enabled, &enabled_param_ops, &enabled, 0600);
28+
MODULE_PARM_DESC(enabled, "Enable or disable DAMON_SAMPLE_WSSE");
2929

3030
static struct damon_ctx *ctx;
3131
static struct pid *target_pidp;
@@ -94,20 +94,20 @@ static bool init_called;
9494
static int damon_sample_wsse_enable_store(
9595
const char *val, const struct kernel_param *kp)
9696
{
97-
bool enabled = enable;
97+
bool is_enabled = enabled;
9898
int err;
9999

100-
err = kstrtobool(val, &enable);
100+
err = kstrtobool(val, &enabled);
101101
if (err)
102102
return err;
103103

104-
if (enable == enabled)
104+
if (enabled == is_enabled)
105105
return 0;
106106

107-
if (enable) {
107+
if (enabled) {
108108
err = damon_sample_wsse_start();
109109
if (err)
110-
enable = false;
110+
enabled = false;
111111
return err;
112112
}
113113
damon_sample_wsse_stop();
@@ -119,10 +119,10 @@ static int __init damon_sample_wsse_init(void)
119119
int err = 0;
120120

121121
init_called = true;
122-
if (enable) {
122+
if (enabled) {
123123
err = damon_sample_wsse_start();
124124
if (err)
125-
enable = false;
125+
enabled = false;
126126
}
127127
return err;
128128
}

0 commit comments

Comments
 (0)