You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use 5-byte compressed pointer in FreeList in AllocationClass
Summary:
We set 5-byte compressed pointer as default when managing free allocations in this allocation class. This allows us to avoid templating this class which can lead to cascading templates which would make the codebase complex.
Ran a canary with the change:
https://www.internalfb.com/canvas/document/1516951625859179
Now can we warm roll this change? To know this we will look at the codepath that persists and loads the code back.
1. The list of allocation for an allocation class is stored as a SList. This is where we saveState() of an SList so that we can load it back up. https://www.internalfb.com/code/fbsource/[1cf1875e8c22]/fbcode/cachelib/allocator/datastruct/SList.h?lines=109. It converts a CompressedPointer to a int64_t to store as thrift object.
2. This int64_t that was serialized is read back here: https://www.internalfb.com/code/fbsource/[1cf1875e8c22]/fbcode/cachelib/allocator/datastruct/SList.h?lines=88.
We have shown in the tests that if we persist with a 4-byte compressed pointer which will be stored as int64_t and read it back as a 5-byte compressed pointer, the value will be equivalent meaning both 4-byte and 5-byte compressed pointer will point to the same slab.
Note that an item still uses the 4-byte compressed pointer so during serializing everything will be considered a 4-byte compressed pointer except for the list of allocations in AllocationClass.
Reviewed By: haowu14
Differential Revision: D64539341
fbshipit-source-id: c141ace3655deed62f2c22bfaddbb2917ae2684a
0 commit comments