From: kernel test robot <lkp@intel.com>
To: kernel@openeuler.org, Yang Yingliang <yangyingliang@huawei.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [openeuler:openEuler-1.0-LTS 1544/1544] mm/share_pool.c:2435:30: error: implicit declaration of function 'huge_pte_none'; did you mean 'huge_pte_lock'?
Date: Wed, 2 Apr 2025 00:43:10 +0800 [thread overview]
Message-ID: <202504020010.TmMNnpc4-lkp@intel.com> (raw)
Hi Weilong,
FYI, the error/warning still remains.
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS
head: 54ad6c4559d2bcbb5d7a03050b2f417a326a1ce2
commit: 4e851c2bb53e45d92e266c65cf0c203624e74710 [1544/1544] ascend: share_pool: Use sharepool_no_page to alloc hugepage
config: arm64-randconfig-r131-20250401 (https://download.01.org/0day-ci/archive/20250402/202504020010.TmMNnpc4-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 11.5.0
reproduce: (https://download.01.org/0day-ci/archive/20250402/202504020010.TmMNnpc4-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/202504020010.TmMNnpc4-lkp@intel.com/
All errors (new ones prefixed by >>):
mm/share_pool.c:58:5: sparse: sparse: symbol 'enable_mdc_default_group' was not declared. Should it be static?
mm/share_pool.c:1685:21: sparse: sparse: undefined identifier 'huge_ptep_get'
mm/share_pool.c:1685:34: sparse: sparse: invalid initializer
mm/share_pool.c:2435:30: sparse: sparse: undefined identifier 'huge_pte_none'
mm/share_pool.c:2448:23: sparse: sparse: undefined identifier 'huge_add_to_page_cache'
mm/share_pool.c:2464:14: sparse: sparse: undefined identifier 'huge_pte_none'
mm/share_pool.c:2470:9: sparse: sparse: undefined identifier 'set_huge_pte_at'
mm/share_pool.c:2472:9: sparse: sparse: undefined identifier 'hugetlb_count_add'
mm/share_pool.c:2508:24: sparse: sparse: undefined identifier 'hugetlb_alloc_hugepage'
mm/share_pool.c: In function 'sp_hugetlb_entry':
mm/share_pool.c:1685:21: error: implicit declaration of function 'huge_ptep_get' [-Werror=implicit-function-declaration]
1685 | pte_t pte = huge_ptep_get(ptep);
| ^~~~~~~~~~~~~
mm/share_pool.c:1685:21: error: invalid initializer
mm/share_pool.c: In function 'sharepool_no_page':
>> mm/share_pool.c:2435:30: error: implicit declaration of function 'huge_pte_none'; did you mean 'huge_pte_lock'? [-Werror=implicit-function-declaration]
2435 | if (!huge_pte_none(huge_ptep_get(ptep))) {
| ^~~~~~~~~~~~~
| huge_pte_lock
>> mm/share_pool.c:2448:23: error: implicit declaration of function 'huge_add_to_page_cache'; did you mean 'add_to_page_cache'? [-Werror=implicit-function-declaration]
2448 | err = huge_add_to_page_cache(page, mapping, idx);
| ^~~~~~~~~~~~~~~~~~~~~~
| add_to_page_cache
>> mm/share_pool.c:2470:9: error: implicit declaration of function 'set_huge_pte_at'; did you mean 'set_huge_swap_pte_at'? [-Werror=implicit-function-declaration]
2470 | set_huge_pte_at(mm, haddr, ptep, new_pte);
| ^~~~~~~~~~~~~~~
| set_huge_swap_pte_at
>> mm/share_pool.c:2472:9: error: implicit declaration of function 'hugetlb_count_add'; did you mean 'hugetlb_count_sub'? [-Werror=implicit-function-declaration]
2472 | hugetlb_count_add(pages_per_huge_page(h), mm);
| ^~~~~~~~~~~~~~~~~
| hugetlb_count_sub
mm/share_pool.c: In function 'sp_alloc_pages':
mm/share_pool.c:2508:24: error: implicit declaration of function 'hugetlb_alloc_hugepage'; did you mean 'vmalloc_hugepage'? [-Werror=implicit-function-declaration]
2508 | return hugetlb_alloc_hugepage(NUMA_NO_NODE, HUGETLB_ALLOC_NONE);
| ^~~~~~~~~~~~~~~~~~~~~~
| vmalloc_hugepage
mm/share_pool.c:2508:61: error: 'HUGETLB_ALLOC_NONE' undeclared (first use in this function); did you mean 'HUGETLB_ANON_FILE'?
2508 | return hugetlb_alloc_hugepage(NUMA_NO_NODE, HUGETLB_ALLOC_NONE);
| ^~~~~~~~~~~~~~~~~~
| HUGETLB_ANON_FILE
mm/share_pool.c:2508:61: note: each undeclared identifier is reported only once for each function it appears in
mm/share_pool.c:2511:1: warning: control reaches end of non-void function [-Wreturn-type]
2511 | }
| ^
cc1: some warnings being treated as errors
vim +2435 mm/share_pool.c
2403
2404 vm_fault_t sharepool_no_page(struct mm_struct *mm,
2405 struct vm_area_struct *vma,
2406 struct address_space *mapping, pgoff_t idx,
2407 unsigned long address, pte_t *ptep, unsigned int flags)
2408 {
2409 struct hstate *h = hstate_vma(vma);
2410 vm_fault_t ret = VM_FAULT_SIGBUS;
2411 unsigned long size;
2412 struct page *page;
2413 pte_t new_pte;
2414 spinlock_t *ptl;
2415 unsigned long haddr = address & huge_page_mask(h);
2416 bool new_page = false;
2417 int err;
2418
2419 retry:
2420 page = find_lock_page(mapping, idx);
2421 if (!page) {
2422 size = i_size_read(mapping->host) >> huge_page_shift(h);
2423 if (idx >= size)
2424 goto out;
2425
2426 page = alloc_huge_page(vma, haddr, 0);
2427 if (IS_ERR(page)) {
2428 page = alloc_huge_page_node(hstate_file(vma->vm_file),
2429 numa_mem_id());
2430 if (!page)
2431 page = ERR_PTR(-ENOMEM);
2432 }
2433 if (IS_ERR(page)) {
2434 ptl = huge_pte_lock(h, mm, ptep);
> 2435 if (!huge_pte_none(huge_ptep_get(ptep))) {
2436 ret = 0;
2437 spin_unlock(ptl);
2438 goto out;
2439 }
2440 spin_unlock(ptl);
2441 ret = vmf_error(PTR_ERR(page));
2442 goto out;
2443 }
2444 __SetPageUptodate(page);
2445 new_page = true;
2446
2447 /* sharepool pages are all shared */
> 2448 err = huge_add_to_page_cache(page, mapping, idx);
2449 if (err) {
2450 put_page(page);
2451 if (err == -EEXIST)
2452 goto retry;
2453 goto out;
2454 }
2455 }
2456
2457
2458 ptl = huge_pte_lock(h, mm, ptep);
2459 size = i_size_read(mapping->host) >> huge_page_shift(h);
2460 if (idx >= size)
2461 goto backout;
2462
2463 ret = 0;
2464 if (!huge_pte_none(huge_ptep_get(ptep)))
2465 goto backout;
2466
2467 page_dup_rmap(page, true);
2468 new_pte = make_huge_pte(vma, page, ((vma->vm_flags & VM_WRITE)
2469 && (vma->vm_flags & VM_SHARED)));
> 2470 set_huge_pte_at(mm, haddr, ptep, new_pte);
2471
> 2472 hugetlb_count_add(pages_per_huge_page(h), mm);
2473
2474 spin_unlock(ptl);
2475
2476 if (new_page) {
2477 SetPagePrivate(&page[1]);
2478 }
2479
2480 unlock_page(page);
2481 out:
2482 return ret;
2483
2484 backout:
2485 spin_unlock(ptl);
2486 unlock_page(page);
2487 put_page(page);
2488 goto out;
2489 }
2490 EXPORT_SYMBOL(sharepool_no_page);
2491
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2025-04-01 16:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202504020010.TmMNnpc4-lkp@intel.com \
--to=lkp@intel.com \
--cc=kernel@openeuler.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=yangyingliang@huawei.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 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.