-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: BatchIt #637
WIP: BatchIt #637
Conversation
8debce9
to
a26a036
Compare
Looks like it is leaking in some case |
81147f0
to
998c2f4
Compare
Whoops; I had the loop termination conditions wrong. They're fixed now, I think. Let's see if CI agrees. |
998c2f4
to
a145509
Compare
After discussions with @mjp41 yesterday, I've introduced a notion of "tweakable obfuscation" and have made all the intra-slab free lists' backwards signatures use the address of the slab metadata as the "tweak". The next step would be to remove the per-thread keys and have everyone use a common global key (probably not |
45dce78
to
86683a0
Compare
86683a0
to
6f4097c
Compare
b6ae5fc
to
769809d
Compare
We should:
|
e8df24b
to
27195f3
Compare
OK, here's a version with, I think, all todo-s at least prototyped. BatchIt can be turned off (see the "Make BatchIt optional" commit and/or CMakeLists.txt) and it now attempts to play nicely with |
0bc5166
to
1520b2d
Compare
4ce7feb
to
d69cbc4
Compare
Plumb its use around remoteallocator and remotecache
This prepares the recipient to process a batched message.
Exercise recipient machinery by having the senders collect adjacent frees to the same slab into a batch.
This might involve multiple (I think at most two, at the moment) transitions in the slab lifecycle state machine. Towards that end, return indicators to the caller that the slow path must be taken and how many objects of the original set have not yet been counted as returned.
We can, as Matt so kindly reminds me, go get them from the pagemap. Since we need this value only when closing a ring, the read from over there is probably not very onerous. (We could also get the slab pointer from an object in the ring, but we need that whenever inserting into the cache, so it's probably more sensible to store that locally?)
Move ring set bits and associativity knobs to allocconfig and expose them via CMake. If associtivity is zero, use non-batched implementations of the RemoteMessage and RemoteDeallocCacheBatching classes. By default, kick BatchIt on when we have enough room in the minimum allocation size to do it. Exactly how much space is enough is a function of which mitigations we have enabled and whether or not we are compiling with C++20.
There's no need for a full pointer here, it'd just make the structure larger on CHERI.
In order not to thwart `mitigations(random_preserve)` too much, if it's on in combination with BatchIt, roll the dice every time we append to a batch to decide if we should stochastically evict this batch. By increasing the number of batches, we allow the recipient allocator increased opportunity to randomly stripe batches across the two `freelist::Builder` segments associated with each slab.
d69cbc4
to
eef5b91
Compare
Rebased after merging #675. Trees are identical, just commit objects differ. |
As part of the assessment of #634, but also perhaps more generally useful. Opinions welcome.