Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'mm-compaction-5.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/mel/linux

Pull mm/compaction fixes from Mel Gorman:
"The merge window for 5.1 introduced a number of compaction-related
patches. with intermittent reports of corruption and functional
issues. The bugs are due to sloopy checking of zone boundaries and a
corner case where invalid indexes are used to access the free lists.

Reports are not common but at least two users and 0-day have tripped
over them. There is a chance that one of the syzbot reports are
related but it has not been confirmed properly.

The normal submission path is with Andrew but there have been some
delays and I consider them urgent enough that they should be picked up
before RC4 to avoid duplicate reports.

All of these have been successfully tested on older RC windows. This
will make this branch look like a rebase but in fact, they've simply
been lifted again from Andrew's tree and placed on a fresh branch.
I've no reason to believe that this has invalidated the testing given
the lack of change in compaction and the nature of the fixes"

* tag 'mm-compaction-5.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/mel/linux:
mm/compaction.c: abort search if isolation fails
mm/compaction.c: correct zone boundary handling when resetting pageblock skip hints

+18 -11
+18 -11
mm/compaction.c
··· 242 242 bool check_target) 243 243 { 244 244 struct page *page = pfn_to_online_page(pfn); 245 + struct page *block_page; 245 246 struct page *end_page; 246 247 unsigned long block_pfn; 247 248 ··· 268 267 get_pageblock_migratetype(page) != MIGRATE_MOVABLE) 269 268 return false; 270 269 270 + /* Ensure the start of the pageblock or zone is online and valid */ 271 + block_pfn = pageblock_start_pfn(pfn); 272 + block_page = pfn_to_online_page(max(block_pfn, zone->zone_start_pfn)); 273 + if (block_page) { 274 + page = block_page; 275 + pfn = block_pfn; 276 + } 277 + 278 + /* Ensure the end of the pageblock or zone is online and valid */ 279 + block_pfn += pageblock_nr_pages; 280 + block_pfn = min(block_pfn, zone_end_pfn(zone) - 1); 281 + end_page = pfn_to_online_page(block_pfn); 282 + if (!end_page) 283 + return false; 284 + 271 285 /* 272 286 * Only clear the hint if a sample indicates there is either a 273 287 * free page or an LRU page in the block. One or other condition 274 288 * is necessary for the block to be a migration source/target. 275 289 */ 276 - block_pfn = pageblock_start_pfn(pfn); 277 - pfn = max(block_pfn, zone->zone_start_pfn); 278 - page = pfn_to_page(pfn); 279 - if (zone != page_zone(page)) 280 - return false; 281 - pfn = block_pfn + pageblock_nr_pages; 282 - pfn = min(pfn, zone_end_pfn(zone)); 283 - end_page = pfn_to_page(pfn); 284 - 285 290 do { 286 291 if (pfn_valid_within(pfn)) { 287 292 if (check_source && PageLRU(page)) { ··· 316 309 static void __reset_isolation_suitable(struct zone *zone) 317 310 { 318 311 unsigned long migrate_pfn = zone->zone_start_pfn; 319 - unsigned long free_pfn = zone_end_pfn(zone); 312 + unsigned long free_pfn = zone_end_pfn(zone) - 1; 320 313 unsigned long reset_migrate = free_pfn; 321 314 unsigned long reset_free = migrate_pfn; 322 315 bool source_set = false; ··· 1370 1363 count_compact_events(COMPACTISOLATED, nr_isolated); 1371 1364 } else { 1372 1365 /* If isolation fails, abort the search */ 1373 - order = -1; 1366 + order = cc->search_order + 1; 1374 1367 page = NULL; 1375 1368 } 1376 1369 }