tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: b1d54e6f06c518a52f83edade0da2b959e1c9a4e commit: 0bc0d0d57edacd59ebe38d05ad9c4b2bc185aa51 [20217/23779] dhugetlb: backport dynamic hugetlb feature config: x86_64-randconfig-123-20240926 (https://download.01.org/0day-ci/archive/20240927/202409270316.mecxJZQM-lkp@i...) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240927/202409270316.mecxJZQM-lkp@i...)
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/202409270316.mecxJZQM-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
mm/hugetlb.c:1370:6: sparse: sparse: symbol 'free_huge_page_to_dhugetlb_pool' was not declared. Should it be static?
mm/hugetlb.c:4438:58: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected void [noderef] asn:1 * @@ got void *buffer @@ mm/hugetlb.c:4438:58: sparse: expected void [noderef] asn:1 * mm/hugetlb.c:4438:58: sparse: got void *buffer mm/hugetlb.c:4452:60: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected void *buffer @@ got void [noderef] asn:1 *buffer @@ mm/hugetlb.c:4452:60: sparse: expected void *buffer mm/hugetlb.c:4452:60: sparse: got void [noderef] asn:1 *buffer mm/hugetlb.c:4510:60: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected void *buffer @@ got void [noderef] asn:1 *buffer @@ mm/hugetlb.c:4510:60: sparse: expected void *buffer mm/hugetlb.c:4510:60: sparse: got void [noderef] asn:1 *buffer mm/hugetlb.c:2018:20: sparse: sparse: context imbalance in 'gather_surplus_pages' - unexpected unlock mm/hugetlb.c:5168:17: sparse: sparse: context imbalance in 'hugetlb_cow' - unexpected unlock mm/hugetlb.c:5881:25: sparse: sparse: context imbalance in 'follow_hugetlb_page' - different lock contexts for basic block mm/hugetlb.c:1370:6: warning: no previous prototype for 'free_huge_page_to_dhugetlb_pool' [-Wmissing-prototypes] 1370 | void free_huge_page_to_dhugetlb_pool(struct page *page, bool restore_reserve) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from mm/hugetlb.c:14: include/linux/mempolicy.h:329:13: warning: '__do_mbind' defined but not used [-Wunused-function] 329 | static long __do_mbind(unsigned long start, unsigned long len, | ^~~~~~~~~~
vim +/free_huge_page_to_dhugetlb_pool +1370 mm/hugetlb.c
1324 1325 #ifdef CONFIG_DYNAMIC_HUGETLB 1326 static void free_huge_page_to_dhugetlb_pool(struct page *page, 1327 bool restore_reserve) 1328 { 1329 struct hstate *h = page_hstate(page); 1330 struct dhugetlb_pool *hpool; 1331 1332 hpool = get_dhugetlb_pool_from_dhugetlb_pagelist(page); 1333 if (unlikely(!hpool)) { 1334 pr_err("dhugetlb: free error: get hpool failed\n"); 1335 return; 1336 } 1337 1338 spin_lock(&hpool->lock); 1339 ClearPagePool(page); 1340 set_compound_page_dtor(page, NULL_COMPOUND_DTOR); 1341 if (!hstate_is_gigantic(h)) { 1342 list_add(&page->lru, &hpool->dhugetlb_2M_freelists); 1343 hpool->free_reserved_2M++; 1344 hpool->used_2M--; 1345 if (restore_reserve) { 1346 hpool->mmap_reserved_2M++; 1347 trace_dhugetlb_acct_memory(hpool, 1348 hpool->mmap_reserved_2M, 1349 DHUGETLB_RESV_2M); 1350 } 1351 trace_dhugetlb_alloc_free(hpool, page, hpool->free_reserved_2M, 1352 DHUGETLB_FREE_2M); 1353 } else { 1354 list_add(&page->lru, &hpool->dhugetlb_1G_freelists); 1355 hpool->free_reserved_1G++; 1356 hpool->used_1G--; 1357 if (restore_reserve) { 1358 hpool->mmap_reserved_1G++; 1359 trace_dhugetlb_acct_memory(hpool, 1360 hpool->mmap_reserved_1G, 1361 DHUGETLB_RESV_1G); 1362 } 1363 trace_dhugetlb_alloc_free(hpool, page, hpool->free_reserved_1G, 1364 DHUGETLB_FREE_1G); 1365 } 1366 spin_unlock(&hpool->lock); 1367 dhugetlb_pool_put(hpool); 1368 } 1369 #else
1370 void free_huge_page_to_dhugetlb_pool(struct page *page, bool restore_reserve)
1371 { 1372 } 1373 #endif 1374