From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: mm/migrate.c:543 migration_entry_wait_huge() warn: inconsistent returns 'ptl'.
Date: Fri, 17 Apr 2026 03:50:54 +0800 [thread overview]
Message-ID: <202604170344.KEXYFXqz-lkp@intel.com> (raw)
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
Hi Lorenzo,
FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 1d51b370a0f8f642f4fc84c795fbedac0fcdbbd2
commit: 03bfbc3ad6e496fb576ca9ace08211943232fdf9 mm: remove is_hugetlb_entry_[migration, hwpoisoned]()
date: 5 months ago
:::::: branch date: 17 hours ago
:::::: commit date: 5 months ago
config: x86_64-randconfig-r072-20260416 (https://download.01.org/0day-ci/archive/20260417/202604170344.KEXYFXqz-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
smatch: v0.5.0-9007-gcf3ea02b
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
| Fixes: 03bfbc3ad6e4 ("mm: remove is_hugetlb_entry_[migration, hwpoisoned]()")
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202604170344.KEXYFXqz-lkp@intel.com/
smatch warnings:
mm/migrate.c:543 migration_entry_wait_huge() warn: inconsistent returns 'ptl'.
vim +/ptl +543 mm/migrate.c
30dad30922ccc7 Naoya Horiguchi 2013-06-12 507
ad1ac596e8a8c4 Miaohe Lin 2022-05-30 508 #ifdef CONFIG_HUGETLB_PAGE
fcd48540d18887 Peter Xu 2022-12-16 509 /*
fcd48540d18887 Peter Xu 2022-12-16 510 * The vma read lock must be held upon entry. Holding that lock prevents either
fcd48540d18887 Peter Xu 2022-12-16 511 * the pte or the ptl from being freed.
fcd48540d18887 Peter Xu 2022-12-16 512 *
fcd48540d18887 Peter Xu 2022-12-16 513 * This function will release the vma lock before returning.
fcd48540d18887 Peter Xu 2022-12-16 514 */
e6c0c03245b14d Christophe Leroy 2024-07-02 515 void migration_entry_wait_huge(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep)
ad1ac596e8a8c4 Miaohe Lin 2022-05-30 516 {
0cb8fd4d14165a Hugh Dickins 2023-06-08 517 spinlock_t *ptl = huge_pte_lockptr(hstate_vma(vma), vma->vm_mm, ptep);
03bfbc3ad6e496 Lorenzo Stoakes 2025-11-10 518 softleaf_t entry;
ad1ac596e8a8c4 Miaohe Lin 2022-05-30 519 pte_t pte;
ad1ac596e8a8c4 Miaohe Lin 2022-05-30 520
fcd48540d18887 Peter Xu 2022-12-16 521 hugetlb_vma_assert_locked(vma);
ad1ac596e8a8c4 Miaohe Lin 2022-05-30 522 spin_lock(ptl);
e6c0c03245b14d Christophe Leroy 2024-07-02 523 pte = huge_ptep_get(vma->vm_mm, addr, ptep);
ad1ac596e8a8c4 Miaohe Lin 2022-05-30 524
03bfbc3ad6e496 Lorenzo Stoakes 2025-11-10 525 if (huge_pte_none(pte))
03bfbc3ad6e496 Lorenzo Stoakes 2025-11-10 526 goto fail;
03bfbc3ad6e496 Lorenzo Stoakes 2025-11-10 527
03bfbc3ad6e496 Lorenzo Stoakes 2025-11-10 528 entry = softleaf_from_pte(pte);
03bfbc3ad6e496 Lorenzo Stoakes 2025-11-10 529 if (softleaf_is_migration(entry)) {
fcd48540d18887 Peter Xu 2022-12-16 530 /*
fcd48540d18887 Peter Xu 2022-12-16 531 * If migration entry existed, safe to release vma lock
fcd48540d18887 Peter Xu 2022-12-16 532 * here because the pgtable page won't be freed without the
fcd48540d18887 Peter Xu 2022-12-16 533 * pgtable lock released. See comment right above pgtable
fcd48540d18887 Peter Xu 2022-12-16 534 * lock release in migration_entry_wait_on_locked().
fcd48540d18887 Peter Xu 2022-12-16 535 */
fcd48540d18887 Peter Xu 2022-12-16 536 hugetlb_vma_unlock_read(vma);
0cb8fd4d14165a Hugh Dickins 2023-06-08 537 migration_entry_wait_on_locked(pte_to_swp_entry(pte), ptl);
03bfbc3ad6e496 Lorenzo Stoakes 2025-11-10 538 return;
fcd48540d18887 Peter Xu 2022-12-16 539 }
03bfbc3ad6e496 Lorenzo Stoakes 2025-11-10 540
03bfbc3ad6e496 Lorenzo Stoakes 2025-11-10 541 fail:
03bfbc3ad6e496 Lorenzo Stoakes 2025-11-10 542 spin_unlock(ptl);
03bfbc3ad6e496 Lorenzo Stoakes 2025-11-10 @543 hugetlb_vma_unlock_read(vma);
30dad30922ccc7 Naoya Horiguchi 2013-06-12 544 }
ad1ac596e8a8c4 Miaohe Lin 2022-05-30 545 #endif
30dad30922ccc7 Naoya Horiguchi 2013-06-12 546
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-04-16 19:51 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=202604170344.KEXYFXqz-lkp@intel.com \
--to=lkp@intel.com \
--cc=error27@gmail.com \
--cc=oe-kbuild@lists.linux.dev \
/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.