Commit 52a2fcc
IoUringDynamicProvidedBufferRing: fix empty-ring area handoff
Summary:
When the dynamic provided buffer ring reaches its area limit while buffers are
still held, the kernel ring can drain completely. If an older area subsequently
becomes reusable, refill selects it as `bufferRefillArea_`, but
`bufferActiveArea_` remains on the previously exhausted area because no
completion remains to perform the normal end-of-area handoff.
The next completion then wraps memory from the stale active area instead of the
area posted to the kernel. Returns are also charged to the wrong area, which can
allow an area with live IOBufs to be reclaimed.
When refilling an empty ring, make the selected refill area active before
publishing its descriptors.
Reviewed By: jlhe97
Differential Revision: D116800599
fbshipit-source-id: fcb815fa1ae1afa5323e1ae4bdd7ceb8f5cf39081 parent 00576b7 commit 52a2fcc
2 files changed
Lines changed: 39 additions & 0 deletions
File tree
- third-party/folly/src/folly/io/async
- test
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
275 | 279 | | |
276 | 280 | | |
277 | 281 | | |
| |||
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
| |||
725 | 729 | | |
726 | 730 | | |
727 | 731 | | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
728 | 763 | | |
0 commit comments