Page MenuHomeFreeBSD

Allow powers-of-two differences for free blocks in vm_phys buddy system allocator
Needs ReviewPublic

Authored by dougm on Nov 13 2017, 9:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 19 2024, 6:43 AM
Unknown Object (File)
Dec 20 2023, 7:04 AM
Unknown Object (File)
Nov 7 2023, 10:37 AM
Unknown Object (File)
Nov 7 2023, 12:42 AM
Unknown Object (File)
Oct 31 2023, 2:31 PM
Unknown Object (File)
Oct 6 2023, 9:33 AM
Unknown Object (File)
Oct 5 2023, 11:37 PM
Unknown Object (File)
Sep 29 2023, 2:31 PM
Subscribers
None
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

Avoid multiple two-way splits to get from a large power-of-two free block to a small one, and instead maintain lists of free blocks of sizes that are differences of powers of two (or, equivalently, sequences of consecutive powers of two).

This increases the number of free lists to be examined, so add a bitmask to quickly identify nonempty free lists.

Select a superblock (sequence of consecutive powers-of-two blocks of increasing size) to split by seeking first a superblock from which the desired allocation can be made without increasing the number of free superblocks.

For merging free superblocks, maintain in the first and last order fields of a free superblock the largest and smallest block orders for the blocks in the superblock sequence. That allows a newly freed block to be combined with a superblock on its left in constant time.

For allocating a number of pages smaller than the maximum block size, find the best fitting superblock.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped