244f45548a
- zone_large_init() stays pretty much the same. - zone_small_init() will try to stash the slab header in the slab page being allocated if the amount of calculated wasted space is less than UMA_MAX_WASTE (for both the UMA_ZONE_REFCNT case and regular case). If the amount of wasted space is >= UMA_MAX_WASTE, then UMA_ZONE_OFFPAGE will be set and the slab header will be allocated separately for better use of space. - uma_startup() calculates the maximum ipers required in offpage slabs (so that the offpage slab header zone(s) can be sized accordingly). The algorithm used to calculate this replaces the old calculation (which only happened to work coincidentally). We now iterate over possible object sizes, starting from the smallest one, until we determine that wastedspace calculated in zone_small_init() might end up being greater than UMA_MAX_WASTE, at which point we use the found object size to compute the maximum possible ipers. The reason this works is because: - wastedspace versus objectsize is a see-saw function with local minima all equal to zero and local maxima growing directly proportioned to objectsize. This implies that for objects up to or equal a certain objectsize, the see-saw remains entirely below UMA_MAX_WASTE, so for those objectsizes it is impossible to ever go OFFPAGE for slab headers. - ipers (items-per-slab) versus objectsize is an inversely proportional function which falls off very quickly (very large for small objectsizes). - To determine the maximum ipers we'll ever need from OFFPAGE slab headers we first find the largest objectsize for which we are guaranteed to not go offpage for and use it to compute ipers (as though we were offpage). Since the only objectsizes allowed to go offpage are bigger than the found objectsize, and since ipers vs objectsize is inversely proportional (and monotonically decreasing), then we are guaranteed that the ipers computed is always >= what we will ever need in offpage slab headers. - Define UMA_FRITM_SZ and UMA_FRITMREF_SZ to be the actual (possibly padded) size of each freelist index so that offset calculations are fixed. This might fix weird data corruption problems and certainly allows ARM to now boot to at least single-user (via simulator). Tested on i386 UP by me. Tested on sparc64 SMP by fenner. Tested on ARM simulator to single-user by cognet. |
||
---|---|---|
.. | ||
alpha | ||
amd64 | ||
arm | ||
boot | ||
cam | ||
coda | ||
compat | ||
conf | ||
contrib | ||
crypto | ||
ddb | ||
dev | ||
doc | ||
fs | ||
gdb | ||
geom | ||
gnu | ||
i4b | ||
i386 | ||
ia64 | ||
isa | ||
isofs/cd9660 | ||
kern | ||
libkern | ||
modules | ||
net | ||
net80211 | ||
netatalk | ||
netatm | ||
netgraph | ||
netinet | ||
netinet6 | ||
netipsec | ||
netipx | ||
netkey | ||
netnatm | ||
netncp | ||
netsmb | ||
nfs | ||
nfs4client | ||
nfsclient | ||
nfsserver | ||
opencrypto | ||
pc98 | ||
pccard | ||
pci | ||
posix4 | ||
powerpc | ||
rpc | ||
security | ||
sparc64 | ||
sys | ||
tools | ||
ufs | ||
vm | ||
Makefile |