llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v10 08/13] khugepaged: avoid unnecessary mTHP collapse attempts
       [not found] <20250819134205.622806-9-npache@redhat.com>
@ 2025-08-20  6:22 ` kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-08-20  6:22 UTC (permalink / raw)
  To: Nico Pache; +Cc: llvm, oe-kbuild-all

Hi Nico,

kernel test robot noticed the following build warnings:

[auto build test WARNING on akpm-mm/mm-everything]
[cannot apply to lwn/docs-next linus/master v6.17-rc2 next-20250819]
[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/Nico-Pache/khugepaged-rename-hpage_collapse_-to-collapse_/20250819-222051
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20250819134205.622806-9-npache%40redhat.com
patch subject: [PATCH v10 08/13] khugepaged: avoid unnecessary mTHP collapse attempts
config: i386-randconfig-003-20250820 (https://download.01.org/0day-ci/archive/20250820/202508201447.n6ubJ93W-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250820/202508201447.n6ubJ93W-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/202508201447.n6ubJ93W-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> mm/khugepaged.c:1403:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
    1403 |                         case SCAN_PAGE_RO:
         |                         ^
   mm/khugepaged.c:1403:4: note: insert '__attribute__((fallthrough));' to silence this warning
    1403 |                         case SCAN_PAGE_RO:
         |                         ^
         |                         __attribute__((fallthrough)); 
   mm/khugepaged.c:1403:4: note: insert 'break;' to avoid fall-through
    1403 |                         case SCAN_PAGE_RO:
         |                         ^
         |                         break; 
   1 warning generated.


vim +1403 mm/khugepaged.c

  1350	
  1351	/* Recursive function to consume the bitmap */
  1352	static int collapse_scan_bitmap(struct mm_struct *mm, unsigned long address,
  1353				int referenced, int unmapped, struct collapse_control *cc,
  1354				bool *mmap_locked, unsigned long enabled_orders)
  1355	{
  1356		u8 order, next_order;
  1357		u16 offset, mid_offset;
  1358		int num_chunks;
  1359		int bits_set, threshold_bits;
  1360		int top = -1;
  1361		int collapsed = 0;
  1362		int ret;
  1363		struct scan_bit_state state;
  1364		bool is_pmd_only = (enabled_orders == (1 << HPAGE_PMD_ORDER));
  1365	
  1366		cc->mthp_bitmap_stack[++top] = (struct scan_bit_state)
  1367			{ HPAGE_PMD_ORDER - KHUGEPAGED_MIN_MTHP_ORDER, 0 };
  1368	
  1369		while (top >= 0) {
  1370			state = cc->mthp_bitmap_stack[top--];
  1371			order = state.order + KHUGEPAGED_MIN_MTHP_ORDER;
  1372			offset = state.offset;
  1373			num_chunks = 1 << (state.order);
  1374			/* Skip mTHP orders that are not enabled */
  1375			if (!test_bit(order, &enabled_orders))
  1376				goto next_order;
  1377	
  1378			/* copy the relavant section to a new bitmap */
  1379			bitmap_shift_right(cc->mthp_bitmap_temp, cc->mthp_bitmap, offset,
  1380					  MTHP_BITMAP_SIZE);
  1381	
  1382			bits_set = bitmap_weight(cc->mthp_bitmap_temp, num_chunks);
  1383			threshold_bits = (HPAGE_PMD_NR - khugepaged_max_ptes_none - 1)
  1384					>> (HPAGE_PMD_ORDER - state.order);
  1385	
  1386			/* Check if the region is "almost full" based on the threshold */
  1387			if (bits_set > threshold_bits || is_pmd_only
  1388				|| test_bit(order, &huge_anon_orders_always)) {
  1389				ret = collapse_huge_page(mm, address, referenced, unmapped,
  1390							 cc, mmap_locked, order,
  1391							 offset * KHUGEPAGED_MIN_MTHP_NR);
  1392	
  1393				/*
  1394				 * Analyze failure reason to determine next action:
  1395				 * - goto next_order: try smaller orders in same region
  1396				 * - continue: try other regions at same order
  1397				 * - break: stop all attempts (system-wide failure)
  1398				 */
  1399				switch (ret) {
  1400				/* Cases were we should continue to the next region */
  1401				case SCAN_SUCCEED:
  1402					collapsed += (1 << order);
> 1403				case SCAN_PAGE_RO:
  1404				case SCAN_PTE_MAPPED_HUGEPAGE:
  1405					continue;
  1406				/* Cases were lower orders might still succeed */
  1407				case SCAN_LACK_REFERENCED_PAGE:
  1408				case SCAN_EXCEED_NONE_PTE:
  1409				case SCAN_EXCEED_SWAP_PTE:
  1410				case SCAN_EXCEED_SHARED_PTE:
  1411				case SCAN_PAGE_LOCK:
  1412				case SCAN_PAGE_COUNT:
  1413				case SCAN_PAGE_LRU:
  1414				case SCAN_PAGE_NULL:
  1415				case SCAN_DEL_PAGE_LRU:
  1416				case SCAN_PTE_NON_PRESENT:
  1417				case SCAN_PTE_UFFD_WP:
  1418				case SCAN_ALLOC_HUGE_PAGE_FAIL:
  1419					goto next_order;
  1420				/* All other cases should stop collapse attempts */
  1421				default:
  1422					break;
  1423				}
  1424				break;
  1425			}
  1426	
  1427	next_order:
  1428			if (state.order > 0) {
  1429				next_order = state.order - 1;
  1430				mid_offset = offset + (num_chunks / 2);
  1431				cc->mthp_bitmap_stack[++top] = (struct scan_bit_state)
  1432					{ next_order, mid_offset };
  1433				cc->mthp_bitmap_stack[++top] = (struct scan_bit_state)
  1434					{ next_order, offset };
  1435			}
  1436		}
  1437		return collapsed;
  1438	}
  1439	

-- 
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:[~2025-08-20  6:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20250819134205.622806-9-npache@redhat.com>
2025-08-20  6:22 ` [PATCH v10 08/13] khugepaged: avoid unnecessary mTHP collapse attempts kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).