summaryrefslogtreecommitdiffstats
path: root/security/device_cgroup.c
diff options
context:
space:
mode:
authorSabrina Dubroca <sd@queasysnail.net>2018-11-29 14:14:49 +0100
committerDavid S. Miller <davem@davemloft.net>2018-11-29 20:06:08 +0100
commit867d0ad476db89a1e8af3f297af402399a54eea5 (patch)
tree075055a7fd00fe41bc76ba070136c7765cf282c6 /security/device_cgroup.c
parentnet: restore call to netdev_queue_numa_node_write when resetting XPS (diff)
downloadlinux-867d0ad476db89a1e8af3f297af402399a54eea5.tar.xz
linux-867d0ad476db89a1e8af3f297af402399a54eea5.zip
net: fix XPS static_key accounting
Commit 04157469b7b8 ("net: Use static_key for XPS maps") introduced a static key for XPS, but the increments/decrements don't match. First, the static key's counter is incremented once for each queue, but only decremented once for a whole batch of queues, leading to large unbalances. Second, the xps_rxqs_needed key is decremented whenever we reset a batch of queues, whether they had any rxqs mapping or not, so that if we setup cpu-XPS on em1 and RXQS-XPS on em2, resetting the queues on em1 would decrement the xps_rxqs_needed key. This reworks the accounting scheme so that the xps_needed key is incremented only once for each type of XPS for all the queues on a device, and the xps_rxqs_needed key is incremented only once for all queues. This is sufficient to let us retrieve queues via get_xps_queue(). This patch introduces a new reset_xps_maps(), which reinitializes and frees the appropriate map (xps_rxqs_map or xps_cpus_map), and drops a reference to the needed keys: - both xps_needed and xps_rxqs_needed, in case of rxqs maps, - only xps_needed, in case of CPU maps. Now, we also need to call reset_xps_maps() at the end of __netif_set_xps_queue() when there's no active map left, for example when writing '00000000,00000000' to all queues' xps_rxqs setting. Fixes: 04157469b7b8 ("net: Use static_key for XPS maps") Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'security/device_cgroup.c')
0 files changed, 0 insertions, 0 deletions