Reputation: 16837
I am reading the freeBSD book authored by Marshall McKusick and George Neville-Neil. In the kernel memory management, it mentions the following about zone allocator:
Each memory type is given its own zone from which all its allocations are made. Memory allocated in one zone cannot be used by any other zone or by the general memory allocator.
My question is:
1) What memory types are being referred here ?
2) What is meant by the different zones in context of zone allocator ?
If someone can also provide some reference that explains this better, it would be appreciated.
Thanks.
Upvotes: 1
Views: 1173
Reputation: 1461
The zone allocator in FreeBSD is uma(9).
From the manual page:
The zone allocator first appeared in FreeBSD 3.0. It was radically changed in FreeBSD 5.0 to function as a slab allocator.
A zone is similar to a memory arena/region in a memory pool, but as the manual page mentions, with slab allocator-like features. As your quote implies, you cannot uma_zalloc()
from one zone and then uma_zfree()
that chunk into a different zone. That'd screw with the internal bookkeeping.
As for memory types, I assume it refers to different kernel structures, where different kernel structures would probably have one zone each.
Upvotes: 2