-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
linux-gen: ring: fix ring size detection
Previously, _RING_MPMC_ENQ_MULTI() and _RING_MPMC_ENQ_BATCH() could return zero even though the ring was not actually full. Read w_head before r_tail, which guarantees that w_head - r_tail <= size. Any additional delay in reading r_tail makes the subtraction result only smaller. This avoids returning zero when the ring is not actually full. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reported-by: Fan Hong <fan.hong@arm.com>
- Loading branch information
Showing
1 changed file
with
18 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters