From: kernel test robot <lkp@intel.com>
To: Balbir Singh <balbirs@nvidia.com>, linux-mm@kvack.org
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
"Balbir Singh" <balbirs@nvidia.com>,
"Karol Herbst" <kherbst@redhat.com>,
"Lyude Paul" <lyude@redhat.com>,
"Danilo Krummrich" <dakr@kernel.org>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Jérôme Glisse" <jglisse@redhat.com>,
"Shuah Khan" <skhan@linuxfoundation.org>,
"David Hildenbrand" <david@redhat.com>,
"Barry Song" <baohua@kernel.org>,
"Baolin Wang" <baolin.wang@linux.alibaba.com>,
"Ryan Roberts" <ryan.roberts@arm.com>,
"Matthew Wilcox" <willy@infradead.org>,
"Peter Xu" <peterx@redhat.com>, "Zi Yan" <ziy@nvidia.com>,
"Kefeng Wang" <wangkefeng.wang@huawei.com>,
"Jane Chu" <jane.chu@oracle.com>,
"Alistair Popple" <apopple@nvidia.com>,
"Donet Tom" <donettom@linux.ibm.com>,
"Ralph Campbell" <rcampbell@nvidia.com>,
"Mika Penttilä" <mpenttil@redhat.com>,
"Matthew Brost" <matthew.brost@intel.com>,
"Francois Dugast" <francois.dugast@intel.com>
Subject: Re: [v2 05/11] lib/test_hmm: test cases and support for zone device private THP
Date: Thu, 31 Jul 2025 19:17:31 +0800 [thread overview]
Message-ID: <202507311818.V6HUiudq-lkp@intel.com> (raw)
In-Reply-To: <20250730092139.3890844-6-balbirs@nvidia.com>
Hi Balbir,
kernel test robot noticed the following build warnings:
[auto build test WARNING on akpm-mm/mm-everything]
[also build test WARNING on next-20250731]
[cannot apply to akpm-mm/mm-nonmm-unstable shuah-kselftest/next shuah-kselftest/fixes linus/master v6.16]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Balbir-Singh/mm-zone_device-support-large-zone-device-private-folios/20250730-172600
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link: https://lore.kernel.org/r/20250730092139.3890844-6-balbirs%40nvidia.com
patch subject: [v2 05/11] lib/test_hmm: test cases and support for zone device private THP
config: loongarch-allyesconfig (https://download.01.org/0day-ci/archive/20250731/202507311818.V6HUiudq-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 8f09b03aebb71c154f3bbe725c29e3f47d37c26e)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250731/202507311818.V6HUiudq-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202507311818.V6HUiudq-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> lib/test_hmm.c:1111:6: warning: variable 'dst_pfns' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
1111 | if (!src_pfns)
| ^~~~~~~~~
lib/test_hmm.c:1176:8: note: uninitialized use occurs here
1176 | kfree(dst_pfns);
| ^~~~~~~~
lib/test_hmm.c:1111:2: note: remove the 'if' if its condition is always false
1111 | if (!src_pfns)
| ^~~~~~~~~~~~~~
1112 | goto free_mem;
| ~~~~~~~~~~~~~
lib/test_hmm.c:1097:25: note: initialize the variable 'dst_pfns' to silence this warning
1097 | unsigned long *dst_pfns;
| ^
| = NULL
1 warning generated.
vim +1111 lib/test_hmm.c
1084
1085 static int dmirror_migrate_to_device(struct dmirror *dmirror,
1086 struct hmm_dmirror_cmd *cmd)
1087 {
1088 unsigned long start, end, addr;
1089 unsigned long size = cmd->npages << PAGE_SHIFT;
1090 struct mm_struct *mm = dmirror->notifier.mm;
1091 struct vm_area_struct *vma;
1092 struct dmirror_bounce bounce;
1093 struct migrate_vma args = { 0 };
1094 unsigned long next;
1095 int ret;
1096 unsigned long *src_pfns;
1097 unsigned long *dst_pfns;
1098
1099 start = cmd->addr;
1100 end = start + size;
1101 if (end < start)
1102 return -EINVAL;
1103
1104 /* Since the mm is for the mirrored process, get a reference first. */
1105 if (!mmget_not_zero(mm))
1106 return -EINVAL;
1107
1108 ret = -ENOMEM;
1109 src_pfns = kvcalloc(PTRS_PER_PTE, sizeof(*src_pfns),
1110 GFP_KERNEL | __GFP_NOFAIL);
> 1111 if (!src_pfns)
1112 goto free_mem;
1113
1114 dst_pfns = kvcalloc(PTRS_PER_PTE, sizeof(*dst_pfns),
1115 GFP_KERNEL | __GFP_NOFAIL);
1116 if (!dst_pfns)
1117 goto free_mem;
1118
1119 ret = 0;
1120 mmap_read_lock(mm);
1121 for (addr = start; addr < end; addr = next) {
1122 vma = vma_lookup(mm, addr);
1123 if (!vma || !(vma->vm_flags & VM_READ)) {
1124 ret = -EINVAL;
1125 goto out;
1126 }
1127 next = min(end, addr + (PTRS_PER_PTE << PAGE_SHIFT));
1128 if (next > vma->vm_end)
1129 next = vma->vm_end;
1130
1131 args.vma = vma;
1132 args.src = src_pfns;
1133 args.dst = dst_pfns;
1134 args.start = addr;
1135 args.end = next;
1136 args.pgmap_owner = dmirror->mdevice;
1137 args.flags = MIGRATE_VMA_SELECT_SYSTEM |
1138 MIGRATE_VMA_SELECT_COMPOUND;
1139 ret = migrate_vma_setup(&args);
1140 if (ret)
1141 goto out;
1142
1143 pr_debug("Migrating from sys mem to device mem\n");
1144 dmirror_migrate_alloc_and_copy(&args, dmirror);
1145 migrate_vma_pages(&args);
1146 dmirror_migrate_finalize_and_map(&args, dmirror);
1147 migrate_vma_finalize(&args);
1148 }
1149 mmap_read_unlock(mm);
1150 mmput(mm);
1151
1152 /*
1153 * Return the migrated data for verification.
1154 * Only for pages in device zone
1155 */
1156 ret = dmirror_bounce_init(&bounce, start, size);
1157 if (ret)
1158 goto free_mem;
1159 mutex_lock(&dmirror->mutex);
1160 ret = dmirror_do_read(dmirror, start, end, &bounce);
1161 mutex_unlock(&dmirror->mutex);
1162 if (ret == 0) {
1163 if (copy_to_user(u64_to_user_ptr(cmd->ptr), bounce.ptr,
1164 bounce.size))
1165 ret = -EFAULT;
1166 }
1167 cmd->cpages = bounce.cpages;
1168 dmirror_bounce_fini(&bounce);
1169 goto free_mem;
1170
1171 out:
1172 mmap_read_unlock(mm);
1173 mmput(mm);
1174 free_mem:
1175 kfree(src_pfns);
1176 kfree(dst_pfns);
1177 return ret;
1178 }
1179
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2025-07-31 11:17 UTC|newest]
Thread overview: 71+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-30 9:21 [v2 00/11] THP support for zone device page migration Balbir Singh
2025-07-30 9:21 ` [v2 01/11] mm/zone_device: support large zone device private folios Balbir Singh
2025-07-30 9:50 ` David Hildenbrand
2025-08-04 23:43 ` Balbir Singh
2025-08-05 4:22 ` Balbir Singh
2025-08-05 10:57 ` David Hildenbrand
2025-08-05 11:01 ` Balbir Singh
2025-08-05 12:58 ` David Hildenbrand
2025-08-05 21:15 ` Matthew Brost
2025-08-06 12:19 ` Balbir Singh
2025-07-30 9:21 ` [v2 02/11] mm/thp: zone_device awareness in THP handling code Balbir Singh
2025-07-30 11:16 ` Mika Penttilä
2025-07-30 11:27 ` Zi Yan
2025-07-30 11:30 ` Zi Yan
2025-07-30 11:42 ` Mika Penttilä
2025-07-30 12:08 ` Mika Penttilä
2025-07-30 12:25 ` Zi Yan
2025-07-30 12:49 ` Mika Penttilä
2025-07-30 15:10 ` Zi Yan
2025-07-30 15:40 ` Mika Penttilä
2025-07-30 15:58 ` Zi Yan
2025-07-30 16:29 ` Mika Penttilä
2025-07-31 7:15 ` David Hildenbrand
2025-07-31 8:39 ` Balbir Singh
2025-07-31 11:26 ` Zi Yan
2025-07-31 12:32 ` David Hildenbrand
2025-07-31 13:34 ` Zi Yan
2025-07-31 19:09 ` David Hildenbrand
2025-08-01 0:49 ` Balbir Singh
2025-08-01 1:09 ` Zi Yan
2025-08-01 7:01 ` David Hildenbrand
2025-08-01 1:16 ` Mika Penttilä
2025-08-01 4:44 ` Balbir Singh
2025-08-01 5:57 ` Balbir Singh
2025-08-01 6:01 ` Mika Penttilä
2025-08-01 7:04 ` David Hildenbrand
2025-08-01 8:01 ` Balbir Singh
2025-08-01 8:46 ` David Hildenbrand
2025-08-01 11:10 ` Zi Yan
2025-08-01 12:20 ` Mika Penttilä
2025-08-01 12:28 ` Zi Yan
2025-08-02 1:17 ` Balbir Singh
2025-08-02 10:37 ` Balbir Singh
2025-08-02 12:13 ` Mika Penttilä
2025-08-04 22:46 ` Balbir Singh
2025-08-04 23:26 ` Mika Penttilä
2025-08-05 4:10 ` Balbir Singh
2025-08-05 4:24 ` Mika Penttilä
2025-08-05 5:19 ` Mika Penttilä
2025-08-05 10:27 ` Balbir Singh
2025-08-05 10:35 ` Mika Penttilä
2025-08-05 10:36 ` Balbir Singh
2025-08-05 10:46 ` Mika Penttilä
2025-07-30 20:05 ` kernel test robot
2025-07-30 9:21 ` [v2 03/11] mm/migrate_device: THP migration of zone device pages Balbir Singh
2025-07-31 16:19 ` kernel test robot
2025-07-30 9:21 ` [v2 04/11] mm/memory/fault: add support for zone device THP fault handling Balbir Singh
2025-07-30 9:21 ` [v2 05/11] lib/test_hmm: test cases and support for zone device private THP Balbir Singh
2025-07-31 11:17 ` kernel test robot [this message]
2025-07-30 9:21 ` [v2 06/11] mm/memremap: add folio_split support Balbir Singh
2025-07-30 9:21 ` [v2 07/11] mm/thp: add split during migration support Balbir Singh
2025-07-31 10:04 ` kernel test robot
2025-07-30 9:21 ` [v2 08/11] lib/test_hmm: add test case for split pages Balbir Singh
2025-07-30 9:21 ` [v2 09/11] selftests/mm/hmm-tests: new tests for zone device THP migration Balbir Singh
2025-07-30 9:21 ` [v2 10/11] gpu/drm/nouveau: add THP migration support Balbir Singh
2025-07-30 9:21 ` [v2 11/11] selftests/mm/hmm-tests: new throughput tests including THP Balbir Singh
2025-07-30 11:30 ` [v2 00/11] THP support for zone device page migration David Hildenbrand
2025-07-30 23:18 ` Alistair Popple
2025-07-31 8:41 ` Balbir Singh
2025-07-31 8:56 ` David Hildenbrand
2025-08-05 21:34 ` Matthew Brost
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202507311818.V6HUiudq-lkp@intel.com \
--to=lkp@intel.com \
--cc=airlied@gmail.com \
--cc=apopple@nvidia.com \
--cc=balbirs@nvidia.com \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=dakr@kernel.org \
--cc=david@redhat.com \
--cc=donettom@linux.ibm.com \
--cc=francois.dugast@intel.com \
--cc=jane.chu@oracle.com \
--cc=jglisse@redhat.com \
--cc=kherbst@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lyude@redhat.com \
--cc=matthew.brost@intel.com \
--cc=mpenttil@redhat.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=peterx@redhat.com \
--cc=rcampbell@nvidia.com \
--cc=ryan.roberts@arm.com \
--cc=simona@ffwll.ch \
--cc=skhan@linuxfoundation.org \
--cc=wangkefeng.wang@huawei.com \
--cc=willy@infradead.org \
--cc=ziy@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).