Re: [RFC net-next 1/2] net: net-porcfs: Reduce rcu lock critical section

2018-04-16 Thread Eric Dumazet
On 04/16/2018 01:50 PM, Saeed Mahameed wrote: > > Dave, Eric, I would like to know whether it is ok to have this change > in the kernel (make get_stats ndo "might sleep")? I really didn't get > any convincing feedback to not do this change. Fact that you were not convinced does not mean you wer

Re: [RFC net-next 1/2] net: net-porcfs: Reduce rcu lock critical section

2018-04-16 Thread Saeed Mahameed
On Thu, 2018-04-12 at 19:12 +, Saeed Mahameed wrote: > On Wed, 2018-04-11 at 19:59 -0700, Eric Dumazet wrote: > > > > On 04/11/2018 04:47 PM, Saeed Mahameed wrote: > > > > > > Well if we allow devices to access HW counters via FW command > > > interfaces in ndo_get_stats and by testing mlx5 w

Re: [RFC net-next 1/2] net: net-porcfs: Reduce rcu lock critical section

2018-04-12 Thread Saeed Mahameed
On Wed, 2018-04-11 at 19:59 -0700, Eric Dumazet wrote: > > On 04/11/2018 04:47 PM, Saeed Mahameed wrote: > > > > Well if we allow devices to access HW counters via FW command > > interfaces in ndo_get_stats and by testing mlx5 where we query up > > to 5 > > hw registers, it could take 100us, stil

Re: [RFC net-next 1/2] net: net-porcfs: Reduce rcu lock critical section

2018-04-11 Thread Eric Dumazet
On 04/11/2018 04:47 PM, Saeed Mahameed wrote: > > Well if we allow devices to access HW counters via FW command > interfaces in ndo_get_stats and by testing mlx5 where we query up to 5 > hw registers, it could take 100us, still this is way smaller than 10sec > :) and it is really a nice rate to

Re: [RFC net-next 1/2] net: net-porcfs: Reduce rcu lock critical section

2018-04-11 Thread Saeed Mahameed
On Wed, 2018-04-11 at 15:30 -0700, Eric Dumazet wrote: > > On 04/11/2018 11:59 AM, Saeed Mahameed wrote: > > On Tue, 2018-04-10 at 13:35 -0700, Eric Dumazet wrote: > > > > > > On 04/10/2018 10:16 AM, David Miller wrote: > > > > > > > > The tradeoff here is that now you are doing two unnecessary

Re: [RFC net-next 1/2] net: net-porcfs: Reduce rcu lock critical section

2018-04-11 Thread Eric Dumazet
On 04/11/2018 11:59 AM, Saeed Mahameed wrote: > On Tue, 2018-04-10 at 13:35 -0700, Eric Dumazet wrote: >> >> On 04/10/2018 10:16 AM, David Miller wrote: >>> >>> The tradeoff here is that now you are doing two unnecessary atomic >>> operations per stats dump. >>> >>> That is what the RCU lock allo

Re: [RFC net-next 1/2] net: net-porcfs: Reduce rcu lock critical section

2018-04-11 Thread Saeed Mahameed
On Tue, 2018-04-10 at 13:35 -0700, Eric Dumazet wrote: > > On 04/10/2018 10:16 AM, David Miller wrote: > > > > The tradeoff here is that now you are doing two unnecessary atomic > > operations per stats dump. > > > > That is what the RCU lock allows us to avoid. > > > > dev_hold() and dev_put(

Re: [RFC net-next 1/2] net: net-porcfs: Reduce rcu lock critical section

2018-04-10 Thread Eric Dumazet
On 04/10/2018 10:16 AM, David Miller wrote: > > The tradeoff here is that now you are doing two unnecessary atomic > operations per stats dump. > > That is what the RCU lock allows us to avoid. > dev_hold() and dev_put() are actually per cpu increment and decrements, pretty cheap these days.

Re: [RFC net-next 1/2] net: net-porcfs: Reduce rcu lock critical section

2018-04-10 Thread David Miller
From: Saeed Mahameed Date: Tue, 10 Apr 2018 10:08:11 -0700 > The current net proc fs sequence file implementation to show current > namespace netdevs list statistics and mc lists holds the rcu lock > throughout the whole process, from dev seq start up to dev seq stop. > > This is really greedy a

[RFC net-next 1/2] net: net-porcfs: Reduce rcu lock critical section

2018-04-10 Thread Saeed Mahameed
The current net proc fs sequence file implementation to show current namespace netdevs list statistics and mc lists holds the rcu lock throughout the whole process, from dev seq start up to dev seq stop. This is really greedy and demanding from device drivers since ndo_get_stats64 called from dev_