Commit b6164bc
committed
Perftest: Add dynamic CQE polling mechanism
This commit introduces a dynamic CQE polling mechanism that
automatically adjusts the number of completion queue entries (CQEs)
polled in each iteration,
based on the actual completion rate.
The feature aims to optimize polling performance by matching
the poll batch size to the workload characteristics.
Key features:
- Starts with maximum poll size (1024) and adjusts down based on usage
- Adapts within first 25% of iterations or max(1000, num_qps * 3)
iterations.
- Uses threshold of 85% to determine if current size is appropriate
- Stabilizes after 10 consecutive stable iterations
- Configurable min (16), max (1024) sizes
The adaptation works by:
1. If completions == current_size: increase size by step
2. If completions < 85% of current_size: decrease size by step
3. If same completion count for 10 iterations: lock at current size
4. After adaptation period: continue with last stable size
Limitations and special cases:
- Supported over BW tests only.
- Not supported in bidirectional send/write_with_imm tests
- Disabled for small iteration counts (< 3000) to avoid overhead
The feature can be disabled using --disable_dynamic_polling flag.
Implementation details:
- Centralizes polling logic in poll_cq_adaptive() function
- Uses dyn_poll_ctx to manage configuration and state
- Maintains separate RX/TX adaptation for bidirectional tests
- Preserves existing CQE poll behavior when disabled
Example usage:
$ ib_send_bw # Dynamic polling enabled by default
$ ib_send_bw --disable_dynamic_polling # Use fixed polling size
Signed-off-by: Shmuel Shaul <[email protected]>1 parent b86c061 commit b6164bc
File tree
4 files changed
+186
-12
lines changed- src
4 files changed
+186
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
473 | 476 | | |
474 | 477 | | |
475 | 478 | | |
| |||
1003 | 1006 | | |
1004 | 1007 | | |
1005 | 1008 | | |
| 1009 | + | |
1006 | 1010 | | |
1007 | 1011 | | |
1008 | 1012 | | |
| |||
2011 | 2015 | | |
2012 | 2016 | | |
2013 | 2017 | | |
2014 | | - | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
2015 | 2028 | | |
2016 | 2029 | | |
2017 | 2030 | | |
| |||
2597 | 2610 | | |
2598 | 2611 | | |
2599 | 2612 | | |
| 2613 | + | |
2600 | 2614 | | |
2601 | 2615 | | |
2602 | 2616 | | |
| |||
2784 | 2798 | | |
2785 | 2799 | | |
2786 | 2800 | | |
| 2801 | + | |
2787 | 2802 | | |
2788 | 2803 | | |
2789 | 2804 | | |
| |||
3540 | 3555 | | |
3541 | 3556 | | |
3542 | 3557 | | |
| 3558 | + | |
| 3559 | + | |
| 3560 | + | |
| 3561 | + | |
| 3562 | + | |
3543 | 3563 | | |
3544 | 3564 | | |
3545 | 3565 | | |
| 3566 | + | |
3546 | 3567 | | |
3547 | 3568 | | |
3548 | 3569 | | |
| |||
4017 | 4038 | | |
4018 | 4039 | | |
4019 | 4040 | | |
4020 | | - | |
| 4041 | + | |
| 4042 | + | |
| 4043 | + | |
| 4044 | + | |
| 4045 | + | |
4021 | 4046 | | |
4022 | 4047 | | |
4023 | 4048 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
678 | 678 | | |
679 | 679 | | |
680 | 680 | | |
| 681 | + | |
681 | 682 | | |
682 | 683 | | |
683 | 684 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
38 | 108 | | |
39 | 109 | | |
40 | 110 | | |
| |||
3774 | 3844 | | |
3775 | 3845 | | |
3776 | 3846 | | |
| 3847 | + | |
| 3848 | + | |
| 3849 | + | |
| 3850 | + | |
| 3851 | + | |
| 3852 | + | |
3777 | 3853 | | |
3778 | 3854 | | |
3779 | 3855 | | |
3780 | 3856 | | |
3781 | 3857 | | |
3782 | | - | |
| 3858 | + | |
3783 | 3859 | | |
3784 | 3860 | | |
3785 | 3861 | | |
| |||
3932 | 4008 | | |
3933 | 4009 | | |
3934 | 4010 | | |
3935 | | - | |
| 4011 | + | |
| 4012 | + | |
| 4013 | + | |
| 4014 | + | |
| 4015 | + | |
| 4016 | + | |
| 4017 | + | |
| 4018 | + | |
3936 | 4019 | | |
3937 | 4020 | | |
3938 | 4021 | | |
| |||
3975 | 4058 | | |
3976 | 4059 | | |
3977 | 4060 | | |
3978 | | - | |
| 4061 | + | |
3979 | 4062 | | |
3980 | 4063 | | |
3981 | 4064 | | |
| |||
4026 | 4109 | | |
4027 | 4110 | | |
4028 | 4111 | | |
| 4112 | + | |
| 4113 | + | |
| 4114 | + | |
| 4115 | + | |
| 4116 | + | |
| 4117 | + | |
4029 | 4118 | | |
4030 | 4119 | | |
4031 | 4120 | | |
4032 | 4121 | | |
4033 | 4122 | | |
4034 | | - | |
| 4123 | + | |
4035 | 4124 | | |
4036 | 4125 | | |
4037 | 4126 | | |
| |||
4074 | 4163 | | |
4075 | 4164 | | |
4076 | 4165 | | |
4077 | | - | |
| 4166 | + | |
| 4167 | + | |
| 4168 | + | |
| 4169 | + | |
| 4170 | + | |
| 4171 | + | |
| 4172 | + | |
4078 | 4173 | | |
4079 | 4174 | | |
4080 | 4175 | | |
| |||
4205 | 4300 | | |
4206 | 4301 | | |
4207 | 4302 | | |
4208 | | - | |
| 4303 | + | |
4209 | 4304 | | |
4210 | 4305 | | |
4211 | 4306 | | |
| |||
4245 | 4340 | | |
4246 | 4341 | | |
4247 | 4342 | | |
4248 | | - | |
| 4343 | + | |
| 4344 | + | |
| 4345 | + | |
| 4346 | + | |
| 4347 | + | |
| 4348 | + | |
| 4349 | + | |
4249 | 4350 | | |
4250 | 4351 | | |
4251 | 4352 | | |
| |||
4307 | 4408 | | |
4308 | 4409 | | |
4309 | 4410 | | |
4310 | | - | |
| 4411 | + | |
| 4412 | + | |
| 4413 | + | |
| 4414 | + | |
| 4415 | + | |
| 4416 | + | |
4311 | 4417 | | |
4312 | 4418 | | |
4313 | 4419 | | |
| |||
4336 | 4442 | | |
4337 | 4443 | | |
4338 | 4444 | | |
| 4445 | + | |
4339 | 4446 | | |
4340 | 4447 | | |
4341 | 4448 | | |
| |||
4361 | 4468 | | |
4362 | 4469 | | |
4363 | 4470 | | |
4364 | | - | |
| 4471 | + | |
| 4472 | + | |
| 4473 | + | |
| 4474 | + | |
| 4475 | + | |
| 4476 | + | |
| 4477 | + | |
4365 | 4478 | | |
4366 | 4479 | | |
4367 | 4480 | | |
| |||
4394 | 4507 | | |
4395 | 4508 | | |
4396 | 4509 | | |
4397 | | - | |
| 4510 | + | |
| 4511 | + | |
| 4512 | + | |
| 4513 | + | |
| 4514 | + | |
| 4515 | + | |
4398 | 4516 | | |
4399 | 4517 | | |
4400 | 4518 | | |
| |||
4475 | 4593 | | |
4476 | 4594 | | |
4477 | 4595 | | |
| 4596 | + | |
4478 | 4597 | | |
4479 | 4598 | | |
4480 | 4599 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
148 | 155 | | |
149 | 156 | | |
150 | 157 | | |
| |||
168 | 175 | | |
169 | 176 | | |
170 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
171 | 200 | | |
172 | 201 | | |
173 | 202 | | |
| |||
0 commit comments