All of lore.kernel.org
 help / color / mirror / Atom feed
* [davidhildenbrand:mm_id_6.14 5/13] mm/page_alloc.c:978:2: warning: unannotated fall-through between switch labels
@ 2025-02-16 14:08 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-02-16 14:08 UTC (permalink / raw)
  To: David Hildenbrand; +Cc: llvm, oe-kbuild-all

tree:   https://github.com/davidhildenbrand/linux mm_id_6.14
head:   dcbc194183fd7526f260cc629aabff9d3300083e
commit: c599962b8dd50874ba583ccb6eb6cd9d2e973d45 [5/13] mm: move hugetlb specific things in folio to page[3]
config: hexagon-randconfig-001-20250216 (https://download.01.org/0day-ci/archive/20250216/202502162158.pSfwzqTM-lkp@intel.com/config)
compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250216/202502162158.pSfwzqTM-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/202502162158.pSfwzqTM-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> mm/page_alloc.c:978:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
           default:
           ^
   mm/page_alloc.c:978:2: note: insert '__attribute__((fallthrough));' to silence this warning
           default:
           ^
           __attribute__((fallthrough)); 
   mm/page_alloc.c:978:2: note: insert 'break;' to avoid fall-through
           default:
           ^
           break; 
   1 warning generated.


vim +978 mm/page_alloc.c

ecbb490d8ee38f Kefeng Wang             2023-05-16  931  
8666925c498674 Vlastimil Babka         2023-04-05  932  static int free_tail_page_prepare(struct page *head_page, struct page *page)
4db7548ccbd9ec Mel Gorman              2016-05-19  933  {
94688e8eb453e6 Matthew Wilcox (Oracle  2023-01-11  934) 	struct folio *folio = (struct folio *)head_page;
4db7548ccbd9ec Mel Gorman              2016-05-19  935  	int ret = 1;
4db7548ccbd9ec Mel Gorman              2016-05-19  936  
4db7548ccbd9ec Mel Gorman              2016-05-19  937  	/*
4db7548ccbd9ec Mel Gorman              2016-05-19  938  	 * We rely page->lru.next never has bit 0 set, unless the page
4db7548ccbd9ec Mel Gorman              2016-05-19  939  	 * is PageTail(). Let's make sure that's true even for poisoned ->lru.
4db7548ccbd9ec Mel Gorman              2016-05-19  940  	 */
4db7548ccbd9ec Mel Gorman              2016-05-19  941  	BUILD_BUG_ON((unsigned long)LIST_POISON1 & 1);
4db7548ccbd9ec Mel Gorman              2016-05-19  942  
ecbb490d8ee38f Kefeng Wang             2023-05-16  943  	if (!is_check_pages_enabled()) {
4db7548ccbd9ec Mel Gorman              2016-05-19  944  		ret = 0;
4db7548ccbd9ec Mel Gorman              2016-05-19  945  		goto out;
4db7548ccbd9ec Mel Gorman              2016-05-19  946  	}
4db7548ccbd9ec Mel Gorman              2016-05-19  947  	switch (page - head_page) {
4db7548ccbd9ec Mel Gorman              2016-05-19  948  	case 1:
cb67f4282bf969 Hugh Dickins            2022-11-02  949  		/* the first tail page: these may be in place of ->mapping */
65a689f35ad7eb Matthew Wilcox (Oracle  2023-01-11  950) 		if (unlikely(folio_entire_mapcount(folio))) {
65a689f35ad7eb Matthew Wilcox (Oracle  2023-01-11  951) 			bad_page(page, "nonzero entire_mapcount");
4db7548ccbd9ec Mel Gorman              2016-05-19  952  			goto out;
4db7548ccbd9ec Mel Gorman              2016-05-19  953  		}
05c5323b2a344c David Hildenbrand       2024-04-09  954  		if (unlikely(folio_large_mapcount(folio))) {
05c5323b2a344c David Hildenbrand       2024-04-09  955  			bad_page(page, "nonzero large_mapcount");
05c5323b2a344c David Hildenbrand       2024-04-09  956  			goto out;
05c5323b2a344c David Hildenbrand       2024-04-09  957  		}
65a689f35ad7eb Matthew Wilcox (Oracle  2023-01-11  958) 		if (unlikely(atomic_read(&folio->_nr_pages_mapped))) {
65a689f35ad7eb Matthew Wilcox (Oracle  2023-01-11  959) 			bad_page(page, "nonzero nr_pages_mapped");
cb67f4282bf969 Hugh Dickins            2022-11-02  960  			goto out;
cb67f4282bf969 Hugh Dickins            2022-11-02  961  		}
94688e8eb453e6 Matthew Wilcox (Oracle  2023-01-11  962) 		if (unlikely(atomic_read(&folio->_pincount))) {
94688e8eb453e6 Matthew Wilcox (Oracle  2023-01-11  963) 			bad_page(page, "nonzero pincount");
cb67f4282bf969 Hugh Dickins            2022-11-02  964  			goto out;
cb67f4282bf969 Hugh Dickins            2022-11-02  965  		}
4db7548ccbd9ec Mel Gorman              2016-05-19  966  		break;
4db7548ccbd9ec Mel Gorman              2016-05-19  967  	case 2:
b7b098cf00a2b6 Matthew Wilcox (Oracle  2024-03-21  968) 		/* the second tail page: deferred_list overlaps ->mapping */
e66f3185fa04cc Hugh Dickins            2024-10-27  969  		if (unlikely(!list_empty(&folio->_deferred_list))) {
e66f3185fa04cc Hugh Dickins            2024-10-27  970  			bad_page(page, "on deferred list");
b7b098cf00a2b6 Matthew Wilcox (Oracle  2024-03-21  971) 			goto out;
b7b098cf00a2b6 Matthew Wilcox (Oracle  2024-03-21  972) 		}
4db7548ccbd9ec Mel Gorman              2016-05-19  973  		break;
c599962b8dd508 David Hildenbrand       2024-12-16  974  	case 3:
c599962b8dd508 David Hildenbrand       2024-12-16  975  		/* the third tail page: hugetlb specifics overlaps ->mappings */
c599962b8dd508 David Hildenbrand       2024-12-16  976  		if (IS_ENABLED(CONFIG_HUGETLB_PAGE))
c599962b8dd508 David Hildenbrand       2024-12-16  977  			break;
4db7548ccbd9ec Mel Gorman              2016-05-19 @978  	default:
4db7548ccbd9ec Mel Gorman              2016-05-19  979  		if (page->mapping != TAIL_MAPPING) {
82a3241a8f76cc Wei Yang                2020-06-03  980  			bad_page(page, "corrupted mapping in tail page");
4db7548ccbd9ec Mel Gorman              2016-05-19  981  			goto out;
4db7548ccbd9ec Mel Gorman              2016-05-19  982  		}
4db7548ccbd9ec Mel Gorman              2016-05-19  983  		break;
4db7548ccbd9ec Mel Gorman              2016-05-19  984  	}
4db7548ccbd9ec Mel Gorman              2016-05-19  985  	if (unlikely(!PageTail(page))) {
82a3241a8f76cc Wei Yang                2020-06-03  986  		bad_page(page, "PageTail not set");
4db7548ccbd9ec Mel Gorman              2016-05-19  987  		goto out;
4db7548ccbd9ec Mel Gorman              2016-05-19  988  	}
4db7548ccbd9ec Mel Gorman              2016-05-19  989  	if (unlikely(compound_head(page) != head_page)) {
82a3241a8f76cc Wei Yang                2020-06-03  990  		bad_page(page, "compound_head not consistent");
4db7548ccbd9ec Mel Gorman              2016-05-19  991  		goto out;
4db7548ccbd9ec Mel Gorman              2016-05-19  992  	}
4db7548ccbd9ec Mel Gorman              2016-05-19  993  	ret = 0;
4db7548ccbd9ec Mel Gorman              2016-05-19  994  out:
4db7548ccbd9ec Mel Gorman              2016-05-19  995  	page->mapping = NULL;
4db7548ccbd9ec Mel Gorman              2016-05-19  996  	clear_compound_head(page);
4db7548ccbd9ec Mel Gorman              2016-05-19  997  	return ret;
4db7548ccbd9ec Mel Gorman              2016-05-19  998  }
4db7548ccbd9ec Mel Gorman              2016-05-19  999  

:::::: The code at line 978 was first introduced by commit
:::::: 4db7548ccbd9ec8e666f35df4a530f55904dec39 mm, page_alloc: defer debugging checks of freed pages until a PCP drain

:::::: TO: Mel Gorman <mgorman@techsingularity.net>
:::::: CC: Linus Torvalds <torvalds@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:[~2025-02-16 14:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-16 14:08 [davidhildenbrand:mm_id_6.14 5/13] mm/page_alloc.c:978:2: warning: unannotated fall-through between switch labels 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.