[PR #199] move nextAvail back as much as possible #322

Open
opened 2026-10-26 09:48:39 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/deepseek-ai/3FS/pull/199
Author: @symious
Created: 3/20/2025
Status: 🔄 Open

Base: main ← Head: dealloc_back


📝 Commits (3)

📊 Changes

1 file changed (+4 additions, -3 deletions)

View changed files

📝 src/common/utils/AtomicSharedPtrTable.h (+4 -3)

📄 Description

The original code won't move the nextAvail.

Say we have 5 slots, and all allocated.
T1. nextAvail = 5, free = {}
T2. dealloc(2), nextAvail = 5, free = {2}
T3. dealloc(3), nextAvail = 5, free = {2, 3}
T4. dealloc(4)

  1. 4 == nextAvail - 1, so check while
  2. free.find(--nextAvail), which is free.find(4) is free.end(), so returned directly.

Or is it because of performance issue to remove the free.erase logic here? If so we don't need to while check here.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/deepseek-ai/3FS/pull/199 **Author:** [@symious](https://github.com/symious) **Created:** 3/20/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `dealloc_back` --- ### 📝 Commits (3) - [`c712ce1`](https://github.com/deepseek-ai/3FS/commit/c712ce1480014a23c9c54a89a0fba71456d3b31b) move back AMAP - [`d689e10`](https://github.com/deepseek-ai/3FS/commit/d689e1009dbeeba812c17f49a62cdb371011bd20) change indent - [`55c7f3f`](https://github.com/deepseek-ai/3FS/commit/55c7f3fae2258c69605a0d7e57fcb3aa82dab38a) change to prefix operator ### 📊 Changes **1 file changed** (+4 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/common/utils/AtomicSharedPtrTable.h` (+4 -3) </details> ### 📄 Description The original code won't move the nextAvail. Say we have 5 slots, and all allocated. T1. nextAvail = 5, free = {} T2. dealloc(2), nextAvail = 5, free = {2} T3. dealloc(3), nextAvail = 5, free = {2, 3} T4. dealloc(4) 1. 4 == nextAvail - 1, so check while 2. free.find(--nextAvail), which is free.find(4) is free.end(), so returned directly. Or is it because of performance issue to remove the free.erase logic here? If so we don't need to while check here. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/3FS#322
No description provided.