On Tue, Dec 21, 2021 at 09:09:45AM +0100, Jan Beulich wrote: > On 20.12.2021 16:25, Roger Pau Monné wrote: > > I think it might be interesting to add some kind of unit testing to > > this code in tools/tests. It's a standalone piece of code that could > > be easily tested for correct functionality. Not that you should do it > > here, in fact it might be interesting for me to do so in order to > > better understand the code. > > Actually I developed this by first having a user space app where I could > control insertions / removals from the command line. Only once I had it > working that way was when I converted the helper function to what's now > in this header. But that user space app wouldn't directly lend itself to > become an element under tools/tests/, I'm afraid.
Also, I'm curious, did you develop the algorithm yourself, or is there some prior literature about it? I wonder how other OSes deal with this problem if they support coalescing contiguous pages. Thanks, Roger.
