From: kernel test robot <lkp@intel.com>
To: Nico Pache <npache@redhat.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH v10 08/13] khugepaged: avoid unnecessary mTHP collapse attempts
Date: Wed, 20 Aug 2025 14:22:44 +0800 [thread overview]
Message-ID: <202508201447.n6ubJ93W-lkp@intel.com> (raw)
In-Reply-To: <20250819134205.622806-9-npache@redhat.com>
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
next prev parent reply other threads:[~2025-08-20 6:23 UTC|newest]
Thread overview: 90+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-19 13:41 [PATCH v10 00/13] khugepaged: mTHP support Nico Pache
2025-08-19 13:41 ` [PATCH v10 01/13] khugepaged: rename hpage_collapse_* to collapse_* Nico Pache
2025-08-20 10:42 ` Lorenzo Stoakes
2025-09-11 11:56 ` Lance Yang
2025-08-19 13:41 ` [PATCH v10 02/13] introduce collapse_single_pmd to unify khugepaged and madvise_collapse Nico Pache
2025-08-20 11:21 ` Lorenzo Stoakes
2025-08-20 16:35 ` Nico Pache
2025-08-22 10:21 ` Lorenzo Stoakes
2025-08-26 13:30 ` Nico Pache
2025-08-19 13:41 ` [PATCH v10 03/13] khugepaged: generalize hugepage_vma_revalidate for mTHP support Nico Pache
2025-08-20 13:23 ` Lorenzo Stoakes
2025-08-20 15:40 ` Nico Pache
2025-08-21 3:41 ` Wei Yang
2025-08-21 14:09 ` Zi Yan
2025-08-22 10:25 ` Lorenzo Stoakes
2025-08-24 1:37 ` Wei Yang
2025-08-26 13:46 ` Nico Pache
2025-08-19 13:41 ` [PATCH v10 04/13] khugepaged: generalize alloc_charge_folio() Nico Pache
2025-08-20 13:28 ` Lorenzo Stoakes
2025-08-19 13:41 ` [PATCH v10 05/13] khugepaged: generalize __collapse_huge_page_* for mTHP support Nico Pache
2025-08-20 14:22 ` Lorenzo Stoakes
2025-09-01 16:15 ` David Hildenbrand
2025-08-19 13:41 ` [PATCH v10 06/13] khugepaged: add " Nico Pache
2025-08-20 18:29 ` Lorenzo Stoakes
2025-09-02 20:12 ` Nico Pache
2025-09-05 10:13 ` Lorenzo Stoakes
2025-09-08 22:29 ` Nico Pache
2025-09-11 12:21 ` Lorenzo Stoakes
2025-08-19 13:41 ` [PATCH v10 07/13] khugepaged: skip collapsing mTHP to smaller orders Nico Pache
2025-08-21 12:05 ` Lorenzo Stoakes
2025-08-21 12:33 ` Dev Jain
2025-08-22 10:33 ` Lorenzo Stoakes
2025-08-21 16:54 ` Steven Rostedt
2025-08-21 16:56 ` Lorenzo Stoakes
2025-08-19 13:42 ` [PATCH v10 08/13] khugepaged: avoid unnecessary mTHP collapse attempts Nico Pache
2025-08-20 6:22 ` kernel test robot [this message]
2025-08-20 10:38 ` Lorenzo Stoakes
2025-08-19 13:42 ` [PATCH v10 09/13] khugepaged: enable collapsing mTHPs even when PMD THPs are disabled Nico Pache
2025-08-21 13:35 ` Lorenzo Stoakes
2025-08-19 13:42 ` [PATCH v10 10/13] khugepaged: kick khugepaged for enabling none-PMD-sized mTHPs Nico Pache
2025-08-21 14:18 ` Lorenzo Stoakes
2025-08-21 14:26 ` Lorenzo Stoakes
2025-08-22 6:59 ` Baolin Wang
2025-08-22 7:36 ` Dev Jain
2025-08-19 13:42 ` [PATCH v10 11/13] khugepaged: improve tracepoints for mTHP orders Nico Pache
2025-08-21 14:24 ` Lorenzo Stoakes
2025-08-19 14:16 ` [PATCH v10 12/13] khugepaged: add per-order mTHP khugepaged stats Nico Pache
2025-08-21 14:47 ` Lorenzo Stoakes
2025-09-09 6:36 ` Nico Pache
2025-09-11 11:14 ` Lorenzo Stoakes
2025-08-19 14:17 ` [PATCH v10 13/13] Documentation: mm: update the admin guide for mTHP collapse Nico Pache
2025-08-21 15:03 ` Lorenzo Stoakes
2025-08-19 21:55 ` [PATCH v10 00/13] khugepaged: mTHP support Andrew Morton
2025-08-20 15:55 ` Nico Pache
2025-08-21 15:01 ` Lorenzo Stoakes
2025-08-21 15:13 ` Dev Jain
2025-08-21 15:19 ` Lorenzo Stoakes
2025-08-21 15:25 ` Nico Pache
2025-08-21 15:27 ` Nico Pache
2025-08-21 15:32 ` Lorenzo Stoakes
2025-08-21 16:46 ` Nico Pache
2025-08-21 16:54 ` Lorenzo Stoakes
2025-08-21 17:26 ` David Hildenbrand
2025-08-21 20:43 ` David Hildenbrand
2025-08-22 10:41 ` Lorenzo Stoakes
2025-08-22 14:10 ` David Hildenbrand
2025-08-22 14:49 ` Lorenzo Stoakes
2025-08-22 15:33 ` Dev Jain
2025-08-26 10:43 ` Lorenzo Stoakes
2025-08-28 9:46 ` Baolin Wang
2025-08-28 10:48 ` Dev Jain
2025-08-29 1:55 ` Baolin Wang
2025-09-01 16:46 ` David Hildenbrand
2025-09-02 2:28 ` Baolin Wang
2025-09-02 9:03 ` David Hildenbrand
2025-09-02 10:34 ` Usama Arif
2025-09-02 11:03 ` David Hildenbrand
2025-09-02 20:23 ` Usama Arif
2025-09-03 3:27 ` Baolin Wang
2025-09-04 2:54 ` Nico Pache
2025-09-05 11:48 ` Lorenzo Stoakes
2025-09-05 11:55 ` David Hildenbrand
2025-09-05 12:31 ` Usama Arif
2025-09-05 12:38 ` David Hildenbrand
2025-09-04 2:44 ` Nico Pache
2025-09-04 18:56 ` David Hildenbrand
2025-08-21 16:38 ` Liam R. Howlett
2025-09-01 16:21 ` David Hildenbrand
2025-09-01 17:06 ` David Hildenbrand
2025-09-05 18:05 ` Dev Jain
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=202508201447.n6ubJ93W-lkp@intel.com \
--to=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=npache@redhat.com \
--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.