mbox series

[v1,net-next,0/9] phonet: Convert all doit() and dumpit() to RCU.

Message ID 20241017183140.43028-1-kuniyu@amazon.com (mailing list archive)
Headers show
Series phonet: Convert all doit() and dumpit() to RCU. | expand

Message

Kuniyuki Iwashima Oct. 17, 2024, 6:31 p.m. UTC
addr_doit() and route_doit() access only phonet_device_list(dev_net(dev))
and phonet_pernet(dev_net(dev))->routes, respectively.

Each per-netns struct has its dedicated mutex, and RTNL also protects
the structs.  __dev_change_net_namespace() has synchronize_net(), so
we have two options to convert addr_doit() and route_doit().

  1. Use per-netns RTNL
  2. Use RCU and convert each struct mutex to spinlock_t

As RCU is preferable, this series converts all PF_PHONET's doit()
and dumpit() to RCU.

4 doit()s and 1 dumpit() are now converted to RCU, 70 doit()s and
28 dumpit()s are still under RTNL.


Kuniyuki Iwashima (9):
  phonet: Pass ifindex to fill_addr().
  phonet: Pass net and ifindex to phonet_address_notify().
  phonet: Convert phonet_device_list.lock to spinlock_t.
  phonet: Don't hold RTNL for addr_doit().
  phonet: Don't hold RTNL for getaddr_dumpit().
  phonet: Pass ifindex to fill_route().
  phonet: Pass net and ifindex to rtm_phonet_notify().
  phonet: Convert phonet_routes.lock to spinlock_t.
  phonet: Don't hold RTNL for route_doit().

 include/net/phonet/pn_dev.h |   8 +--
 net/phonet/pn_dev.c         |  69 ++++++++++++++--------
 net/phonet/pn_netlink.c     | 115 ++++++++++++++++++++++--------------
 3 files changed, 120 insertions(+), 72 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Oct. 24, 2024, 2:10 p.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Thu, 17 Oct 2024 11:31:31 -0700 you wrote:
> addr_doit() and route_doit() access only phonet_device_list(dev_net(dev))
> and phonet_pernet(dev_net(dev))->routes, respectively.
> 
> Each per-netns struct has its dedicated mutex, and RTNL also protects
> the structs.  __dev_change_net_namespace() has synchronize_net(), so
> we have two options to convert addr_doit() and route_doit().
> 
> [...]

Here is the summary with links:
  - [v1,net-next,1/9] phonet: Pass ifindex to fill_addr().
    https://git.kernel.org/netdev/net-next/c/08a9572be368
  - [v1,net-next,2/9] phonet: Pass net and ifindex to phonet_address_notify().
    https://git.kernel.org/netdev/net-next/c/68ed5c38b512
  - [v1,net-next,3/9] phonet: Convert phonet_device_list.lock to spinlock_t.
    https://git.kernel.org/netdev/net-next/c/42f5fe1dc4ba
  - [v1,net-next,4/9] phonet: Don't hold RTNL for addr_doit().
    https://git.kernel.org/netdev/net-next/c/8786e98dd0eb
  - [v1,net-next,5/9] phonet: Don't hold RTNL for getaddr_dumpit().
    https://git.kernel.org/netdev/net-next/c/b7d2fc9ad7fe
  - [v1,net-next,6/9] phonet: Pass ifindex to fill_route().
    https://git.kernel.org/netdev/net-next/c/302fc6bbcba4
  - [v1,net-next,7/9] phonet: Pass net and ifindex to rtm_phonet_notify().
    https://git.kernel.org/netdev/net-next/c/de51ad08b117
  - [v1,net-next,8/9] phonet: Convert phonet_routes.lock to spinlock_t.
    https://git.kernel.org/netdev/net-next/c/3deec3b4afb4
  - [v1,net-next,9/9] phonet: Don't hold RTNL for route_doit().
    https://git.kernel.org/netdev/net-next/c/17a1ac0018ae

You are awesome, thank you!