freebsd-nq/sys
Alan Cox ec371b57e8 Modify blst_leaf_alloc to take only the cursor argument.
Modify blst_leaf_alloc to find allocations that cross the boundary between
one leaf node and the next when those two leaves descend from the same
meta node.

Update the hint field for leaves so that it represents a bound on how
large an allocation can begin in that leaf, where it currently represents
a bound on how large an allocation can be found within the boundaries of
the leaf.

The first phase of blst_leaf_alloc currently shrinks sequences of
consecutive 1-bits in mask until each has been shrunken by count-1 bits,
so that any bits remaining show where an allocation can begin, or until
all the bits have disappeared, in which case the allocation fails. This
change amends that so that the high-order bit is copied, as if, when the
last block was free, it was followed by an endless stream of free
blocks. It also amends the early stopping condition, so that the shrinking
of 1-sequences stops early when there are none, or there is only one
unbounded one remaining.

The search for the first set bit is unchanged, and the code path
thereafter is mostly unchanged unless the first set bit is in a position
that makes some of those copied sign bits matter. In that case, we look
for a next leaf, and at what blocks it can provide, to see if a
cross-boundary allocation is possible.

The hint is updated on a successful allocation that clears the last bit,
but it not updated on a failed allocation that leaves the last bit
set. So, as long as the last block is free, the hint value for the leaf is
large. As long as the last block is free, and there's a next leaf, a large
allocation can begin here, perhaps. A stricter rule than this would mean
that allocations and frees in one leaf could require hint updates to the
preceding leaf, and this change seeks to leave the freeing code
unmodified.

Define BLIST_BMAP_MASK, and use it for bit masking in blst_leaf_free and
blist_leaf_fill, as well as in blst_leaf_alloc.

Correct a panic message in blst_leaf_free.

Submitted by:	Doug Moore <dougm@rice.edu>
Reviewed by:	markj (an earlier version)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D11819
2017-09-16 18:12:15 +00:00
..
amd64 Add MMCCAM-enabled kernel config for IMX6, reduce debug noice in MMCCAM kernels 2017-09-13 10:56:02 +00:00
arm Allwinner usb phy: Rework resource allocation 2017-09-16 15:58:20 +00:00
arm64 Add the ARMv8.3 ID register fields. These were found in the A-Profile 2017-09-15 12:57:34 +00:00
boot loader: biosmem.c cstyle cleanup 2017-09-14 16:42:29 +00:00
bsm
cam Allow multiple TRIMs to be done for nda 2017-09-15 20:16:06 +00:00
cddl dounmount: do not release the mount point's reference on the covered vnode 2017-09-14 08:47:06 +00:00
compat Only search the scope ID in ip6_find_dev() for IPv6 addresses which 2017-09-09 12:50:12 +00:00
conf Miscellaneous fixes and improvements to MMCCAM stack 2017-09-15 19:47:44 +00:00
contrib octeon sdk: initialize variable to quiet Clang warning 2017-09-14 16:41:22 +00:00
crypto aesni: quiet -Wcast-qual 2017-08-16 22:54:35 +00:00
ddb Rename mkdumpheader() and group EKCD functions in kern_shutdown.c. 2017-08-18 04:04:09 +00:00
dev Revert r323516 (iflib rollup) 2017-09-16 02:41:38 +00:00
fs Style. 2017-08-28 21:04:56 +00:00
gdb
geom gmirror: treat ENXIO as disk disconnect, not media error 2017-09-15 13:57:08 +00:00
gnu
i386 Revert r323087 2017-09-01 17:03:48 +00:00
isa Use better hard-coded defaults for the cursor shape, and remove nearby 2017-08-19 19:33:16 +00:00
kern Modify blst_leaf_alloc to take only the cursor argument. 2017-09-16 18:12:15 +00:00
kgssapi
libkern x86/crc32_sse42.c: quiet unused function warning 2017-08-11 17:05:31 +00:00
mips Add MIPS32/64 Rev2 CP0 intctl register definitions. 2017-09-15 19:56:21 +00:00
modules Add a missing header file to SRCS to fix out-of-kernel builds. 2017-09-16 16:09:05 +00:00
net Revert r323516 (iflib rollup) 2017-09-16 02:41:38 +00:00
net80211 net80211: fix a typo (premable -> preamble). 2017-08-27 22:13:03 +00:00
netgraph
netinet Export the UDP encapsualation port and the path state. 2017-09-12 21:08:50 +00:00
netinet6 Fix a locking issue found by Coverity scanning the usrsctp library. 2017-09-09 20:51:54 +00:00
netipsec Fix possible double releasing for SA reference. 2017-09-01 11:51:07 +00:00
netpfil pf_get_sport(): Prevent possible endless loop when searching for an unused nat port 2017-08-08 21:09:26 +00:00
netsmb
nfs Improve FHA locality control for NFS read/write requests. 2017-07-31 15:23:19 +00:00
nfsclient
nfsserver
nlm
ofed Remove unsafe access to the LinuxKPI file structure from ibcore. 2017-09-09 06:34:20 +00:00
opencrypto
powerpc Add AT_HWCAP and AT_EHDRFLAGS on all platforms. 2017-09-14 14:26:55 +00:00
riscv Add AT_HWCAP and AT_EHDRFLAGS on all platforms. 2017-09-14 14:26:55 +00:00
rpc
security Sprinkle __read_frequently on few obvious places. 2017-09-06 20:33:33 +00:00
sparc64 Add AT_HWCAP and AT_EHDRFLAGS on all platforms. 2017-09-14 14:26:55 +00:00
sys Revert r323516 (iflib rollup) 2017-09-16 02:41:38 +00:00
teken Fix syscons escape sequence for setting the local cursor type. This sequence 2017-08-18 15:40:40 +00:00
tests
tools
ufs The new fsck recovery information to enable it to find backup 2017-09-04 20:19:36 +00:00
vm Batch freeing of the pages in vm_object_page_remove() under the same 2017-09-15 16:07:09 +00:00
x86 Add AT_EHDRFLAGS and AT_HWCAP on amd64. 2017-09-14 15:34:29 +00:00
xdr
xen
Makefile