Skip to content

Commit a1a610a

Browse files
committed
[libc] Increase the number of times we wait on a slab
Summary: This wait restricts how long we wait on a slab. The only reason this isn't an infinite loop is to prevent complete deadlocks. However, this limit was *just* on the cusp of waiting long enough for the allocation to be done. Just increase this to a sufficiently large value, because this limit only exists to keep the interface wait-free in the absolute worst case scheduling scenario. This *MASSIVELY* improved performance for mixed allocations as we no longer shuffled around creating more than necessary.
1 parent a764900 commit a1a610a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libc/src/__support/GPU/allocator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ constexpr static uint32_t MIN_SIZE = 16;
3737
constexpr static uint32_t MIN_ALIGNMENT = MIN_SIZE - 1;
3838

3939
// The number of times to attempt claiming an in-progress slab allocation.
40-
constexpr static uint32_t MAX_TRIES = 128;
40+
constexpr static uint32_t MAX_TRIES = 1024;
4141

4242
// A sentinel used to indicate an invalid but non-null pointer value.
4343
constexpr static uint64_t SENTINEL = cpp::numeric_limits<uint64_t>::max();

0 commit comments

Comments
 (0)