linux-stable/net/core
Íñigo Huguet 046e1537a3 net: set default rss queues num to physical cores / 2
Network drivers can call to netif_get_num_default_rss_queues to get the
default number of receive queues to use. Right now, this default number
is min(8, num_online_cpus()).

Instead, as suggested by Jakub, use the number of physical cores divided
by 2 as a way to avoid wasting CPU resources and to avoid using both CPU
threads, but still allowing to scale for high-end processors with many
cores.

As an exception, select 2 queues for processors with 2 cores, because
otherwise it won't take any advantage of RSS despite being SMP capable.

Tested: Processor Intel Xeon E5-2620 (2 sockets, 6 cores/socket, 2
threads/core). NIC Broadcom NetXtreme II BCM57810 (10GBps). Ran some
tests with `perf stat iperf3 -R`, with parallelisms of 1, 8 and 24,
getting the following results:
- Number of queues: 6 (instead of 8)
- Network throughput: not affected
- CPU usage: utilized 0.05-0.12 CPUs more than before (having 24 CPUs
  this is only 0.2-0.5% higher)
- Reduced the number of context switches by 7-50%, being more noticeable
  when using a higher number of parallel threads.

Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
Link: https://lore.kernel.org/r/20220315091832.13873-1-ihuguet@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-03-18 12:00:35 -07:00
..
bpf_sk_storage.c bpf: Allow bpf_local_storage to be used by sleepable programs 2021-12-29 17:54:40 -08:00
datagram.c net: avoid double accounting for pure zerocopy skbs 2021-11-03 11:19:49 +00:00
datagram.h
dev.c net: set default rss queues num to physical cores / 2 2022-03-18 12:00:35 -07:00
dev_addr_lists.c dev_addr_list: put the first addr on the tree 2021-11-20 12:25:57 +00:00
dev_addr_lists_test.c net: kunit: add a test for dev_addr_lists 2021-11-20 12:25:57 +00:00
dev_ioctl.c net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX 2021-12-14 12:28:24 +00:00
devlink.c devlink: pass devlink_port to port_split / port_unsplit callbacks 2022-03-16 12:56:45 -07:00
drop_monitor.c drop_monitor: remove quadratic behavior 2022-02-23 12:39:58 +00:00
dst.c net: dst: add net device refcount tracking to dst_entry 2021-12-06 16:05:10 -08:00
dst_cache.c wireguard: device: reset peer src endpoint when netns exits 2021-11-29 19:50:45 -08:00
failover.c net: failover: add net device refcount tracker 2021-12-06 16:06:02 -08:00
fib_notifier.c
fib_rules.c fib: expand fib_rule_policy 2021-12-16 07:18:35 -08:00
filter.c bpf: Add __sk_buff->delivery_time_type and bpf_skb_set_skb_delivery_time() 2022-03-03 14:38:49 +00:00
flow_dissector.c flow_dissector: Add support for HSRv0 2022-03-11 11:05:52 +00:00
flow_offload.c flow_offload: add reoffload process to update hw_count 2021-12-19 14:08:48 +00:00
gen_estimator.c
gen_stats.c
gro.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-03-10 17:16:56 -08:00
gro_cells.c net: add per-cpu storage and net->core_stats 2022-03-11 23:17:24 -08:00
hwbm.c
link_watch.c net: refine dev_put()/dev_hold() debugging 2022-02-05 15:22:45 +00:00
lwt_bpf.c net: Don't include filter.h from net/sock.h 2021-12-29 08:48:14 -08:00
lwtunnel.c lwtunnel: Validate RTA_ENCAP_TYPE attribute length 2021-12-31 14:31:59 +00:00
Makefile net: kunit: add a test for dev_addr_lists 2021-11-20 12:25:57 +00:00
neighbour.c net: neigh: use kfree_skb_reason() for __neigh_event_send() 2022-02-26 12:53:59 +00:00
net-procfs.c net-procfs: show net devices bound packet types 2022-01-24 11:58:46 +00:00
net-sysfs.c net-sysfs: add check for netdevice being present to speed_show 2022-02-18 10:59:11 +00:00
net-sysfs.h
net-traces.c
net_namespace.c net: initialize init_net earlier 2022-02-06 11:04:29 +00:00
netclassid_cgroup.c
netevent.c
netpoll.c netpoll: add net device refcount tracker to struct netpoll 2021-12-06 16:06:02 -08:00
netprio_cgroup.c
of_net.c Revert "of: net: support NVMEM cells with MAC in text format" 2022-01-12 14:14:36 +00:00
page_pool.c page_pool: Add function to batch and return stats 2022-03-03 09:55:28 +00:00
pktgen.c proc: remove PDE_DATA() completely 2022-01-22 08:33:37 +02:00
ptp_classifier.c ptp: Add generic PTP is_sync() function 2022-03-07 11:31:34 +00:00
request_sock.c
rtnetlink.c net: limit altnames to 64k total 2022-03-10 20:15:23 -08:00
scm.c
secure_seq.c net: align static siphash keys 2021-11-16 19:07:54 -08:00
selftests.c
skbuff.c net: skb: introduce the function kfree_skb_list_reason() 2022-03-04 12:17:11 +00:00
skmsg.c bpf, sockmap: Do not ignore orig_len parameter 2022-03-02 22:49:03 -08:00
sock.c SO_ZEROCOPY should return -EOPNOTSUPP rather than -ENOTSUPP 2022-03-08 22:14:49 -08:00
sock_destructor.h
sock_diag.c net: Don't include filter.h from net/sock.h 2021-12-29 08:48:14 -08:00
sock_map.c bpf: support BPF_PROG_QUERY for progs attached to sockmap 2022-01-20 21:30:58 -08:00
sock_reuseport.c
stream.c
sysctl_net_core.c net/sysctl: avoid two synchronize_rcu() calls 2022-02-28 11:40:47 +00:00
timestamping.c
tso.c
utils.c net: core: Use csum_replace_by_diff() and csum_sub() instead of opencoding 2022-02-21 11:40:44 +00:00
xdp.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-03-10 17:16:56 -08:00