commit f3c5c1bfd4 (netfilter: xtables: make ip_tables reentrant) introduced a performance regression, because stackptr array is shared by all cpus, adding cache line ping pongs. (16 cpus share a 64 bytes cache line) Fix this using alloc_percpu()
Showing the changes to include/linux (1 of 4 files). Show all
Unified · Split
| @@ -397,7 +397,7 @@ struct xt_table_info { · 396 unmodified lines | |||
| 397 | * @stacksize jumps (number of user chains) can possibly be made. | 397 | * @stacksize jumps (number of user chains) can possibly be made. |
| 398 | */ | 398 | */ |
| 399 | unsigned int stacksize; | 399 | unsigned int stacksize; |
| 400 | unsigned int *stackptr; | 400 | unsigned int __percpu *stackptr; |
| 401 | void ***jumpstack; | 401 | void ***jumpstack; |
| 402 | /* ipt_entry tables: one per CPU */ | 402 | /* ipt_entry tables: one per CPU */ |
| 403 | /* Note : this field MUST be the last one, see XT_TABLE_INFO_SZ */ | 403 | /* Note : this field MUST be the last one, see XT_TABLE_INFO_SZ */ |