netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] [net] softnet_data: Split time_squeeze counter to provide budget_squeeze
@ 2018-01-23 15:37 Patrick Talbert
  2018-01-23 17:07 ` Eric Dumazet
  0 siblings, 1 reply; 3+ messages in thread
From: Patrick Talbert @ 2018-01-23 15:37 UTC (permalink / raw)
  To: netdev; +Cc: Patrick Talbert

Add a 'budget_squeeze' counter to be able to differenciate between a
NAPI poll ending with outstanding work because of a lack of budget
(netdev_budget) versus ending because of a lack of time
(netdev_budget_usecs).

Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
---
 include/linux/netdevice.h | 1 +
 net/core/dev.c            | 7 +++++--
 net/core/net-procfs.c     | 4 ++--
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index ed0799a..97e923d 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2789,6 +2789,7 @@ struct softnet_data {
 	/* stats */
 	unsigned int		processed;
 	unsigned int		time_squeeze;
+	unsigned int		budget_squeeze;
 	unsigned int		received_rps;
 #ifdef CONFIG_RPS
 	struct softnet_data	*rps_ipi_list;
diff --git a/net/core/dev.c b/net/core/dev.c
index 94435cd..99ce20a 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5749,11 +5749,14 @@ static __latent_entropy void net_rx_action(struct softirq_action *h)
 		 * Allow this to run for 2 jiffies since which will allow
 		 * an average latency of 1.5/HZ.
 		 */
-		if (unlikely(budget <= 0 ||
-			     time_after_eq(jiffies, time_limit))) {
+		if (unlikely(time_after_eq(jiffies, time_limit))) {
 			sd->time_squeeze++;
 			break;
 		}
+		if (unlikely(budget <= 0)) {
+			sd->budget_squeeze++;
+			break;
+		}
 	}
 
 	local_irq_disable();
diff --git a/net/core/net-procfs.c b/net/core/net-procfs.c
index e010bb8..912e47a 100644
--- a/net/core/net-procfs.c
+++ b/net/core/net-procfs.c
@@ -160,11 +160,11 @@ static int softnet_seq_show(struct seq_file *seq, void *v)
 #endif
 
 	seq_printf(seq,
-		   "%08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x\n",
+		   "%08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x\n",
 		   sd->processed, sd->dropped, sd->time_squeeze, 0,
 		   0, 0, 0, 0, /* was fastroute */
 		   0,	/* was cpu_collision */
-		   sd->received_rps, flow_limit_count);
+		   sd->received_rps, flow_limit_count, sd->budget_squeeze);
 	return 0;
 }
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] [net] softnet_data: Split time_squeeze counter to provide budget_squeeze
  2018-01-23 15:37 [PATCH net-next] [net] softnet_data: Split time_squeeze counter to provide budget_squeeze Patrick Talbert
@ 2018-01-23 17:07 ` Eric Dumazet
  2018-01-24 13:25   ` Patrick Talbert
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2018-01-23 17:07 UTC (permalink / raw)
  To: Patrick Talbert, netdev

On Tue, 2018-01-23 at 10:37 -0500, Patrick Talbert wrote:
> Add a 'budget_squeeze' counter to be able to differenciate between a
> NAPI poll ending with outstanding work because of a lack of budget
> (netdev_budget) versus ending because of a lack of time
> (netdev_budget_usecs).
> 
> Signed-off-by: Patrick Talbert <ptalbert@redhat.com>


> --- a/net/core/net-procfs.c
> +++ b/net/core/net-procfs.c
> @@ -160,11 +160,11 @@ static int softnet_seq_show(struct seq_file *seq, void *v)
>  #endif
>  
>  	seq_printf(seq,
> -		   "%08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x\n",
> +		   "%08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x\n",
>  		   sd->processed, sd->dropped, sd->time_squeeze, 0,
>  		   0, 0, 0, 0, /* was fastroute */
>  		   0,	/* was cpu_collision */
> -		   sd->received_rps, flow_limit_count);
> +		   sd->received_rps, flow_limit_count, sd->budget_squeeze);
>  	return 0;
>  }

Please no more updates on /proc files. We want to deprecate them
eventually.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] [net] softnet_data: Split time_squeeze counter to provide budget_squeeze
  2018-01-23 17:07 ` Eric Dumazet
@ 2018-01-24 13:25   ` Patrick Talbert
  0 siblings, 0 replies; 3+ messages in thread
From: Patrick Talbert @ 2018-01-24 13:25 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev

On Tue, Jan 23, 2018 at 6:07 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Tue, 2018-01-23 at 10:37 -0500, Patrick Talbert wrote:
>> Add a 'budget_squeeze' counter to be able to differenciate between a
>> NAPI poll ending with outstanding work because of a lack of budget
>> (netdev_budget) versus ending because of a lack of time
>> (netdev_budget_usecs).
>>
>> Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
>
>
>> --- a/net/core/net-procfs.c
>> +++ b/net/core/net-procfs.c
>> @@ -160,11 +160,11 @@ static int softnet_seq_show(struct seq_file *seq, void *v)
>>  #endif
>>
>>       seq_printf(seq,
>> -                "%08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x\n",
>> +                "%08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x\n",
>>                  sd->processed, sd->dropped, sd->time_squeeze, 0,
>>                  0, 0, 0, 0, /* was fastroute */
>>                  0,   /* was cpu_collision */
>> -                sd->received_rps, flow_limit_count);
>> +                sd->received_rps, flow_limit_count, sd->budget_squeeze);
>>       return 0;
>>  }
>
> Please no more updates on /proc files. We want to deprecate them
> eventually.
>
>

Fair enough. How is the commit without the net-procfs.c change? Also,
I apologize for not knowing, but if it is preferred for such info to
no longer be exposed via procfs, where should it be instead?

Thank you,

Patrick

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-24 13:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-23 15:37 [PATCH net-next] [net] softnet_data: Split time_squeeze counter to provide budget_squeeze Patrick Talbert
2018-01-23 17:07 ` Eric Dumazet
2018-01-24 13:25   ` Patrick Talbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).