All of lore.kernel.org
 help / color / mirror / Atom feed
* [android-common:android13-5.15 1/1] mm/page_alloc.c:1167:31: sparse: sparse: cast from restricted fpi_t
@ 2023-08-05  4:40 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-08-05  4:40 UTC (permalink / raw)
  To: cros-kernel-buildreports; +Cc: oe-kbuild-all

tree:   https://android.googlesource.com/kernel/common android13-5.15
head:   f9dbe76124d63e620471a49c356ea93dfcaa7ce8
commit: 00b1ba8b15f9d161d165afee26d7409a12deca98 [1/1] ANDROID: vendor_hooks: vendor hook for MM
config: i386-randconfig-i063-20230730 (https://download.01.org/0day-ci/archive/20230805/202308051227.nS4zaaAP-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230805/202308051227.nS4zaaAP-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/202308051227.nS4zaaAP-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> mm/page_alloc.c:1167:31: sparse: sparse: cast from restricted fpi_t
>> mm/page_alloc.c:1167:31: sparse: sparse: cast from restricted fpi_t
>> mm/page_alloc.c:1167:31: sparse: sparse: cast from restricted fpi_t
   mm/page_alloc.c:3614:9: sparse: sparse: context imbalance in 'free_unref_page' - different lock contexts for basic block
   mm/page_alloc.c:3693:17: sparse: sparse: context imbalance in 'free_unref_page_list' - unexpected unlock
>> mm/page_alloc.c:1167:31: sparse: sparse: cast from restricted fpi_t
   mm/page_alloc.c:3895:20: sparse: sparse: context imbalance in 'rmqueue_pcplist' - different lock contexts for basic block
   mm/page_alloc.c: note: in included file (through include/linux/mm.h):
   include/linux/gfp.h:383:27: sparse: sparse: restricted gfp_t degrades to integer
   include/linux/gfp.h:383:27: sparse: sparse: restricted gfp_t degrades to integer
   mm/page_alloc.c:5622:9: sparse: sparse: context imbalance in '__alloc_pages_bulk' - different lock contexts for basic block
   include/linux/gfp.h:383:27: sparse: sparse: restricted gfp_t degrades to integer
   include/linux/gfp.h:383:27: sparse: sparse: restricted gfp_t degrades to integer
   include/linux/gfp.h:383:27: sparse: sparse: restricted gfp_t degrades to integer
   include/linux/gfp.h:383:27: sparse: sparse: restricted gfp_t degrades to integer

vim +1167 mm/page_alloc.c

  1128	
  1129	/*
  1130	 * Freeing function for a buddy system allocator.
  1131	 *
  1132	 * The concept of a buddy system is to maintain direct-mapped table
  1133	 * (containing bit values) for memory blocks of various "orders".
  1134	 * The bottom level table contains the map for the smallest allocatable
  1135	 * units of memory (here, pages), and each level above it describes
  1136	 * pairs of units from the levels below, hence, "buddies".
  1137	 * At a high level, all that happens here is marking the table entry
  1138	 * at the bottom level available, and propagating the changes upward
  1139	 * as necessary, plus some accounting needed to play nicely with other
  1140	 * parts of the VM system.
  1141	 * At each level, we keep a list of pages, which are heads of continuous
  1142	 * free pages of length of (1 << order) and marked with PageBuddy.
  1143	 * Page's order is recorded in page_private(page) field.
  1144	 * So when we are allocating or freeing one, we can derive the state of the
  1145	 * other.  That is, if we allocate a small block, and both were
  1146	 * free, the remainder of the region must be split into blocks.
  1147	 * If a block is freed, and its buddy is also free, then this
  1148	 * triggers coalescing into a block of larger size.
  1149	 *
  1150	 * -- nyc
  1151	 */
  1152	
  1153	static inline void __free_one_page(struct page *page,
  1154			unsigned long pfn,
  1155			struct zone *zone, unsigned int order,
  1156			int migratetype, fpi_t fpi_flags)
  1157	{
  1158		struct capture_control *capc = task_capc(zone);
  1159		unsigned long buddy_pfn;
  1160		unsigned long combined_pfn;
  1161		unsigned int max_order;
  1162		struct page *buddy;
  1163		bool to_tail;
  1164		bool bypass = false;
  1165	
  1166		trace_android_vh_free_one_page_bypass(page, zone, order,
> 1167			migratetype, (int)fpi_flags, &bypass);
  1168	
  1169		if (bypass)
  1170			return;
  1171	
  1172		max_order = min_t(unsigned int, MAX_ORDER - 1, pageblock_order);
  1173	
  1174		VM_BUG_ON(!zone_is_initialized(zone));
  1175		VM_BUG_ON_PAGE(page->flags & PAGE_FLAGS_CHECK_AT_PREP, page);
  1176	
  1177		VM_BUG_ON(migratetype == -1);
  1178		if (likely(!is_migrate_isolate(migratetype)))
  1179			__mod_zone_freepage_state(zone, 1 << order, migratetype);
  1180	
  1181		VM_BUG_ON_PAGE(pfn & ((1 << order) - 1), page);
  1182		VM_BUG_ON_PAGE(bad_range(zone, page), page);
  1183	
  1184	continue_merging:
  1185		while (order < max_order) {
  1186			if (compaction_capture(capc, page, order, migratetype)) {
  1187				__mod_zone_freepage_state(zone, -(1 << order),
  1188									migratetype);
  1189				return;
  1190			}
  1191			buddy_pfn = __find_buddy_pfn(pfn, order);
  1192			buddy = page + (buddy_pfn - pfn);
  1193	
  1194			if (!page_is_buddy(page, buddy, order))
  1195				goto done_merging;
  1196			/*
  1197			 * Our buddy is free or it is CONFIG_DEBUG_PAGEALLOC guard page,
  1198			 * merge with it and move up one order.
  1199			 */
  1200			if (page_is_guard(buddy))
  1201				clear_page_guard(zone, buddy, order, migratetype);
  1202			else
  1203				del_page_from_free_list(buddy, zone, order);
  1204			combined_pfn = buddy_pfn & pfn;
  1205			page = page + (combined_pfn - pfn);
  1206			pfn = combined_pfn;
  1207			order++;
  1208		}
  1209		if (order < MAX_ORDER - 1) {
  1210			/* If we are here, it means order is >= pageblock_order.
  1211			 * We want to prevent merge between freepages on isolate
  1212			 * pageblock and normal pageblock. Without this, pageblock
  1213			 * isolation could cause incorrect freepage or CMA accounting.
  1214			 *
  1215			 * We don't want to hit this code for the more frequent
  1216			 * low-order merging.
  1217			 */
  1218			if (unlikely(has_isolate_pageblock(zone))) {
  1219				int buddy_mt;
  1220	
  1221				buddy_pfn = __find_buddy_pfn(pfn, order);
  1222				buddy = page + (buddy_pfn - pfn);
  1223				buddy_mt = get_pageblock_migratetype(buddy);
  1224	
  1225				if (migratetype != buddy_mt
  1226						&& (is_migrate_isolate(migratetype) ||
  1227							is_migrate_isolate(buddy_mt)))
  1228					goto done_merging;
  1229			}
  1230			max_order = order + 1;
  1231			goto continue_merging;
  1232		}
  1233	
  1234	done_merging:
  1235		set_buddy_order(page, order);
  1236	
  1237		if (fpi_flags & FPI_TO_TAIL)
  1238			to_tail = true;
  1239		else if (is_shuffle_order(order))
  1240			to_tail = shuffle_pick_tail();
  1241		else
  1242			to_tail = buddy_merge_likely(pfn, buddy_pfn, page, order);
  1243	
  1244		if (to_tail)
  1245			add_to_free_list_tail(page, zone, order, migratetype);
  1246		else
  1247			add_to_free_list(page, zone, order, migratetype);
  1248	
  1249		/* Notify page reporting subsystem of freed page */
  1250		if (!(fpi_flags & FPI_SKIP_REPORT_NOTIFY))
  1251			page_reporting_notify_free(order);
  1252	}
  1253	

-- 
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:[~2023-08-05  4:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-05  4:40 [android-common:android13-5.15 1/1] mm/page_alloc.c:1167:31: sparse: sparse: cast from restricted fpi_t 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.