From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [davidhildenbrand:b4/fixes_core 13/48] mm/huge_memory.c:1506 do_huge_pmd_device_private() warn: inconsistent returns 'ptl'.
Date: Thu, 29 Oct 2026 06:24:28 +0100 [thread overview]
Message-ID: <202610290652.IGpu3Ps1-lkp@intel.com> (raw)
Unfiltered warning: this smatch report is sent as-is and has not been
reviewed for false positives, so please treat it with due skepticism.
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Josef Bacik <josef@toxicpanda.com>
CC: "David Hildenbrand (Arm)" <david@kernel.org>
CC: Zi Yan <ziy@nvidia.com>
tree: https://github.com/davidhildenbrand/linux b4/fixes_core
head: 5a5358c39c5c72f054c891685f8479c06c5f42d0
commit: f3f48b7b516dd004913e7f6870651f4cb0bfeff8 [13/48] mm/huge_memory: fix livelock on device private folio
:::::: branch date: 21 hours ago
:::::: commit date: 21 hours ago
config: powerpc64-randconfig-r2201-20261029 (https://download.01.org/0day-ci/archive/20261029/202610290652.IGpu3Ps1-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 13.5.0
smatch: v0.5.0-9187-g5189e3fb
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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202610290652.IGpu3Ps1-lkp@intel.com/
New smatch warnings:
mm/huge_memory.c:1506 do_huge_pmd_device_private() warn: inconsistent returns 'ptl'.
Old smatch warnings:
arch/powerpc/include/asm/book3s/64/pgtable.h:678 pte_swp_soft_dirty() warn: bitwise AND condition is false here
vim +/ptl +1506 mm/huge_memory.c
71e3aac0724ffe Andrea Arcangeli 2011-01-13 1470
4964099163d052 Balbir Singh 2025-10-01 1471 vm_fault_t do_huge_pmd_device_private(struct vm_fault *vmf)
4964099163d052 Balbir Singh 2025-10-01 1472 {
4964099163d052 Balbir Singh 2025-10-01 1473 struct vm_area_struct *vma = vmf->vma;
4964099163d052 Balbir Singh 2025-10-01 1474 vm_fault_t ret = 0;
4964099163d052 Balbir Singh 2025-10-01 1475 spinlock_t *ptl;
0ac881efe16468 Lorenzo Stoakes 2025-11-10 1476 softleaf_t entry;
4964099163d052 Balbir Singh 2025-10-01 1477 struct page *page;
4964099163d052 Balbir Singh 2025-10-01 1478 struct folio *folio;
4964099163d052 Balbir Singh 2025-10-01 1479
4964099163d052 Balbir Singh 2025-10-01 1480 if (vmf->flags & FAULT_FLAG_VMA_LOCK) {
4964099163d052 Balbir Singh 2025-10-01 1481 vma_end_read(vma);
4964099163d052 Balbir Singh 2025-10-01 1482 return VM_FAULT_RETRY;
4964099163d052 Balbir Singh 2025-10-01 1483 }
4964099163d052 Balbir Singh 2025-10-01 1484
4964099163d052 Balbir Singh 2025-10-01 1485 ptl = pmd_lock(vma->vm_mm, vmf->pmd);
4964099163d052 Balbir Singh 2025-10-01 1486 if (unlikely(!pmd_same(*vmf->pmd, vmf->orig_pmd))) {
4964099163d052 Balbir Singh 2025-10-01 1487 spin_unlock(ptl);
4964099163d052 Balbir Singh 2025-10-01 1488 return 0;
4964099163d052 Balbir Singh 2025-10-01 1489 }
4964099163d052 Balbir Singh 2025-10-01 1490
0ac881efe16468 Lorenzo Stoakes 2025-11-10 1491 entry = softleaf_from_pmd(vmf->orig_pmd);
0ac881efe16468 Lorenzo Stoakes 2025-11-10 1492 page = softleaf_to_page(entry);
4964099163d052 Balbir Singh 2025-10-01 1493 folio = page_folio(page);
4964099163d052 Balbir Singh 2025-10-01 1494 vmf->page = page;
4964099163d052 Balbir Singh 2025-10-01 1495 vmf->pte = NULL;
4964099163d052 Balbir Singh 2025-10-01 1496 if (folio_trylock(folio)) {
4964099163d052 Balbir Singh 2025-10-01 1497 folio_get(folio);
4964099163d052 Balbir Singh 2025-10-01 1498 spin_unlock(ptl);
4964099163d052 Balbir Singh 2025-10-01 1499 ret = page_pgmap(page)->ops->migrate_to_ram(vmf);
4964099163d052 Balbir Singh 2025-10-01 1500 folio_unlock(folio);
4964099163d052 Balbir Singh 2025-10-01 1501 folio_put(folio);
4964099163d052 Balbir Singh 2025-10-01 1502 } else {
f3f48b7b516dd0 Josef Bacik 2026-10-13 1503 softleaf_entry_wait_on_locked(entry, ptl);
4964099163d052 Balbir Singh 2025-10-01 1504 }
4964099163d052 Balbir Singh 2025-10-01 1505
4964099163d052 Balbir Singh 2025-10-01 @1506 return ret;
4964099163d052 Balbir Singh 2025-10-01 1507 }
4964099163d052 Balbir Singh 2025-10-01 1508
:::::: The code at line 1506 was first introduced by commit
:::::: 4964099163d0524a769d039ffa886bb4515136d0 mm/memory/fault: add THP fault handling for zone device private pages
:::::: TO: Balbir Singh <balbirs@nvidia.com>
:::::: CC: Andrew Morton <akpm@linux-foundation.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-10-29 5:25 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=202610290652.IGpu3Ps1-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.