|
19 | 19 | #include "ops-common.h" |
20 | 20 |
|
21 | 21 | #ifdef CONFIG_DAMON_VADDR_KUNIT_TEST |
22 | | -#undef DAMON_MIN_REGION |
23 | | -#define DAMON_MIN_REGION 1 |
| 22 | +#undef DAMON_MIN_REGION_SZ |
| 23 | +#define DAMON_MIN_REGION_SZ 1 |
24 | 24 | #endif |
25 | 25 |
|
26 | 26 | /* |
@@ -78,7 +78,7 @@ static int damon_va_evenly_split_region(struct damon_target *t, |
78 | 78 |
|
79 | 79 | orig_end = r->ar.end; |
80 | 80 | sz_orig = damon_sz_region(r); |
81 | | - sz_piece = ALIGN_DOWN(sz_orig / nr_pieces, DAMON_MIN_REGION); |
| 81 | + sz_piece = ALIGN_DOWN(sz_orig / nr_pieces, DAMON_MIN_REGION_SZ); |
82 | 82 |
|
83 | 83 | if (!sz_piece) |
84 | 84 | return -EINVAL; |
@@ -161,12 +161,12 @@ static int __damon_va_three_regions(struct mm_struct *mm, |
161 | 161 | swap(first_gap, second_gap); |
162 | 162 |
|
163 | 163 | /* Store the result */ |
164 | | - regions[0].start = ALIGN(start, DAMON_MIN_REGION); |
165 | | - regions[0].end = ALIGN(first_gap.start, DAMON_MIN_REGION); |
166 | | - regions[1].start = ALIGN(first_gap.end, DAMON_MIN_REGION); |
167 | | - regions[1].end = ALIGN(second_gap.start, DAMON_MIN_REGION); |
168 | | - regions[2].start = ALIGN(second_gap.end, DAMON_MIN_REGION); |
169 | | - regions[2].end = ALIGN(prev->vm_end, DAMON_MIN_REGION); |
| 164 | + regions[0].start = ALIGN(start, DAMON_MIN_REGION_SZ); |
| 165 | + regions[0].end = ALIGN(first_gap.start, DAMON_MIN_REGION_SZ); |
| 166 | + regions[1].start = ALIGN(first_gap.end, DAMON_MIN_REGION_SZ); |
| 167 | + regions[1].end = ALIGN(second_gap.start, DAMON_MIN_REGION_SZ); |
| 168 | + regions[2].start = ALIGN(second_gap.end, DAMON_MIN_REGION_SZ); |
| 169 | + regions[2].end = ALIGN(prev->vm_end, DAMON_MIN_REGION_SZ); |
170 | 170 |
|
171 | 171 | return 0; |
172 | 172 | } |
@@ -259,8 +259,8 @@ static void __damon_va_init_regions(struct damon_ctx *ctx, |
259 | 259 | sz += regions[i].end - regions[i].start; |
260 | 260 | if (ctx->attrs.min_nr_regions) |
261 | 261 | sz /= ctx->attrs.min_nr_regions; |
262 | | - if (sz < DAMON_MIN_REGION) |
263 | | - sz = DAMON_MIN_REGION; |
| 262 | + if (sz < DAMON_MIN_REGION_SZ) |
| 263 | + sz = DAMON_MIN_REGION_SZ; |
264 | 264 |
|
265 | 265 | /* Set the initial three regions of the target */ |
266 | 266 | for (i = 0; i < 3; i++) { |
@@ -299,7 +299,7 @@ static void damon_va_update(struct damon_ctx *ctx) |
299 | 299 | damon_for_each_target(t, ctx) { |
300 | 300 | if (damon_va_three_regions(t, three_regions)) |
301 | 301 | continue; |
302 | | - damon_set_regions(t, three_regions, 3, DAMON_MIN_REGION); |
| 302 | + damon_set_regions(t, three_regions, 3, DAMON_MIN_REGION_SZ); |
303 | 303 | } |
304 | 304 | } |
305 | 305 |
|
|
0 commit comments