mirror of
https://github.com/rdmsr/zag.git
synced 2026-10-31 07:18:22 +00:00
ke/smr: allow invalid sequences in deferred_advance_commit
This was buggy when the race was lost and it ended up trying to commit a deferred advance of 0, now explicitly make the magazine's sequence invalid and do nothing in deferred_advance_commit, avoiding an integer underflow.
This commit is contained in:
@@ -792,6 +792,10 @@ pub const Zone = struct {
|
||||
// We lost the race. If the magazine we got was fully filled,
|
||||
// then put it in the depot. Otherwise, dispose of it.
|
||||
if (cnt == magazine_size.load()) {
|
||||
// Ensure this magazine isn't counted as a freed one,
|
||||
// it is instantly reclaimable.
|
||||
nm.seq = ke.smr.seq_invalid;
|
||||
|
||||
Depot.free(nm, &cpu.depot.full_mags, self.reuse_policy);
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user