[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

new allocation algorithm



Hi Linus and Stephen,

I just came up with the idea of using an ext2 like algorithm
for memory allocation, in which we:
- group memory in 128 PAGE groups
- have one unsigned char counter per group, counting the number
  of used pages
- allocate with the goal to fill the busiest group
- penalize pages (page->age) when the group is relatively empty
- thereby shift memory usage from empty groups to full groups, making
  larger allocation in empty groups easier
- PLUS we get rid of the 'randomness' in the current system, where we
  sometimes swap out over half of total memory in one sweep while
  still not reaching our goals

Of course, such an algorithm would be relatively expensive...
But could it be worth it?

Trading off the tradeoffs,

Rik.
+-------------------------------------------+--------------------------+
| Linux: - LinuxHQ MM-patches page          | Scouting       webmaster |
|        - kswapd ask-him & complain-to guy | Vries    cubscout leader |
|     http://www.fys.ruu.nl/~riel/          | <H.H.vanRiel@fys.ruu.nl> |
+-------------------------------------------+--------------------------+