Having a function guess the caller is a bit of an anti-pattern. The
resulting code is hard to follow, and it's very easy to
unintentionally burden some cases with unnecessary stuff. It's better
to unshare paths until you don't need conditionals like this.
> > In addition to the fastpath, I think you're also punishing the
move_freepages_block_isolate() case. We *know* we just changed the
type of one of the buddy's blocks, and yet you're still checking the
the range again to decide whether to split.
Yes, that's not ideal, and it would be easy to unshare that case (call
the "split" function instead of a "maybe_split" function).
I am not 100% sure though, if move_freepages_block_isolate() can always
decide "I really have a mixture", but that code is simply quite advanced :)
I played with it, and I think we can indeed assume that
move_freepages_block_isolate() will always have to split.
--
Cheers,
David / dhildenb