* mm/damon/vaddr.c:158 __damon_va_three_regions() error: uninitialized symbol 'start'.
@ 2022-06-07 6:58 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-06-07 6:58 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 6316 bytes --]
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: SeongJae Park <sjpark@amazon.de>
CC: Leonard Foerster <foersleo@amazon.de>
CC: Fernand Sieber <sieberf@amazon.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: e71e60cd74df9386c3f684c54888f2367050b831
commit: 3f49584b262cf8f42b25f4c1ad9f5bfd3bdc1bca mm/damon: implement primitives for the virtual memory address spaces
date: 9 months ago
:::::: branch date: 6 hours ago
:::::: commit date: 9 months ago
config: x86_64-rhel-8.3-kselftests (https://download.01.org/0day-ci/archive/20220607/202206071442.joHmyadx-lkp(a)intel.com/config)
compiler: gcc-11 (Debian 11.3.0-1) 11.3.0
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
mm/damon/vaddr.c:158 __damon_va_three_regions() error: uninitialized symbol 'start'.
vim +/start +158 mm/damon/vaddr.c
3f49584b262cf8f SeongJae Park 2021-09-07 109
3f49584b262cf8f SeongJae Park 2021-09-07 110 /*
3f49584b262cf8f SeongJae Park 2021-09-07 111 * Find three regions separated by two biggest unmapped regions
3f49584b262cf8f SeongJae Park 2021-09-07 112 *
3f49584b262cf8f SeongJae Park 2021-09-07 113 * vma the head vma of the target address space
3f49584b262cf8f SeongJae Park 2021-09-07 114 * regions an array of three address ranges that results will be saved
3f49584b262cf8f SeongJae Park 2021-09-07 115 *
3f49584b262cf8f SeongJae Park 2021-09-07 116 * This function receives an address space and finds three regions in it which
3f49584b262cf8f SeongJae Park 2021-09-07 117 * separated by the two biggest unmapped regions in the space. Please refer to
3f49584b262cf8f SeongJae Park 2021-09-07 118 * below comments of '__damon_va_init_regions()' function to know why this is
3f49584b262cf8f SeongJae Park 2021-09-07 119 * necessary.
3f49584b262cf8f SeongJae Park 2021-09-07 120 *
3f49584b262cf8f SeongJae Park 2021-09-07 121 * Returns 0 if success, or negative error code otherwise.
3f49584b262cf8f SeongJae Park 2021-09-07 122 */
3f49584b262cf8f SeongJae Park 2021-09-07 123 static int __damon_va_three_regions(struct vm_area_struct *vma,
3f49584b262cf8f SeongJae Park 2021-09-07 124 struct damon_addr_range regions[3])
3f49584b262cf8f SeongJae Park 2021-09-07 125 {
3f49584b262cf8f SeongJae Park 2021-09-07 126 struct damon_addr_range gap = {0}, first_gap = {0}, second_gap = {0};
3f49584b262cf8f SeongJae Park 2021-09-07 127 struct vm_area_struct *last_vma = NULL;
3f49584b262cf8f SeongJae Park 2021-09-07 128 unsigned long start = 0;
3f49584b262cf8f SeongJae Park 2021-09-07 129 struct rb_root rbroot;
3f49584b262cf8f SeongJae Park 2021-09-07 130
3f49584b262cf8f SeongJae Park 2021-09-07 131 /* Find two biggest gaps so that first_gap > second_gap > others */
3f49584b262cf8f SeongJae Park 2021-09-07 132 for (; vma; vma = vma->vm_next) {
3f49584b262cf8f SeongJae Park 2021-09-07 133 if (!last_vma) {
3f49584b262cf8f SeongJae Park 2021-09-07 134 start = vma->vm_start;
3f49584b262cf8f SeongJae Park 2021-09-07 135 goto next;
3f49584b262cf8f SeongJae Park 2021-09-07 136 }
3f49584b262cf8f SeongJae Park 2021-09-07 137
3f49584b262cf8f SeongJae Park 2021-09-07 138 if (vma->rb_subtree_gap <= sz_range(&second_gap)) {
3f49584b262cf8f SeongJae Park 2021-09-07 139 rbroot.rb_node = &vma->vm_rb;
3f49584b262cf8f SeongJae Park 2021-09-07 140 vma = rb_entry(rb_last(&rbroot),
3f49584b262cf8f SeongJae Park 2021-09-07 141 struct vm_area_struct, vm_rb);
3f49584b262cf8f SeongJae Park 2021-09-07 142 goto next;
3f49584b262cf8f SeongJae Park 2021-09-07 143 }
3f49584b262cf8f SeongJae Park 2021-09-07 144
3f49584b262cf8f SeongJae Park 2021-09-07 145 gap.start = last_vma->vm_end;
3f49584b262cf8f SeongJae Park 2021-09-07 146 gap.end = vma->vm_start;
3f49584b262cf8f SeongJae Park 2021-09-07 147 if (sz_range(&gap) > sz_range(&second_gap)) {
3f49584b262cf8f SeongJae Park 2021-09-07 148 swap_ranges(&gap, &second_gap);
3f49584b262cf8f SeongJae Park 2021-09-07 149 if (sz_range(&second_gap) > sz_range(&first_gap))
3f49584b262cf8f SeongJae Park 2021-09-07 150 swap_ranges(&second_gap, &first_gap);
3f49584b262cf8f SeongJae Park 2021-09-07 151 }
3f49584b262cf8f SeongJae Park 2021-09-07 152 next:
3f49584b262cf8f SeongJae Park 2021-09-07 153 last_vma = vma;
3f49584b262cf8f SeongJae Park 2021-09-07 154 }
3f49584b262cf8f SeongJae Park 2021-09-07 155
3f49584b262cf8f SeongJae Park 2021-09-07 156 if (!sz_range(&second_gap) || !sz_range(&first_gap))
3f49584b262cf8f SeongJae Park 2021-09-07 157 return -EINVAL;
3f49584b262cf8f SeongJae Park 2021-09-07 @158
3f49584b262cf8f SeongJae Park 2021-09-07 159 /* Sort the two biggest gaps by address */
3f49584b262cf8f SeongJae Park 2021-09-07 160 if (first_gap.start > second_gap.start)
3f49584b262cf8f SeongJae Park 2021-09-07 161 swap_ranges(&first_gap, &second_gap);
3f49584b262cf8f SeongJae Park 2021-09-07 162
3f49584b262cf8f SeongJae Park 2021-09-07 163 /* Store the result */
3f49584b262cf8f SeongJae Park 2021-09-07 164 regions[0].start = ALIGN(start, DAMON_MIN_REGION);
3f49584b262cf8f SeongJae Park 2021-09-07 165 regions[0].end = ALIGN(first_gap.start, DAMON_MIN_REGION);
3f49584b262cf8f SeongJae Park 2021-09-07 166 regions[1].start = ALIGN(first_gap.end, DAMON_MIN_REGION);
3f49584b262cf8f SeongJae Park 2021-09-07 167 regions[1].end = ALIGN(second_gap.start, DAMON_MIN_REGION);
3f49584b262cf8f SeongJae Park 2021-09-07 168 regions[2].start = ALIGN(second_gap.end, DAMON_MIN_REGION);
3f49584b262cf8f SeongJae Park 2021-09-07 169 regions[2].end = ALIGN(last_vma->vm_end, DAMON_MIN_REGION);
3f49584b262cf8f SeongJae Park 2021-09-07 170
3f49584b262cf8f SeongJae Park 2021-09-07 171 return 0;
3f49584b262cf8f SeongJae Park 2021-09-07 172 }
3f49584b262cf8f SeongJae Park 2021-09-07 173
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-06-07 6:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-07 6:58 mm/damon/vaddr.c:158 __damon_va_three_regions() error: uninitialized symbol 'start' kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.