From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick Talbert Subject: [PATCH net-next] [net] softnet_data: Split time_squeeze counter to provide budget_squeeze Date: Tue, 23 Jan 2018 10:37:14 -0500 Message-ID: <1516721834-7740-1-git-send-email-ptalbert@redhat.com> Cc: Patrick Talbert To: netdev@vger.kernel.org Return-path: Received: from mail-qt0-f193.google.com ([209.85.216.193]:34250 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751830AbeAWPhc (ORCPT ); Tue, 23 Jan 2018 10:37:32 -0500 Received: by mail-qt0-f193.google.com with SMTP id a27so2326387qtd.1 for ; Tue, 23 Jan 2018 07:37:32 -0800 (PST) Sender: netdev-owner@vger.kernel.org List-ID: 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 --- 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