Skip to content

IPVS optimizations

Julian Anastasov lvs-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest15 patches 4 repliesIn review
  2. v215 patches 4 repliesSuperseded
  3. v112 patches 13 repliesSuperseded

Changes in v3 from the cover letter

* in "ipvs: consolidate all dst checks on transmit in one place" preserve original skb dst even for local client, remove the rt_is_input_route and skb->dev check. Call update_pmtu only for local client by providing sk instead of skb.
* in "ipvs: optimize dst usage for real server" use rcu_dereference_protected for __ip_vs_dst_cache_reset instead of rcu_dereference_raw. Use the new skb_dst_set_noref_force func.
* in "ipvs: remove rs_lock by using RCU" prefer the port check in ip_vs_has_real_service
* "ipvs: convert locks used in persistence engines" needs only synchronize_rcu, not rcu_barrier, we do not use rcu callbacks

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15net: add skb_dst_set_noref_forceinclude/linux/skbuff.h net/core/dst.c+39 -50 replies
2/15ipvs: avoid routing by TOS for real serverinclude/net/ip_vs.h net/netfilter/ipvs/ip_vs_xmit.c+25 -340 replies
3/15ipvs: prefer NETDEV_DOWN event to free cached dstsnet/netfilter/ipvs/ip_vs_ctl.c+3 -50 replies
4/15ipvs: convert the IP_VS_XMIT macros to functionsnet/netfilter/ipvs/ip_vs_xmit.c+71 -600 replies
5/15ipvs: rename functions related to dst_cache resetinclude/net/ip_vs.h net/netfilter/ipvs/ip_vs_ctl.c net/netfilter/ipvs/ip_vs_xmit.c+22 -260 replies
6/15ipvs: no need to reroute anymore on DNAT over loopbacknet/netfilter/ipvs/ip_vs_xmit.c+2 -560 replies
7/15ipvs: do not use skb_share_checknet/netfilter/ipvs/ip_vs_xmit.c+2 -400 replies
8/15ipvs: consolidate all dst checks on transmit in one placenet/netfilter/ipvs/ip_vs_xmit.c+235 -3860 replies
9/15ipvs: optimize dst usage for real serverinclude/net/ip_vs.h net/netfilter/ipvs/ip_vs_core.c net/netfilter/ipvs/ip_vs_ctl.c +1 more+177 -590 replies
10/15ipvs: convert app locksinclude/net/ip_vs.h net/netfilter/ipvs/ip_vs_app.c net/netfilter/ipvs/ip_vs_ftp.c +3 more+40 -480 replies
11/15ipvs: remove rs_lock by using RCUinclude/net/ip_vs.h net/netfilter/ipvs/ip_vs_core.c net/netfilter/ipvs/ip_vs_ctl.c+39 -630 replies
12/15ipvs: convert locks used in persistence enginesnet/netfilter/ipvs/ip_vs_pe.c+10 -270 replies
13/15ipvs: convert connection lockinginclude/net/ip_vs.h net/netfilter/ipvs/ip_vs_conn.c+134 -1080 replies
14/15ipvs: reorder keys in connection structureinclude/net/ip_vs.h net/netfilter/ipvs/ip_vs_conn.c+16 -150 replies
15/15ipvs: avoid kmem_cache_zalloc in ip_vs_conn_newinclude/net/ip_vs.h net/netfilter/ipvs/ip_vs_conn.c+34 -50 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCHv3 net-next 00/15] IPVS optimizations

This is a first patchset for IPVS optimizations.
Another patchset will address the locking in schedulers and moving the global _bh disabling from LOCAL_OUT to all locks.

All patches are for net-next and Simon can
take them for ipvs-next.

The changes in this patchset eliminate locks
and dst refcnt operations from packet processing by using RCU. There are more details in the patches.

v3:
* in "ipvs: consolidate all dst checks on transmit in one place" preserve original skb dst even for local client, remove the rt_is_input_route and skb->dev check. Call update_pmtu only for local client by providing sk instead of skb.
* in "ipvs: optimize dst usage for real server" use rcu_dereference_protected for __ip_vs_dst_cache_reset instead of rcu_dereference_raw. Use the new skb_dst_set_noref_force func.
* in "ipvs: remove rs_lock by using RCU" prefer the port check in ip_vs_has_real_service
* "ipvs: convert locks used in persistence engines" needs only synchronize_rcu, not rcu_barrier, we do not use rcu callbacks

v2:
* use "net: add skb_dst_set_unref" instead of
"net: add dst_get_noref and refdst_ptr helpers"
* add "ipvs: no need to reroute anymore on DNAT over loopback"
* add "ipvs: do not use skb_share_check"
* add "ipvs: consolidate all dst checks on transmit in one place", so that we can avoid the refdst games in next patch
* after "ipvs: consolidate all dst checks on transmit in one place" "ipvs: optimize dst usage for real server" is simpler and uses the new skb_dst_set_unref function
* extend "ipvs: reorder keys in connection structure" with changes in ip_vs_ct_in_get
* fix "ipvs: avoid kmem_cache_zalloc in ip_vs_conn_new" to use new function ip_vs_addr_set, so that we reset all address fields that are used for hashing by hash_conntrack_raw

Julian Anastasov (15):
net: add skb_dst_set_noref_force
ipvs: avoid routing by TOS for real server
ipvs: prefer NETDEV_DOWN event to free cached dsts
ipvs: convert the IP_VS_XMIT macros to functions
ipvs: rename functions related to dst_cache reset
ipvs: no need to reroute anymore on DNAT over loopback
ipvs: do not use skb_share_check
ipvs: consolidate all dst checks on transmit in one place
ipvs: optimize dst usage for real server
ipvs: convert app locks
ipvs: remove rs_lock by using RCU
ipvs: convert locks used in persistence engines
ipvs: convert connection locking
ipvs: reorder keys in connection structure
ipvs: avoid kmem_cache_zalloc in ip_vs_conn_new

 include/linux/skbuff.h                |   35 ++-
 include/net/ip_vs.h                   |   71 ++-
 net/core/dst.c                        |    9 +-
 net/netfilter/ipvs/ip_vs_app.c        |   27 +-
 net/netfilter/ipvs/ip_vs_conn.c       |  271 +++++----
 net/netfilter/ipvs/ip_vs_core.c       |   16 +-
 net/netfilter/ipvs/ip_vs_ctl.c        |  143 +++---
 net/netfilter/ipvs/ip_vs_ftp.c        |    2 +
 net/netfilter/ipvs/ip_vs_pe.c         |   43 +-
 net/netfilter/ipvs/ip_vs_pe_sip.c     |    1 +
 net/netfilter/ipvs/ip_vs_proto_sctp.c |   18 +-
 net/netfilter/ipvs/ip_vs_proto_tcp.c  |   18 +-
 net/netfilter/ipvs/ip_vs_proto_udp.c  |   19 +-
 net/netfilter/ipvs/ip_vs_xmit.c       | 1046 ++++++++++++++-------------------
 14 files changed, 810 insertions(+), 909 deletions(-)
Signature · 1 line
1.7.3.4