Commit 7c85749
add admin slab release command
Summary:
Adds a new `release-ac-slabs` admin command to the ucache admin command handler that releases slabs from a specified allocation class back to the pool via CacheLib's `releaseSlab()` API.
**Usage:**
```
uc release-ac-slabs <class_id> [--count N]
```
**Arguments:**
- `class_id` — allocation class index (0-based)
- `--count N` — number of slabs to release (default: 1)
**Example:**
```
uc release-ac-slabs 5 --count 3
```
This releases 3 slabs from allocation class 5. Each slab release is timed and logged individually. If a release fails, the command stops and reports the error.
To make `CacheAllocator::releaseSlab()` accessible from ucache, `UcacheAdminCommandHandler` is added as a friend class in `CacheAllocator.h`, keeping the method private rather than exposing it publicly.
Reviewed By: AlnisM
Differential Revision: D100408757
fbshipit-source-id: 17217df0c54f4820e3f11102653b2755306cbe851 parent 1de8715 commit 7c85749
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1908 | 1908 | | |
1909 | 1909 | | |
1910 | 1910 | | |
| 1911 | + | |
1911 | 1912 | | |
1912 | 1913 | | |
1913 | 1914 | | |
| |||
1959 | 1960 | | |
1960 | 1961 | | |
1961 | 1962 | | |
| 1963 | + | |
1962 | 1964 | | |
1963 | 1965 | | |
1964 | 1966 | | |
| |||
0 commit comments