On Mon, Oct 07, 2019 at 03:56:41PM +0200, Vlastimil Babka wrote: > On 10/7/19 3:28 PM, Vlastimil Babka wrote: > > On 10/1/19 9:40 PM, Florian Weimer wrote: > >> * Vlastimil Babka: > >> > >> > >> See below. I don't have debuginfo for this build, and the binary does > >> not reproduce for some reason. Due to the heavy inlining, it might be > >> quite hard to figure out what's going on. > > > > Thanks, but I'm still not able to "decompile" that in my head. > > While staring at the code, I think I found two probably unrelated bugs. > One is that pfn and page might be desynced when zone starts in the middle > of pageblock, as the max() is only applied to page and not pfn. But that > only effectively affects the later pfn_valid_within() checks, which should > be always true on x86. > > The second is that "end of pageblock online and valid" should refer to > the last pfn of pageblock, not first pfn of next pageblocks. Otherwise we > might return false needlessly. Mel, what do you think? > I think you are correct in both cases. It's perfectly possible I would not have observed a problem in testing if zones were aligned which I think is generally the case on my test machines. -- Mel Gorman SUSE Labs