Sean Khan
849ebc905b
qualcommax: enhance smp_affinity (log, uci, syntax)
1.) Changed logic of `set_affinity` to now use physical cores rather than
knowing the bitmask. Rather than having to know a bitmask, users can
provide a numerical instance of one or more CPU cores
(numbered 0-63).
This is done via function `cpus_to_bitmask`.
Functions Added:
a.) bitmask_to_cpus - Takes a bitmask of CPUs and returns a
list of CPU numbers. (i.e. `bitmask_to_cpus "f"` -> 0,1,2,3)
b.) cpus_to_bitmask - Takes a comma/space or range list of CPUs and returns
a bitmask.
Example:
`cpus_to_bitmask "2,3"` -> c
`cpus_to_bitmask "0,1,2,3"` -> f
`cpus_to_bitmask "1,3"` -> a
With or without quotes
`cpus_to_bitmask "1 3"` -> a
`cpus_to_bitmask 1 3` -> a
2.) Added UCI options:
enable - to enable/disable the script from running. [default 1 (on)]
enable_log - to enable/disable logging output to `logger`.[default 1 (on)]
Log output:
```
Mon Apr 8 23:00:01 2024 user.notice smp_affinity: Pinning IRQ(87) reo2host-destination-ring1 to CPU 0
Mon Apr 8 23:00:01 2024 user.notice smp_affinity: Pinning IRQ(88) reo2host-destination-ring2 to CPU 1
Mon Apr 8 23:00:01 2024 user.notice smp_affinity: Pinning IRQ(89) reo2host-destination-ring3 to CPU 2
Mon Apr 8 23:00:01 2024 user.notice smp_affinity: Pinning IRQ(90) reo2host-destination-ring4 to CPU 3
Mon Apr 8 23:00:01 2024 user.notice smp_affinity: Pinning IRQ(79) wbm2host-tx-completions-ring1 to CPU 1
Mon Apr 8 23:00:01 2024 user.notice smp_affinity: Pinning IRQ(83) wbm2host-tx-completions-ring2 to CPU 2
Mon Apr 8 23:00:01 2024 user.notice smp_affinity: Pinning IRQ(85) wbm2host-tx-completions-ring3 to CPU 3
Mon Apr 8 23:00:01 2024 user.notice smp_affinity: Pinning IRQ(73) ppdu-end-interrupts-mac1 to CPU 1
Mon Apr 8 23:00:01 2024 user.notice smp_affinity: Pinning IRQ(77) ppdu-end-interrupts-mac2 to CPU 2
Mon Apr 8 23:00:01 2024 user.notice smp_affinity: Pinning IRQ(75) ppdu-end-interrupts-mac3 to CPU 3
Mon Apr 8 23:00:01 2024 user.notice smp_affinity: Pinning IRQ(32) edma_txcmpl to CPU 3
Mon Apr 8 23:00:01 2024 user.notice smp_affinity: Pinning IRQ(33) edma_rxfill to CPU 3
Mon Apr 8 23:00:01 2024 user.notice smp_affinity: Pinning IRQ(35) edma_rxdesc to CPU 3
Mon Apr 8 23:00:01 2024 user.notice smp_affinity: Pinning IRQ(36) edma_misc to CPU 3
```
Output of `/proc/interrupts`:
```
69: 0 0 0 0 GIC-0 209 Edge rxdma2host-destination-ring-mac1
70: 0 0 0 0 GIC-0 211 Edge rxdma2host-destination-ring-mac3
71: 0 0 0 0 GIC-0 210 Edge rxdma2host-destination-ring-mac2
72: 2435 0 0 0 GIC-0 321 Edge reo2host-status
73: 268427 8011 0 0 GIC-0 261 Edge ppdu-end-interrupts-mac1
74: 2 0 0 0 GIC-0 255 Edge rxdma2host-monitor-status-ring-mac1
75: 176169 0 4 10035 GIC-0 263 Edge ppdu-end-interrupts-mac3
76: 2 0 0 0 GIC-0 260 Edge rxdma2host-monitor-status-ring-mac3
77: 0 0 0 0 GIC-0 262 Edge ppdu-end-interrupts-mac2
78: 0 0 0 0 GIC-0 256 Edge rxdma2host-monitor-status-ring-mac2
79: 3428 3123 0 0 GIC-0 189 Edge wbm2host-tx-completions-ring1
80: 0 0 0 0 GIC-0 323 Edge reo2ost-exception
81: 178 0 0 0 GIC-0 322 Edge wbm2host-rx-release
82: 0 0 0 0 GIC-0 212 Edge host2rxdma-host-buf-ring-mac1
83: 6524 0 13712 0 GIC-0 190 Edge wbm2host-tx-completions-ring2
84: 4 0 0 0 GIC-0 235 Edge host2rxdma-host-buf-ring-mac3
85: 560 0 0 1979 GIC-0 191 Edge wbm2host-tx-completions-ring3
86: 0 0 0 0 GIC-0 215 Edge host2rxdma-host-buf-ring-mac2
87: 4520 0 0 0 GIC-0 267 Edge reo2host-destination-ring1
88: 2231 2811 0 0 GIC-0 268 Edge reo2host-destination-ring2
89: 2180 0 2512 0 GIC-0 271 Edge reo2host-destination-ring3
90: 1990 0 0 2321 GIC-0 320 Edge reo2host-destination-ring4
```
3.) Added `uci-defaults` script `15_smp_affinity` to configure defaults
options on first boot.
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-04-12 13:22:12 +02:00
..
2024-03-28 13:06:43 +01:00
2024-04-05 09:26:26 +02:00
2024-03-29 09:58:45 +01:00
2024-01-19 21:24:44 +01:00
2024-03-31 18:34:04 +02:00
2024-03-31 18:09:43 +02:00
2024-04-07 22:12:42 +02:00
2024-03-29 00:12:50 +01:00
2024-03-29 13:44:41 +01:00
2024-03-31 18:34:04 +02:00
2024-03-10 20:26:07 +01:00
2024-04-08 21:52:51 +02:00
2024-01-06 12:52:49 +01:00
2024-04-10 18:50:32 +01:00
2024-03-24 21:19:10 +01:00
2024-04-05 14:43:44 -04:00
2024-04-05 17:32:21 +02:00
2023-12-09 14:45:50 +01:00
2024-04-05 09:27:45 +02:00
2024-03-08 14:49:09 +01:00
2024-03-23 20:00:49 +01:00
2024-02-03 04:35:25 +00:00
2024-04-11 13:25:11 +02:00
2024-03-24 21:20:46 +01:00
2024-04-09 14:59:03 +01:00
2024-03-14 14:24:16 +01:00
2024-02-07 14:48:41 +01:00
2024-03-31 18:34:04 +02:00
2024-02-13 19:05:48 +01:00
2024-03-31 18:34:04 +02:00
2024-04-05 15:37:38 +02:00
2023-12-02 14:06:56 +02:00
2024-04-12 13:22:12 +02:00
2024-04-05 07:58:15 +02:00
2024-04-08 21:31:55 +02:00
2024-03-29 19:34:42 +01:00
2023-11-19 16:46:24 +01:00
2024-03-26 21:56:57 +01:00
2024-03-26 21:56:57 +01:00
2024-03-23 21:38:00 +01:00
2024-04-07 11:29:30 +02:00
2024-02-08 23:04:55 +01:00