Commit f969fb7
authored
distinguish file backend thread names across backend instances (#997)
A `FileBackend` spawns some number of threads to actually handle I/Os
once it's eventually attached to a device that supports block
operations. Those names were just `worker N`, though, and typically all
file backends were created with the same number of workers, so a running
Propolis would have `num-file-backend` threads named `worker 0`,
`worker 1`, etc. This made finding which threads you care about
somewhat more complicated than it needs to be.
Instead, include a block backend ID, and plumb that to file backends to
use in worker thread names. Now, for example:
```
$ pstack 28651 | grep 'worker 0'
------- thread# 21 / lwp# 21 [file backend 0/worker 0] -------
------- thread# 29 / lwp# 29 [file backend 1/worker 0] -------
------- thread# 45 / lwp# 45 [file backend 2/worker 0] -------
------- thread# 49 / lwp# 49 [file backend 3/worker 0] -------
------- thread# 53 / lwp# 53 [file backend 4/worker 0] -------
------- thread# 57 / lwp# 57 [file backend 5/worker 0] -------
------- thread# 61 / lwp# 61 [file backend 6/worker 0] -------
------- thread# 65 / lwp# 65 [file backend 7/worker 0] -------
------- thread# 69 / lwp# 69 [file backend 8/worker 0] -------
------- thread# 73 / lwp# 73 [file backend 9/worker 0] -------
------ thread# 77 / lwp# 77 [file backend 10/worker 0] -------
```
yippee! yay!
Having `type DeviceId = u32; type BackendId = u32` made me pretty
suspicious we (I) would accidentally pass one where I meant the other
and produce confusing probe output, so this comes with a new `define_id`
macro to newtype the ID and provide a bit of glue to make it useful.
This brings `hw::nvme::DeviceId` along for the change and gives a
hopefully-more-obvious home for what these IDs are, are not, and how
they relate - in particular, that while a VM consisting only of N NVMe
disks, today, will have NVMe controllers 0..N with block devices 0..N
and block backends 0..N, where each `i` is related to "the same thing",
this is not at all reliable. Today, one could flip an NVMe disk to
virtio-block and change NVMe->block mappings, while tomrorow we might
make devices concurrently and be totally nondeterministic!1 parent dfb7f68 commit f969fb7
File tree
11 files changed
+210
-49
lines changed- lib/propolis
- src
- block
- hw/nvme
- util
11 files changed
+210
-49
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
141 | 142 | | |
142 | 143 | | |
143 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
| 29 | + | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | 43 | | |
49 | 44 | | |
50 | 45 | | |
| |||
381 | 376 | | |
382 | 377 | | |
383 | 378 | | |
| 379 | + | |
384 | 380 | | |
385 | 381 | | |
386 | 382 | | |
| |||
431 | 427 | | |
432 | 428 | | |
433 | 429 | | |
| 430 | + | |
434 | 431 | | |
435 | 432 | | |
436 | 433 | | |
| |||
458 | 455 | | |
459 | 456 | | |
460 | 457 | | |
| 458 | + | |
461 | 459 | | |
462 | 460 | | |
463 | 461 | | |
| |||
467 | 465 | | |
468 | 466 | | |
469 | 467 | | |
470 | | - | |
471 | | - | |
| 468 | + | |
| 469 | + | |
472 | 470 | | |
473 | 471 | | |
474 | 472 | | |
475 | 473 | | |
476 | 474 | | |
| 475 | + | |
477 | 476 | | |
478 | 477 | | |
479 | 478 | | |
| |||
560 | 559 | | |
561 | 560 | | |
562 | 561 | | |
563 | | - | |
| 562 | + | |
564 | 563 | | |
| 564 | + | |
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
| |||
678 | 678 | | |
679 | 679 | | |
680 | 680 | | |
681 | | - | |
| 681 | + | |
682 | 682 | | |
683 | | - | |
| 683 | + | |
684 | 684 | | |
685 | 685 | | |
686 | 686 | | |
| |||
720 | 720 | | |
721 | 721 | | |
722 | 722 | | |
723 | | - | |
| 723 | + | |
724 | 724 | | |
725 | 725 | | |
726 | 726 | | |
727 | 727 | | |
728 | 728 | | |
729 | | - | |
| 729 | + | |
730 | 730 | | |
731 | 731 | | |
732 | 732 | | |
| |||
967 | 967 | | |
968 | 968 | | |
969 | 969 | | |
970 | | - | |
| 970 | + | |
971 | 971 | | |
972 | 972 | | |
973 | 973 | | |
974 | 974 | | |
975 | 975 | | |
976 | | - | |
| 976 | + | |
977 | 977 | | |
978 | 978 | | |
979 | 979 | | |
| |||
1155 | 1155 | | |
1156 | 1156 | | |
1157 | 1157 | | |
| 1158 | + | |
1158 | 1159 | | |
1159 | 1160 | | |
1160 | 1161 | | |
| |||
1165 | 1166 | | |
1166 | 1167 | | |
1167 | 1168 | | |
| 1169 | + | |
1168 | 1170 | | |
1169 | 1171 | | |
1170 | 1172 | | |
| |||
1182 | 1184 | | |
1183 | 1185 | | |
1184 | 1186 | | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
1185 | 1191 | | |
1186 | 1192 | | |
1187 | 1193 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| 212 | + | |
212 | 213 | | |
213 | 214 | | |
214 | 215 | | |
215 | 216 | | |
216 | 217 | | |
217 | 218 | | |
218 | | - | |
| 219 | + | |
219 | 220 | | |
220 | 221 | | |
221 | 222 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
| |||
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
44 | 50 | | |
45 | 51 | | |
46 | 52 | | |
| |||
181 | 187 | | |
182 | 188 | | |
183 | 189 | | |
184 | | - | |
185 | 190 | | |
186 | 191 | | |
187 | 192 | | |
188 | 193 | | |
189 | | - | |
| 194 | + | |
190 | 195 | | |
191 | 196 | | |
192 | 197 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
39 | 45 | | |
40 | 46 | | |
41 | 47 | | |
| |||
58 | 64 | | |
59 | 65 | | |
60 | 66 | | |
61 | | - | |
| 67 | + | |
62 | 68 | | |
63 | 69 | | |
64 | 70 | | |
| |||
885 | 891 | | |
886 | 892 | | |
887 | 893 | | |
888 | | - | |
| 894 | + | |
889 | 895 | | |
890 | 896 | | |
891 | 897 | | |
| |||
0 commit comments