All of lore.kernel.org
 help / color / mirror / Atom feed
* [davidhildenbrand:b4/fixes_core 13/48] mm/huge_memory.c:1506 do_huge_pmd_device_private() warn: inconsistent returns 'ptl'.
@ 2026-10-29  5:24 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-10-29  5:24 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-29  5:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-29  5:24 [davidhildenbrand:b4/fixes_core 13/48] mm/huge_memory.c:1506 do_huge_pmd_device_private() warn: inconsistent returns 'ptl' 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.