Lines Matching +full:- +full:20
1 /* SPDX-License-Identifier: GPL-2.0 */
20 int i, ret = -ENOMEM;
28 mas_set_range(&mas, vmas[i].vm_start, vmas[i].vm_end - 1);
47 * heap and the mmap()-ed regions, and 2) the mmap()-ed regions and stack.
57 * For example, suppose virtual address ranges of 10-20, 20-25, 200-210,
58 * 210-220, 300-305, and 307-330 (Other comments represent this mappings in
59 * more short form: 10-20-25, 200-210-220, 300-305, 307-330) of a process are
61 * and end with 305. The process also has three unmapped areas, 25-200,
62 * 220-300, and 305-307. Among those, 25-200 and 220-300 are the biggest two
63 * unmapped areas, and thus it should be converted to three regions of 10-25,
64 * 200-220, and 300-330.
70 /* 10-20-25, 200-210-220, 300-305, 307-330 */
72 (struct vm_area_struct) {.vm_start = 10, .vm_end = 20},
73 (struct vm_area_struct) {.vm_start = 20, .vm_end = 25},
148 KUNIT_EXPECT_EQ(test, r->ar.start, expected[i * 2]);
149 KUNIT_EXPECT_EQ(test, r->ar.end, expected[i * 2 + 1]);
157 * slightly changed. Target regions should adjust their boundary (10-20-30,
158 * 50-55, 70-80, 90-100) to fit with the new big regions or remove target
159 * regions (57-79) that now out of the three regions.
163 /* 10-20-30, 50-55-57-59, 70-80-90-100 */
164 unsigned long regions[] = {10, 20, 20, 30, 50, 55, 55, 57, 57, 59,
166 /* 5-27, 45-55, 73-104 */
171 /* 5-20-27, 45-55, 73-80-90-104 */
172 unsigned long expected[] = {5, 20, 20, 27, 45, 55,
181 * now require two target regions (50-55, 57-59) to be removed.
185 /* 10-20-30, 50-55-57-59, 70-80-90-100 */
186 unsigned long regions[] = {10, 20, 20, 30, 50, 55, 55, 57, 57, 59,
188 /* 5-27, 56-57, 65-104 */
193 /* 5-20-27, 56-57, 65-80-90-104 */
194 unsigned long expected[] = {5, 20, 20, 27, 56, 57,
203 * different area (50-59 -> 61-63). The target regions which were in the old
204 * second big region (50-55-57-59) should be removed and new target region
205 * covering the second big region (61-63) should be created.
209 /* 10-20-30, 50-55-57-59, 70-80-90-100 */
210 unsigned long regions[] = {10, 20, 20, 30, 50, 55, 55, 57, 57, 59,
212 /* 5-27, 61-63, 65-104 */
217 /* 5-20-27, 61-63, 65-80-90-104 */
218 unsigned long expected[] = {5, 20, 20, 27, 61, 63,
226 * Test another big change. Both of the second and third big regions (50-59
227 * and 70-100) has totally freed and mapped to different area (30-32 and
228 * 65-68). The target regions which were in the old second and third big
234 /* 10-20-30, 50-55-57-59, 70-80-90-100 */
235 unsigned long regions[] = {10, 20, 20, 30, 50, 55, 55, 57, 57, 59,
237 /* 5-7, 30-32, 65-68 */
242 /* expect 5-7, 30-32, 65-68 */
257 damon_va_evenly_split_region(t, r, nr_pieces), -EINVAL);
261 KUNIT_EXPECT_EQ(test, r->ar.start, start);
262 KUNIT_EXPECT_EQ(test, r->ar.end, end);
273 unsigned long expected_width = (end - start) / nr_pieces;
282 if (i == nr_pieces - 1) {
284 r->ar.start, start + i * expected_width);
285 KUNIT_EXPECT_EQ(test, r->ar.end, end);
289 r->ar.start, start + i++ * expected_width);
290 KUNIT_EXPECT_EQ(test, r->ar.end, start + i * expected_width);
298 -EINVAL);
319 .name = "damon-operations",