All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Lance Yang <lance.yang@linux.dev>
Cc: oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH RFC 3/3] mm/khugepaged: skip redundant IPI in collapse_huge_page()
Date: Sun, 14 Dec 2025 21:24:51 +0800	[thread overview]
Message-ID: <202512142156.cShiu6PU-lkp@intel.com> (raw)
In-Reply-To: <20251213080038.10917-4-lance.yang@linux.dev>

Hi Lance,

[This is a private test report for your RFC patch.]
kernel test robot noticed the following build errors:

[auto build test ERROR on akpm-mm/mm-everything]
[also build test ERROR on next-20251212]
[cannot apply to tip/x86/core arnd-asm-generic/master linus/master v6.19-rc1]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Lance-Yang/mm-tlb-allow-architectures-to-skip-redundant-TLB-sync-IPIs/20251213-160431
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20251213080038.10917-4-lance.yang%40linux.dev
patch subject: [PATCH RFC 3/3] mm/khugepaged: skip redundant IPI in collapse_huge_page()
config: arc-randconfig-001-20251214 (https://download.01.org/0day-ci/archive/20251214/202512142156.cShiu6PU-lkp@intel.com/config)
compiler: arc-linux-gcc (GCC) 12.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251214/202512142156.cShiu6PU-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/202512142156.cShiu6PU-lkp@intel.com/

All errors (new ones prefixed by >>):

   mm/khugepaged.c: In function 'collapse_huge_page':
>> mm/khugepaged.c:1185:14: error: implicit declaration of function 'tlb_table_flush_implies_ipi_broadcast' [-Werror=implicit-function-declaration]
    1185 |         if (!tlb_table_flush_implies_ipi_broadcast())
         |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +/tlb_table_flush_implies_ipi_broadcast +1185 mm/khugepaged.c

  1090	
  1091	static int collapse_huge_page(struct mm_struct *mm, unsigned long address,
  1092				      int referenced, int unmapped,
  1093				      struct collapse_control *cc)
  1094	{
  1095		LIST_HEAD(compound_pagelist);
  1096		pmd_t *pmd, _pmd;
  1097		pte_t *pte;
  1098		pgtable_t pgtable;
  1099		struct folio *folio;
  1100		spinlock_t *pmd_ptl, *pte_ptl;
  1101		int result = SCAN_FAIL;
  1102		struct vm_area_struct *vma;
  1103		struct mmu_notifier_range range;
  1104	
  1105		VM_BUG_ON(address & ~HPAGE_PMD_MASK);
  1106	
  1107		/*
  1108		 * Before allocating the hugepage, release the mmap_lock read lock.
  1109		 * The allocation can take potentially a long time if it involves
  1110		 * sync compaction, and we do not need to hold the mmap_lock during
  1111		 * that. We will recheck the vma after taking it again in write mode.
  1112		 */
  1113		mmap_read_unlock(mm);
  1114	
  1115		result = alloc_charge_folio(&folio, mm, cc);
  1116		if (result != SCAN_SUCCEED)
  1117			goto out_nolock;
  1118	
  1119		mmap_read_lock(mm);
  1120		result = hugepage_vma_revalidate(mm, address, true, &vma, cc);
  1121		if (result != SCAN_SUCCEED) {
  1122			mmap_read_unlock(mm);
  1123			goto out_nolock;
  1124		}
  1125	
  1126		result = find_pmd_or_thp_or_none(mm, address, &pmd);
  1127		if (result != SCAN_SUCCEED) {
  1128			mmap_read_unlock(mm);
  1129			goto out_nolock;
  1130		}
  1131	
  1132		if (unmapped) {
  1133			/*
  1134			 * __collapse_huge_page_swapin will return with mmap_lock
  1135			 * released when it fails. So we jump out_nolock directly in
  1136			 * that case.  Continuing to collapse causes inconsistency.
  1137			 */
  1138			result = __collapse_huge_page_swapin(mm, vma, address, pmd,
  1139							     referenced);
  1140			if (result != SCAN_SUCCEED)
  1141				goto out_nolock;
  1142		}
  1143	
  1144		mmap_read_unlock(mm);
  1145		/*
  1146		 * Prevent all access to pagetables with the exception of
  1147		 * gup_fast later handled by the ptep_clear_flush and the VM
  1148		 * handled by the anon_vma lock + PG_lock.
  1149		 *
  1150		 * UFFDIO_MOVE is prevented to race as well thanks to the
  1151		 * mmap_lock.
  1152		 */
  1153		mmap_write_lock(mm);
  1154		result = hugepage_vma_revalidate(mm, address, true, &vma, cc);
  1155		if (result != SCAN_SUCCEED)
  1156			goto out_up_write;
  1157		/* check if the pmd is still valid */
  1158		vma_start_write(vma);
  1159		result = check_pmd_still_valid(mm, address, pmd);
  1160		if (result != SCAN_SUCCEED)
  1161			goto out_up_write;
  1162	
  1163		anon_vma_lock_write(vma->anon_vma);
  1164	
  1165		mmu_notifier_range_init(&range, MMU_NOTIFY_CLEAR, 0, mm, address,
  1166					address + HPAGE_PMD_SIZE);
  1167		mmu_notifier_invalidate_range_start(&range);
  1168	
  1169		pmd_ptl = pmd_lock(mm, pmd); /* probably unnecessary */
  1170		/*
  1171		 * This removes any huge TLB entry from the CPU so we won't allow
  1172		 * huge and small TLB entries for the same virtual address to
  1173		 * avoid the risk of CPU bugs in that area.
  1174		 *
  1175		 * Parallel GUP-fast is fine since GUP-fast will back off when
  1176		 * it detects PMD is changed.
  1177		 */
  1178		_pmd = pmdp_collapse_flush(vma, address, pmd);
  1179		spin_unlock(pmd_ptl);
  1180		mmu_notifier_invalidate_range_end(&range);
  1181		/*
  1182		 * Skip the second IPI if the TLB flush above already synchronized
  1183		 * with concurrent GUP-fast via broadcast IPIs.
  1184		 */
> 1185		if (!tlb_table_flush_implies_ipi_broadcast())
  1186			tlb_remove_table_sync_one();
  1187	
  1188		pte = pte_offset_map_lock(mm, &_pmd, address, &pte_ptl);
  1189		if (pte) {
  1190			result = __collapse_huge_page_isolate(vma, address, pte, cc,
  1191							      &compound_pagelist);
  1192			spin_unlock(pte_ptl);
  1193		} else {
  1194			result = SCAN_NO_PTE_TABLE;
  1195		}
  1196	
  1197		if (unlikely(result != SCAN_SUCCEED)) {
  1198			if (pte)
  1199				pte_unmap(pte);
  1200			spin_lock(pmd_ptl);
  1201			BUG_ON(!pmd_none(*pmd));
  1202			/*
  1203			 * We can only use set_pmd_at when establishing
  1204			 * hugepmds and never for establishing regular pmds that
  1205			 * points to regular pagetables. Use pmd_populate for that
  1206			 */
  1207			pmd_populate(mm, pmd, pmd_pgtable(_pmd));
  1208			spin_unlock(pmd_ptl);
  1209			anon_vma_unlock_write(vma->anon_vma);
  1210			goto out_up_write;
  1211		}
  1212	
  1213		/*
  1214		 * All pages are isolated and locked so anon_vma rmap
  1215		 * can't run anymore.
  1216		 */
  1217		anon_vma_unlock_write(vma->anon_vma);
  1218	
  1219		result = __collapse_huge_page_copy(pte, folio, pmd, _pmd,
  1220						   vma, address, pte_ptl,
  1221						   &compound_pagelist);
  1222		pte_unmap(pte);
  1223		if (unlikely(result != SCAN_SUCCEED))
  1224			goto out_up_write;
  1225	
  1226		/*
  1227		 * The smp_wmb() inside __folio_mark_uptodate() ensures the
  1228		 * copy_huge_page writes become visible before the set_pmd_at()
  1229		 * write.
  1230		 */
  1231		__folio_mark_uptodate(folio);
  1232		pgtable = pmd_pgtable(_pmd);
  1233	
  1234		spin_lock(pmd_ptl);
  1235		BUG_ON(!pmd_none(*pmd));
  1236		pgtable_trans_huge_deposit(mm, pmd, pgtable);
  1237		map_anon_folio_pmd_nopf(folio, pmd, vma, address);
  1238		spin_unlock(pmd_ptl);
  1239	
  1240		folio = NULL;
  1241	
  1242		result = SCAN_SUCCEED;
  1243	out_up_write:
  1244		mmap_write_unlock(mm);
  1245	out_nolock:
  1246		if (folio)
  1247			folio_put(folio);
  1248		trace_mm_collapse_huge_page(mm, result == SCAN_SUCCEED, result);
  1249		return result;
  1250	}
  1251	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  reply	other threads:[~2025-12-14 13:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-13  8:00 [PATCH RFC 0/3] skip redundant TLB sync IPIs Lance Yang
2025-12-13  8:00 ` [PATCH RFC 1/3] mm/tlb: allow architectures to " Lance Yang
2025-12-15  5:48   ` Lance Yang
2025-12-18 13:08     ` David Hildenbrand (Red Hat)
2025-12-13  8:00 ` [PATCH RFC 2/3] x86/mm: implement redundant IPI elimination for PMD unsharing Lance Yang
2025-12-18 13:08   ` David Hildenbrand (Red Hat)
2025-12-22  3:19     ` [PATCH RFC 2/3] x86/mm: implement redundant IPI elimination for Lance Yang
2025-12-23  9:44       ` David Hildenbrand (Red Hat)
2025-12-23 11:13         ` Lance Yang
2025-12-13  8:00 ` [PATCH RFC 3/3] mm/khugepaged: skip redundant IPI in collapse_huge_page() Lance Yang
2025-12-14 13:24   ` kernel test robot [this message]
2025-12-14 13:56   ` kernel test robot
2025-12-18 13:13   ` David Hildenbrand (Red Hat)
2025-12-18 14:35     ` Lance Yang
2025-12-19  8:25       ` David Hildenbrand (Red Hat)
2025-12-21 10:43         ` Lance Yang

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=202512142156.cShiu6PU-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=lance.yang@linux.dev \
    --cc=oe-kbuild-all@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.