
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: abf385ef625e6aeb4923da42fef9ebce788f4ecf commit: 875ffd41499ee5a3512da409cbd4c2ffd32b3cfa [1510/1510] mm: Do limit checking after memory allocation for memory reliable config: arm64-randconfig-r132-20250322 (https://download.01.org/0day-ci/archive/20250322/202503222010.7VOhhbEu-lkp@i...) compiler: aarch64-linux-gcc (GCC) 13.3.0 reproduce: (https://download.01.org/0day-ci/archive/20250322/202503222010.7VOhhbEu-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/202503222010.7VOhhbEu-lkp@intel.com/ sparse warnings: (new ones prefixed by >>) mm/page_alloc.c:140:1: sparse: sparse: symbol 'pcpu_drain_mutex' was not declared. Should it be static? mm/page_alloc.c: note: in included file (through include/linux/mm.h): include/linux/gfp.h:324:27: sparse: sparse: restricted gfp_t degrades to integer include/linux/gfp.h:324:27: sparse: sparse: restricted gfp_t degrades to integer
mm/page_alloc.c:4648:27: sparse: sparse: invalid assignment: &= mm/page_alloc.c:4648:27: sparse: left side has type restricted gfp_t mm/page_alloc.c:4648:27: sparse: right side has type int mm/page_alloc.c:1489:6: warning: no previous prototype for 'set_zone_contiguous' [-Wmissing-prototypes] 1489 | void set_zone_contiguous(struct zone *zone) | ^~~~~~~~~~~~~~~~~~~ mm/page_alloc.c:1511:6: warning: no previous prototype for 'clear_zone_contiguous' [-Wmissing-prototypes] 1511 | void clear_zone_contiguous(struct zone *zone) | ^~~~~~~~~~~~~~~~~~~~~ mm/page_alloc.c: In function 'mem_init_print_info': mm/page_alloc.c:7470:27: warning: comparison between two arrays [-Warray-compare] 7470 | if (start <= pos && pos < end && size > adj) 23- | ^~ mm/page_alloc.c:7474:9: note: in expansion of macro 'adj_init_size' 7474 | adj_init_size(__init_begin, __init_end, init_data_size, | ^~~~~~~~~~~~~ mm/page_alloc.c:7470:27: note: use '&__init_begin[0] <= &_sinittext[0]' to compare the addresses 7470 | if (start <= pos && pos < end && size > adj) 29- | ^~ mm/page_alloc.c:7474:9: note: in expansion of macro 'adj_init_size' 7474 | adj_init_size(__init_begin, __init_end, init_data_size, | ^~~~~~~~~~~~~ mm/page_alloc.c:7470:41: warning: comparison between two arrays [-Warray-compare] 7470 | if (start <= pos && pos < end && size > adj) 35- | ^ mm/page_alloc.c:7474:9: note: in expansion of macro 'adj_init_size' 7474 | adj_init_size(__init_begin, __init_end, init_data_size, | ^~~~~~~~~~~~~ mm/page_alloc.c:7470:41: note: use '&_sinittext[0] < &__init_end[0]' to compare the addresses 7470 | if (start <= pos && pos < end && size > adj) 41- | ^ mm/page_alloc.c:7474:9: note: in expansion of macro 'adj_init_size' 7474 | adj_init_size(__init_begin, __init_end, init_data_size, | ^~~~~~~~~~~~~ mm/page_alloc.c:7470:27: warning: comparison between two arrays [-Warray-compare] 7470 | if (start <= pos && pos < end && size > adj) 47- | ^~ mm/page_alloc.c:7476:9: note: in expansion of macro 'adj_init_size' 7476 | adj_init_size(_stext, _etext, codesize, _sinittext, init_code_size); | ^~~~~~~~~~~~~ mm/page_alloc.c:7470:27: note: use '&_stext[0] <= &_sinittext[0]' to compare the addresses 7470 | if (start <= pos && pos < end && size > adj) 53- | ^~ mm/page_alloc.c:7476:9: note: in expansion of macro 'adj_init_size' 7476 | adj_init_size(_stext, _etext, codesize, _sinittext, init_code_size); | ^~~~~~~~~~~~~ mm/page_alloc.c:7470:41: warning: comparison between two arrays [-Warray-compare] 7470 | if (start <= pos && pos < end && size > adj) 59- | ^ mm/page_alloc.c:7476:9: note: in expansion of macro 'adj_init_size' 7476 | adj_init_size(_stext, _etext, codesize, _sinittext, init_code_size); | ^~~~~~~~~~~~~ mm/page_alloc.c:7470:41: note: use '&_sinittext[0] < &_etext[0]' to compare the addresses 7470 | if (start <= pos && pos < end && size > adj) 65- | ^ mm/page_alloc.c:7476:9: note: in expansion of macro 'adj_init_size' 7476 | adj_init_size(_stext, _etext, codesize, _sinittext, init_code_size); | ^~~~~~~~~~~~~ mm/page_alloc.c:7470:27: warning: comparison between two arrays [-Warray-compare] 7470 | if (start <= pos && pos < end && size > adj) 71- | ^~ mm/page_alloc.c:7477:9: note: in expansion of macro 'adj_init_size' 7477 | adj_init_size(_sdata, _edata, datasize, __init_begin, init_data_size); | ^~~~~~~~~~~~~ mm/page_alloc.c:7470:27: note: use '&_sdata[0] <= &__init_begin[0]' to compare the addresses 7470 | if (start <= pos && pos < end && size > adj) 77- | ^~ mm/page_alloc.c:7477:9: note: in expansion of macro 'adj_init_size' 7477 | adj_init_size(_sdata, _edata, datasize, __init_begin, init_data_size); | ^~~~~~~~~~~~~ mm/page_alloc.c:7470:41: warning: comparison between two arrays [-Warray-compare] 7470 | if (start <= pos && pos < end && size > adj) 83- | ^ mm/page_alloc.c:7477:9: note: in expansion of macro 'adj_init_size' 7477 | adj_init_size(_sdata, _edata, datasize, __init_begin, init_data_size); | ^~~~~~~~~~~~~ mm/page_alloc.c:7470:41: note: use '&__init_begin[0] < &_edata[0]' to compare the addresses 7470 | if (start <= pos && pos < end && size > adj) 89- | ^ mm/page_alloc.c:7477:9: note: in expansion of macro 'adj_init_size' 7477 | adj_init_size(_sdata, _edata, datasize, __init_begin, init_data_size); | ^~~~~~~~~~~~~ mm/page_alloc.c:7470:27: warning: comparison between two arrays [-Warray-compare] 7470 | if (start <= pos && pos < end && size > adj) 95- | ^~ mm/page_alloc.c:7478:9: note: in expansion of macro 'adj_init_size' 7478 | adj_init_size(_stext, _etext, codesize, __start_rodata, rosize); | ^~~~~~~~~~~~~ mm/page_alloc.c:7470:27: note: use '&_stext[0] <= &__start_rodata[0]' to compare the addresses 7470 | if (start <= pos && pos < end && size > adj) 101- | ^~ mm/page_alloc.c:7478:9: note: in expansion of macro 'adj_init_size' 7478 | adj_init_size(_stext, _etext, codesize, __start_rodata, rosize); | ^~~~~~~~~~~~~ mm/page_alloc.c:7470:41: warning: comparison between two arrays [-Warray-compare] 7470 | if (start <= pos && pos < end && size > adj) 107- | ^ mm/page_alloc.c:7478:9: note: in expansion of macro 'adj_init_size' 7478 | adj_init_size(_stext, _etext, codesize, __start_rodata, rosize); | ^~~~~~~~~~~~~ mm/page_alloc.c:7470:41: note: use '&__start_rodata[0] < &_etext[0]' to compare the addresses
vim +4648 mm/page_alloc.c 4606 4607 /* 4608 * return true means memory allocation need retry and flag ___GFP_RELIABILITY 4609 * must be cleared. 4610 */ 4611 static inline bool check_after_alloc(gfp_t *gfp_mask, unsigned int order, 4612 int preferred_nid, nodemask_t *nodemask, 4613 struct page **_page) 4614 { 4615 if (!mem_reliable_is_enabled()) 4616 return false; 4617 4618 if (!(*gfp_mask & ___GFP_RELIABILITY)) 4619 return false; 4620 4621 if (!*_page) 4622 goto out_retry; 4623 4624 if (*gfp_mask & __GFP_NOFAIL) 4625 goto out; 4626 4627 /* check water mark, reserver mirrored mem for kernel */ 4628 if (!mem_reliable_watermark_ok(1 << order)) 4629 goto out_free_page; 4630 4631 /* percpu counter is not initialized, ignore limit check */ 4632 if (!mem_reliable_counter_initialized()) 4633 goto out; 4634 4635 /* spcial user task, systemd is limited by task_reliable_limit */ 4636 if (((current->flags & PF_RELIABLE) || is_global_init(current)) && 4637 !reliable_mem_limit_check(1 << order)) 4638 goto out_free_page; 4639 4640 goto out; 4641 4642 out_free_page: 4643 __free_pages(*_page, order); 4644 *_page = NULL; 4645 4646 out_retry: 4647 if (reliable_allow_fb_enabled() || is_global_init(current)) {
4648 *gfp_mask &= ~___GFP_RELIABILITY; 4649 return true; 4650 } 4651 4652 if (*gfp_mask & (__GFP_NORETRY | __GFP_RETRY_MAYFAIL | __GFP_THISNODE)) 4653 goto out; 4654 4655 /* Coredumps can quickly deplete all memory reserves */ 4656 if (current->flags & PF_DUMPCORE) 4657 goto out; 4658 /* The OOM killer will not help higher order allocs */ 4659 if (order > PAGE_ALLOC_COSTLY_ORDER) 4660 goto out; 4661 4662 /* oom here */ 4663 mem_reliable_out_of_memory(*gfp_mask, order, preferred_nid, 4664 nodemask); 4665 out: 4666 return false; 4667 } 4668
-- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki