[haiku-development] Re: heap freelist problem?

  • From: "Jonas Sundström" <jonas@xxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 03 Feb 2008 19:42:09 +0100 CET

"Michael Lotz" <mmlr@xxxxxxxx> wrote:
 ...
> It would be possible to check if a whole chunk is 
> now in the freelist and all the allocated pages could
> be freed now, but this would require some algorithms
> I doubt will be implemented since 
> the allocator is going to be replaced anyway...

Would it be worthwhile having a kernel thread or some 
other not so very periodic routine to try (for as long as we
want the PARANOID_KFREE) to remove empty bins?

I don't think the routine to find empty bins would have to be
complex, and I'm guessing its thread, or whatever, could be
scheduled with a frequency of seconds or less.

As an alternative to directly removing bins, one could have
them age and convert them to larger element bins over time, 
with fewer elements and thus shorter freelists, and eventually
remove the expired, empty 2048 byte size bins, given a 4kb
page size. Would that make sense?

/Jonas.


Other related posts: