On Fri, 7 Apr 2023 00:14:31 +0300 Mike Rapoport <rppt@xxxxxxxxxx> wrote: > > > Shouldn't that be > > > else > > > order = 0; > > > ? > > > > +Mike. > > > > No. start == 0 is MAX_ORDER-aligned. We want to free the pages in the > > largest chunks alignment allows. > > Right. Before the changes to MAX_ORDER it was > > order = min(MAX_ORDER - 1UL, __ffs(start)); > > which would evaluate to 10. > > I'd just prefer the comment to include the explanation about why we choose > MAX_ORDER for start == 0. Say > > /* > * __ffs() behaviour is undefined for 0 and we want to free the > * pages in the largest chunks alignment allows, so set order to > * MAX_ORDER when start == 0 > */ Meanwhile I'd like to fix "various boot failures (hang) on arm targets" in -next, so I queued up Kirill's informal fix for now.