Sabrina Dubroca
9ac607494a
net: fix XPS static_key accounting
...
[ Upstream commit 867d0ad476db89a1e8af3f297af402399a54eea5 ]
Commit 04157469b7 ("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: 04157469b7 ("net: Use static_key for XPS maps")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-17 09:24:29 +01:00
..
datagram.c
Revert "net: simplify sock_poll_wait"
2018-11-04 14:50:51 +01:00
dev.c
net: fix XPS static_key accounting
2018-12-17 09:24:29 +01:00
dev_addr_lists.c
net: change the comment of dev_mc_init
2018-04-19 12:58:20 -04:00
dev_ioctl.c
net: remove redundant input checks in SIOCSIFTXQLEN case of dev_ifsioc
2018-07-24 11:36:15 -07:00
devlink.c
devlink: Add helper function for safely copy string param
2018-10-10 10:19:10 -07:00
drop_monitor.c
treewide: setup_timer() -> timer_setup()
2017-11-21 15:57:07 -08:00
dst.c
netfilter: nf_tables: add tunnel support
2018-08-03 21:12:12 +02:00
dst_cache.c
net: core: dst_cache_set_ip6: Rename 'addr' parameter to 'saddr' for consistency
2018-03-05 12:52:45 -05:00
ethtool.c
ethtool: fix a privilege escalation bug
2018-10-15 21:37:58 -07:00
failover.c
net: Introduce generic failover module
2018-05-28 22:59:54 -04:00
fib_notifier.c
net: Fix fib notifer to return errno
2018-03-29 14:10:30 -04:00
fib_rules.c
fib_rules: NULL check before kfree is not needed
2018-07-30 09:44:06 -07:00
filter.c
bpf: use __GFP_COMP while allocating page
2018-09-12 23:47:28 +02:00
flow_dissector.c
flow_dissector: do not dissect l4 ports for fragments
2018-11-23 08:17:02 +01:00
gen_estimator.c
net: core: protect rate estimator statistics pointer with lock
2018-08-11 12:37:10 -07:00
gen_stats.c
gen_stats: Fix netlink stats dumping in the presence of padding
2018-07-04 14:44:45 +09:00
gro_cells.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
hwbm.c
net: hwbm: Fix unbalanced spinlock in error case
2016-05-25 12:35:09 -07:00
link_watch.c
net: link_watch: mark bonding link events urgent
2018-01-23 19:43:30 -05:00
lwt_bpf.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next
2018-08-07 11:02:05 -07:00
lwtunnel.c
ipv6: sr: define core operations for seg6local lightweight tunnel
2017-08-07 14:16:22 -07:00
Makefile
net: Introduce generic failover module
2018-05-28 22:59:54 -04:00
neighbour.c
Revert "neighbour: force neigh_invalidate when NUD_FAILED update is from admin"
2018-10-20 22:25:01 -07:00
net-procfs.c
proc: introduce proc_create_net{,_data}
2018-05-16 07:24:30 +02:00
net-sysfs.c
net: allow to call netif_reset_xps_queues() under cpus_read_lock
2018-08-09 14:25:06 -07:00
net-sysfs.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
net-traces.c
net/ipv6: Udate fib6_table_lookup tracepoint
2018-05-24 23:01:15 -04:00
net_namespace.c
Merge branch 'ida-4.19' of git://git.infradead.org/users/willy/linux-dax
2018-08-26 11:48:42 -07:00
netclassid_cgroup.c
cgroup, netclassid: add a preemption point to write_classid
2018-11-13 11:08:31 -08:00
netevent.c
netevent: remove automatic variable in register_netevent_notifier()
2015-05-31 00:03:21 -07:00
netpoll.c
Revert "bond: take rcu lock in netpoll_send_skb_on_dev"
2018-10-19 10:45:08 -07:00
netprio_cgroup.c
net: remove duplicate includes
2017-12-13 13:18:46 -05:00
page_pool.c
net/page_pool: Fix inconsistent lock state warning
2018-07-19 23:23:01 -07:00
pktgen.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next
2018-07-27 09:33:37 -07:00
ptp_classifier.c
ptp: Change ptp_class to a proper bitmask
2015-11-03 11:08:22 -05:00
request_sock.c
ipv4: Namespaceify tcp_max_syn_backlog knob
2016-12-29 11:38:31 -05:00
rtnetlink.c
rtnetlink: ndo_dflt_fdb_dump() only work for ARPHRD_ETHER devices
2018-12-17 09:24:28 +01:00
scm.c
sched/headers: Prepare for new header dependencies before moving code to <linux/sched/user.h>
2017-03-02 08:42:29 +01:00
secure_seq.c
infiniband: i40iw, nes: don't use wall time for TCP sequence numbers
2018-07-11 12:10:19 -06:00
skbuff.c
net: skb_scrub_packet(): Scrub offload_fwd_mark
2018-12-05 19:31:59 +01:00
sock.c
tcp: do not release socket ownership in tcp_close()
2018-12-01 09:37:28 +01:00
sock_diag.c
net: sock_diag: Fix spectre v1 gadget in __sock_diag_cmd()
2018-08-14 10:01:24 -07:00
sock_reuseport.c
bpf: Enable BPF_PROG_TYPE_SK_REUSEPORT bpf prog in reuseport selection
2018-08-11 01:58:46 +02:00
stream.c
vfs: do bulk POLL* -> EPOLL* replacement
2018-02-11 14:34:03 -08:00
sysctl_net_core.c
headers: untangle kmemleak.h from mm.h
2018-04-05 21:36:27 -07:00
timestamping.c
net: skb_defer_rx_timestamp should check for phydev before setting up classify
2015-07-09 14:17:15 -07:00
tso.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
utils.c
net: Remove some unneeded semicolon
2018-08-04 13:05:39 -07:00
xdp.c
net/xdp: Fix suspicious RCU usage warning
2018-08-16 21:55:21 +02:00