On 07/26/2018 06:50 PM, Mike Kravetz wrote: > On 07/26/2018 05:28 AM, Vlastimil Babka wrote: >>> Just looking for suggesting in where/how to debug. I've been hacking on >>> this without much success. > > As mentioned in my reply to Laura, I noticed that move_freepages_block() > can move more than a pageblock of pages. This is the case where page_order > of the (first) free page is > pageblock_order. Should only happen in the > set_migratetype_isolate case as unset has that check you added. Thi Hmm not sure which "check I added" you mean, in unset_migratetype_isolate() ? > generally 'works' as alloc_contig_range rounds up to MAX_ORDER(-1). So, > set and unset migrate isolate tend to balance out. But, I am wondering > if there might be some kind of race where someone could mess with those > pageblocks (and freepage counts) while we drop the zone lock. Trying to Yeah see my other mail for such race when we drop the zone lock in unset_migratetype_isolate(). set_migratetype_isolate() would also have this problem (which would result in *less* freepages counted), but if we move MAX_ORDER-1 pages to MIGRATE_ISOLATE freelist, then nobody can mess with them while the zone is locked, as they are isolated. unset_migratetype_isolate() has no such luck. > put together a quick hack to test this theory, but it is more complicated > that first thought. :) >