* [openeuler:OLK-6.6 1360/2445] mm/share_pool.c:1468:7: warning: variable 'is_hugepage' set but not used
@ 2024-01-19 12:58 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-01-19 12:58 UTC (permalink / raw)
To: kernel; +Cc: oe-kbuild-all
tree: https://gitee.com/openeuler/kernel.git OLK-6.6
head: 8d727c541fb1354691d382ff487a8c37162c75c2
commit: eaafc4a2a3fd023a99c44286895074dd5712706f [1360/2445] mm/sharepool: Implement mg_sp_unshare_kva
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20240119/202401192029.BVlaRTDd-lkp@intel.com/config)
compiler: clang version 18.0.0git (https://github.com/llvm/llvm-project 9bde5becb44ea071f5e1fa1f5d4071dc8788b18c)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240119/202401192029.BVlaRTDd-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/202401192029.BVlaRTDd-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> mm/share_pool.c:1468:7: warning: variable 'is_hugepage' set but not used [-Wunused-but-set-variable]
1468 | bool is_hugepage = true;
| ^
mm/share_pool.c:73:12: warning: unused variable 'system_group_count' [-Wunused-variable]
73 | static int system_group_count;
| ^~~~~~~~~~~~~~~~~~
mm/share_pool.c:76:19: warning: unused variable 'sp_group_idr' [-Wunused-variable]
76 | static DEFINE_IDR(sp_group_idr);
| ^~~~~~~~~~~~
include/linux/idr.h:56:37: note: expanded from macro 'DEFINE_IDR'
56 | #define DEFINE_IDR(name) struct idr name = IDR_INIT(name)
| ^~~~
mm/share_pool.c:223:20: warning: unused function 'sp_add_group_master' [-Wunused-function]
223 | static inline void sp_add_group_master(struct sp_group_master *master)
| ^~~~~~~~~~~~~~~~~~~
mm/share_pool.c:230:20: warning: unused function 'sp_del_group_master' [-Wunused-function]
230 | static inline void sp_del_group_master(struct sp_group_master *master)
| ^~~~~~~~~~~~~~~~~~~
mm/share_pool.c:237:13: warning: unused function 'meminfo_init' [-Wunused-function]
237 | static void meminfo_init(struct sp_meminfo *meminfo)
| ^~~~~~~~~~~~
mm/share_pool.c:274:20: warning: unused function 'meminfo_alloc_sum_byKB' [-Wunused-function]
274 | static inline long meminfo_alloc_sum_byKB(struct sp_meminfo *meminfo)
| ^~~~~~~~~~~~~~~~~~~~~~
mm/share_pool.c:279:20: warning: unused function 'meminfo_k2u_size' [-Wunused-function]
279 | static inline long meminfo_k2u_size(struct sp_meminfo *meminfo)
| ^~~~~~~~~~~~~~~~
mm/share_pool.c:284:25: warning: unused function 'meminfo_total_size' [-Wunused-function]
284 | static inline long long meminfo_total_size(struct sp_meminfo *meminfo)
| ^~~~~~~~~~~~~~~~~~
mm/share_pool.c:380:13: warning: unused function 'sp_mapping_detach' [-Wunused-function]
380 | static void sp_mapping_detach(struct sp_group *spg, struct sp_mapping *spm)
| ^~~~~~~~~~~~~~~~~
mm/share_pool.c:438:12: warning: unused function 'sp_group_setup_mapping_normal' [-Wunused-function]
438 | static int sp_group_setup_mapping_normal(struct mm_struct *mm, struct sp_group *spg)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mm/share_pool.c:485:13: warning: unused function 'update_mem_usage_alloc' [-Wunused-function]
485 | static void update_mem_usage_alloc(unsigned long size, bool inc,
| ^~~~~~~~~~~~~~~~~~~~~~
mm/share_pool.c:497:13: warning: unused function 'update_mem_usage_k2u' [-Wunused-function]
497 | static void update_mem_usage_k2u(unsigned long size, bool inc,
| ^~~~~~~~~~~~~~~~~~~~
mm/share_pool.c:582:22: warning: unused function 'spa_size' [-Wunused-function]
582 | static unsigned long spa_size(struct sp_area *spa)
| ^~~~~~~~
mm/share_pool.c:587:21: warning: unused function 'spa_file' [-Wunused-function]
587 | static struct file *spa_file(struct sp_area *spa)
| ^~~~~~~~
mm/share_pool.c:791:24: warning: unused function 'sp_area_alloc' [-Wunused-function]
791 | static struct sp_area *sp_area_alloc(unsigned long size, unsigned long flags,
| ^~~~~~~~~~~~~
mm/share_pool.c:944:24: warning: unused function 'sp_area_get' [-Wunused-function]
944 | static struct sp_area *sp_area_get(struct sp_group *spg,
| ^~~~~~~~~~~
mm/share_pool.c:1005:13: warning: unused function 'sp_area_put_locked' [-Wunused-function]
1005 | static void sp_area_put_locked(struct sp_area *spa)
| ^~~~~~~~~~~~~~~~~~
18 warnings generated.
vim +/is_hugepage +1468 mm/share_pool.c
1460
1461 /* No possible concurrent protection, take care when use */
1462 static int sp_unshare_kva(unsigned long kva, unsigned long size)
1463 {
1464 unsigned long addr, kva_aligned;
1465 struct page *page;
1466 unsigned long size_aligned;
1467 unsigned long step;
> 1468 bool is_hugepage = true;
1469 int ret;
1470
1471 ret = is_vmap_hugepage(kva);
1472 if (ret > 0) {
1473 kva_aligned = ALIGN_DOWN(kva, PMD_SIZE);
1474 size_aligned = ALIGN(kva + size, PMD_SIZE) - kva_aligned;
1475 step = PMD_SIZE;
1476 } else if (ret == 0) {
1477 kva_aligned = ALIGN_DOWN(kva, PAGE_SIZE);
1478 size_aligned = ALIGN(kva + size, PAGE_SIZE) - kva_aligned;
1479 step = PAGE_SIZE;
1480 is_hugepage = false;
1481 } else {
1482 pr_err_ratelimited("check vmap hugepage failed %d\n", ret);
1483 return -EINVAL;
1484 }
1485
1486 if (kva_aligned + size_aligned < kva_aligned) {
1487 pr_err_ratelimited("overflow happened in unshare kva\n");
1488 return -EINVAL;
1489 }
1490
1491 for (addr = kva_aligned; addr < (kva_aligned + size_aligned); addr += step) {
1492 page = vmalloc_to_page((void *)addr);
1493 if (page)
1494 put_page(page);
1495 else
1496 WARN(1, "vmalloc %pK to page/hugepage failed\n",
1497 (void *)addr);
1498 }
1499
1500 vunmap((void *)kva_aligned);
1501
1502 return 0;
1503 }
1504
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-01-19 12:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-19 12:58 [openeuler:OLK-6.6 1360/2445] mm/share_pool.c:1468:7: warning: variable 'is_hugepage' set but not used 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.