From patchwork Tue Mar 14 13:14:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Xing X-Patchwork-Id: 69649 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1782563wrd; Tue, 14 Mar 2023 07:12:34 -0700 (PDT) X-Google-Smtp-Source: AK7set/IBLfPNgZjxAFdVHdcxDjw7JjaaaneRo55IkKuocd8PMhBlmvorcEFpNhxCN46SvYa75JO X-Received: by 2002:a6b:e015:0:b0:750:6c44:3454 with SMTP id z21-20020a6be015000000b007506c443454mr1813385iog.12.1678803154043; Tue, 14 Mar 2023 07:12:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678803154; cv=none; d=google.com; s=arc-20160816; b=F92AeSG25XK5CmDAYig5PcuK/sAT3Qwh5aXEZ29RsbVoCmfW1UedAg11KrjqnSJf9S Q8/CzzBjOiADGY2ovPc5pe5+k3cSCyZS4in7Q8wun4Cnwr5BlCRpWFdQksXz8/fXnZXR AOlHSM9wo+Qz4kmz2f+42uNNqHSurYbdc3gwXrtZB+W6Go30EGSk/lA7ar+TPABGzzYf 8PvQdJWj+1F9tta1pOICwGSNwiHFBfPnPI8zxbZGGvZMhWofYIQHiWxCN09v0d5qhdm1 8/TudcRZszJQy/ledOlNcDXLTjwWrU7xR2MwvhKyzpp+EdUJNleccDtJt4dbLIxpj2dU GgXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=C+aRdMSLfh5W1VPrI0wd1+Jj7SgosES6N6qHngIoFeI=; b=VH+mD23UwGyloKNh/FHGzUpLv0fMd2BkLs8vRB844S9Nu6329b0Fh/6rJq2D+XYDQU DK+8XcCG2cTLYJbilIh3ftWs+tS7561n4HI6VnWTFo8xoaV8ijIcnplIZk6DdS61I8XP MTC2rnZ/17LkIyglFkuIOs4/WW/F4o2ZZgaaqCXCSC3F6kacBRC00/5P/lrAbYw4MygN PbM1LNM3YdpR/h+y/6E9El8/Niee43JKFaN3PFX58ECmLkObMpDMtbZjHusXwwHrg291 1+wn/0rAsQugaFLdl2A8ypsbwGD2wtFEhPNgIhWCoijnmNqv5u4BBjwGyu1nLT5dh1Je k5jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=faQsCc+N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i8-20020a02c608000000b003a2cc4e05c4si2295695jan.12.2023.03.14.07.12.14; Tue, 14 Mar 2023 07:12:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=faQsCc+N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231840AbjCNNSq (ORCPT + 99 others); Tue, 14 Mar 2023 09:18:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231372AbjCNNSR (ORCPT ); Tue, 14 Mar 2023 09:18:17 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C662698848; Tue, 14 Mar 2023 06:15:06 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id l9-20020a17090a3f0900b0023d32684e7fso1150797pjc.1; Tue, 14 Mar 2023 06:15:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678799693; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=C+aRdMSLfh5W1VPrI0wd1+Jj7SgosES6N6qHngIoFeI=; b=faQsCc+NSLJS+nFWNm3Fh/qUeVUguy/rzDYSxYHXe7gDOH3SiDFim3XD0UdyTns8Mu 2HjNeIk4rDcxnL0IiWwKSb5ok2yzQaM+6BVuQQH0/g66ePPMMTSqF3NlV1mKv+NH41cP QYJZKIiiSEoRiitgWWBju1+J9L5Gw5uwyJ2A6KkwC6Q4eIgabdXMoRjD+EHB02+/Nb5z Z0OZ0KCPVCyIWSvcRRLj23rNJW8R562EyIR+VKO4NBh5tysyPtO+sR4HNEkAsJ0bDERV NEMIaaGo1XyRkrZGcviZ/mxa1K5EQ0GUo83FZRPnytko7otM3zz5H9nto5q7VAIWBK0d JSZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678799693; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C+aRdMSLfh5W1VPrI0wd1+Jj7SgosES6N6qHngIoFeI=; b=idlw+50TaaD0Ktk1NvkNvHbZ7RridGSpGQtGYlk8nBSskjRyV6PYycs7nOEz5gZyeQ q0rORSSUA5aa39sUYDPL0AWDxmzgfB/62av3/4ul1oVIWQEcrKihIur7MHTh01pyPsL3 Votbgu7oxcohWRLKuwJqPFUHoNHgwyBV6qo9EXDhHoZPnXkQngQ8Xenxu8hLAXIGVUjV kAWc8MNmj5VJXZQESn6eMum7wbp3kF7KkzxoJmS99ITQIFzeSqKdEMU3Wyogt3h4Ukp+ 2ddJ2XPJ35F4wHoz6emn1qK3u2PyCgJWfueBMf33+ZzyozIyBFEVo6Ug2Xnk77r9lV8A WAEA== X-Gm-Message-State: AO0yUKX80lGQrkF5v2agILBNJBU5X4PI7Otj2YjxF0lFMWGuTfStipWr lOJO4TKl4/ioDS4X9ozgEDU= X-Received: by 2002:a17:90a:6fa6:b0:23d:3aab:bd62 with SMTP id e35-20020a17090a6fa600b0023d3aabbd62mr1730493pjk.49.1678799693505; Tue, 14 Mar 2023 06:14:53 -0700 (PDT) Received: from KERNELXING-MB0.tencent.com ([103.7.29.31]) by smtp.gmail.com with ESMTPSA id g15-20020a17090a7d0f00b0023d36aa85fesm1465843pjl.40.2023.03.14.06.14.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Mar 2023 06:14:53 -0700 (PDT) From: Jason Xing To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com, stephen@networkplumber.org, simon.horman@corigine.com, sinquersw@gmail.com Cc: bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kerneljasonxing@gmail.com, Jason Xing Subject: [PATCH v3 net-next 1/2] net-sysfs: display two backlog queue len separately Date: Tue, 14 Mar 2023 21:14:26 +0800 Message-Id: <20230314131427.85135-2-kerneljasonxing@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230314131427.85135-1-kerneljasonxing@gmail.com> References: <20230314131427.85135-1-kerneljasonxing@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760352696193652900?= X-GMAIL-MSGID: =?utf-8?q?1760352696193652900?= From: Jason Xing Sometimes we need to know which one of backlog queue can be exactly long enough to cause some latency when debugging this part is needed. Thus, we can then separate the display of both. Signed-off-by: Jason Xing Reviewed-by: Simon Horman --- v3: drop the comment suggested by Simon Link: https://lore.kernel.org/lkml/20230314030532.9238-2-kerneljasonxing@gmail.com/ v2: keep the total len of backlog queues untouched as Eric said Link: https://lore.kernel.org/lkml/20230311151756.83302-1-kerneljasonxing@gmail.com/ --- net/core/net-procfs.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/net/core/net-procfs.c b/net/core/net-procfs.c index 1ec23bf8b05c..8056f39da8a1 100644 --- a/net/core/net-procfs.c +++ b/net/core/net-procfs.c @@ -115,10 +115,19 @@ static int dev_seq_show(struct seq_file *seq, void *v) return 0; } +static u32 softnet_input_pkt_queue_len(struct softnet_data *sd) +{ + return skb_queue_len_lockless(&sd->input_pkt_queue); +} + +static u32 softnet_process_queue_len(struct softnet_data *sd) +{ + return skb_queue_len_lockless(&sd->process_queue); +} + static u32 softnet_backlog_len(struct softnet_data *sd) { - return skb_queue_len_lockless(&sd->input_pkt_queue) + - skb_queue_len_lockless(&sd->process_queue); + return softnet_input_pkt_queue_len(sd) + softnet_process_queue_len(sd); } static struct softnet_data *softnet_get_online(loff_t *pos) @@ -169,12 +178,14 @@ static int softnet_seq_show(struct seq_file *seq, void *v) * mapping the data a specific CPU */ seq_printf(seq, - "%08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x\n", + "%08x %08x %08x %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, - softnet_backlog_len(sd), (int)seq->index); + softnet_backlog_len(sd), (int)seq->index, + softnet_input_pkt_queue_len(sd), softnet_process_queue_len(sd)); return 0; } From patchwork Tue Mar 14 13:14:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Xing X-Patchwork-Id: 69655 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1784318wrd; Tue, 14 Mar 2023 07:15:36 -0700 (PDT) X-Google-Smtp-Source: AK7set+4UNMEFXhj7gFRMIwj4b50YMDp1AJ+nAdyKGQGsEr9P8O1gVp5n38cvMvitcvsFi+iRIhW X-Received: by 2002:a17:90a:350:b0:23a:340d:fa49 with SMTP id 16-20020a17090a035000b0023a340dfa49mr22447446pjf.32.1678803336217; Tue, 14 Mar 2023 07:15:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678803336; cv=none; d=google.com; s=arc-20160816; b=GlyrUglNWAfPKw+2AqJFfcUphfR0QLCidmj5O1O9/PuXg9BB6lvoL+/764RsfthG6o wmD6gMNo0l7i0+MnLn6y5HZMsHC2MKQwwaeZh95mjbXwY7MBacLlyjN4jz2UxlLJIAnm sjIqjSyAK5/VpTFWXjAkv17VIa8edaQ9KTStiV2IlrRusFsbuFxuU0/JGFx3wE9ycN8q KGzzxSZVaUDtqm1WXBke35yKa5+RfWTEoHKxQ8H+Ds/yf5Q3rKHKc43UgIxLOLscNVvh 7ouQ/irm7Pb3aF3iBSFjalP1RYLdbAbRlIUrIVoM+fFk28gcFqc9MqZK+4sb8zbhSxFA Mv3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kcWoqfvA9IE0sL0PZdVOZ872E1skiGdEi9aMnqvt7k0=; b=PKPRlrEwrFHD6L20WzQirS5ER3Fmx7t5RV+VcFRF+X2lMhP1J+9dHYUh0j5kdhV1pD LDZNzudGpKPhk+lqIKNJfcDnMavS1U1YLN7eHHo20al6vOAhg5ozf+YmIux52vAmSg4q ESe6289+QINLiddiwCpo5475/B/75dnqxFOydbBIIkXAcJ7CE9UjwPduCzsebP6AlGK3 db1yldIK2OUdYOrN8xJrgsT4HtErT8XMXx45XSRrye1U35XAvQttZauM7yiE9nPrupNl 2G0vhehDJvjv4g5LXyO1qsyFjjjC3VbQ5twGNLXGqFU2TnhDy+2zU2AfNf7dDbeaQ0mt 3wWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KALZf0Ib; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y11-20020a17090aa40b00b00229f5cf70f9si2620569pjp.107.2023.03.14.07.15.19; Tue, 14 Mar 2023 07:15:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KALZf0Ib; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230123AbjCNNSz (ORCPT + 99 others); Tue, 14 Mar 2023 09:18:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232047AbjCNNSW (ORCPT ); Tue, 14 Mar 2023 09:18:22 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0052AA730; Tue, 14 Mar 2023 06:15:13 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id k2so8665504pll.8; Tue, 14 Mar 2023 06:15:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678799701; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kcWoqfvA9IE0sL0PZdVOZ872E1skiGdEi9aMnqvt7k0=; b=KALZf0IbRmqSNwlp7+T8n48OrNg0JWoB5O37QP6NCehvUpOCt+K9jgOvDW47eqMnvb xlAcpDlVAMmkxGkf3zxQuPUgEpwGREdr1DGG+hq8XQeIaSDIUVxnY4QGOxSG4yWgHmq9 4238pd7VcjP4juWG0NPZlmQiQ2D4SxL4yiEbu2sQw3Omxi+OxRt7ZKXyPUkxBOsHUA/Y 1zz1zL03ifFKDS/DqZt84he9pFM5CmcqT0XdV0kE/6MMBCUeIuIZ76rJ7wq9x0ls4ogE 6c0xG5Ar4hlYkdSMtL4db8opVjktytqfxpcWl6BYThRQ+jgDFuEsY+39bESYh8AqdPdk wq7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678799701; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kcWoqfvA9IE0sL0PZdVOZ872E1skiGdEi9aMnqvt7k0=; b=ZVSBcsKKNJSLn745Ko14toIvLNneaGCgJPk4pn25oeK/2ZqCDBpXruX+Q2upA8h911 hWDD4hDHPTgXdwcMJHJ6nR7cBnFiCJB47+mtetM1z0zCJsh+2o1Gj4+5wRVuNWgFRqrU quvE3dS7jTOuhzwPtE03BlbB4Jq10Etd7RXJ8GVxepadUK/0e9zgWW2r9vUXk+pxvi8c yjVDprhqDlxODFBDsfXCfKqUAdr8z76rYOPZFizBi6IzOJHSnw77solTpLR60RCPEIzs 5VBCSrnbRuuYhM90ALh09dkXvQD+tYxDwlC6ByO1KXJShdg5YRk8HqLHl22PxJXiyQg3 7lHw== X-Gm-Message-State: AO0yUKVqN8dJD/kgxVhR816kPA2ifywR4a6KuGQht28qAyjywbjKq7LJ mdCmJfXq0NfEs1UbKj6mKow= X-Received: by 2002:a17:90a:db46:b0:23d:19c6:84b7 with SMTP id u6-20020a17090adb4600b0023d19c684b7mr4612319pjx.16.1678799701136; Tue, 14 Mar 2023 06:15:01 -0700 (PDT) Received: from KERNELXING-MB0.tencent.com ([103.7.29.31]) by smtp.gmail.com with ESMTPSA id g15-20020a17090a7d0f00b0023d36aa85fesm1465843pjl.40.2023.03.14.06.14.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Mar 2023 06:15:00 -0700 (PDT) From: Jason Xing To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com, stephen@networkplumber.org, simon.horman@corigine.com, sinquersw@gmail.com Cc: bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kerneljasonxing@gmail.com, Jason Xing Subject: [PATCH v3 net-next 2/2] net: introduce budget_squeeze to help us tune rx behavior Date: Tue, 14 Mar 2023 21:14:27 +0800 Message-Id: <20230314131427.85135-3-kerneljasonxing@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230314131427.85135-1-kerneljasonxing@gmail.com> References: <20230314131427.85135-1-kerneljasonxing@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760352887370533251?= X-GMAIL-MSGID: =?utf-8?q?1760352887370533251?= From: Jason Xing When we encounter some performance issue and then get lost on how to tune the budget limit and time limit in net_rx_action() function, we can separately counting both of them to avoid the confusion. Signed-off-by: Jason Xing Reviewed-by: Simon Horman --- v3: 1) drop the comment suggested by Simon Link: https://lore.kernel.org/lkml/20230314030532.9238-3-kerneljasonxing@gmail.com/ v2: 1) change the coding style suggested by Stephen and Simon 2) Keep the display of the old data (time_squeeze) untouched suggested by Kui-Feng Link: https://lore.kernel.org/lkml/20230311163614.92296-1-kerneljasonxing@gmail.com/ --- include/linux/netdevice.h | 1 + net/core/dev.c | 12 ++++++++---- net/core/net-procfs.c | 8 +++++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 6a14b7b11766..5736311a2133 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -3157,6 +3157,7 @@ struct softnet_data { /* stats */ unsigned int processed; unsigned int time_squeeze; + unsigned int budget_squeeze; #ifdef CONFIG_RPS struct softnet_data *rps_ipi_list; #endif diff --git a/net/core/dev.c b/net/core/dev.c index 253584777101..1518a366783b 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -6637,6 +6637,7 @@ static __latent_entropy void net_rx_action(struct softirq_action *h) unsigned long time_limit = jiffies + usecs_to_jiffies(READ_ONCE(netdev_budget_usecs)); int budget = READ_ONCE(netdev_budget); + bool done = false; LIST_HEAD(list); LIST_HEAD(repoll); @@ -6644,7 +6645,7 @@ static __latent_entropy void net_rx_action(struct softirq_action *h) list_splice_init(&sd->poll_list, &list); local_irq_enable(); - for (;;) { + while (!done) { struct napi_struct *n; skb_defer_free_flush(sd); @@ -6662,10 +6663,13 @@ 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(budget <= 0)) { + sd->budget_squeeze++; + done = true; + } + if (unlikely(time_after_eq(jiffies, time_limit))) { sd->time_squeeze++; - break; + done = true; } } diff --git a/net/core/net-procfs.c b/net/core/net-procfs.c index 8056f39da8a1..3b53812a9ac9 100644 --- a/net/core/net-procfs.c +++ b/net/core/net-procfs.c @@ -179,13 +179,15 @@ static int softnet_seq_show(struct seq_file *seq, void *v) */ seq_printf(seq, "%08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x " - "%08x %08x\n", - sd->processed, sd->dropped, sd->time_squeeze, 0, + "%08x %08x %08x %08x\n", + sd->processed, sd->dropped, + sd->time_squeeze + sd->budget_squeeze, 0, 0, 0, 0, 0, /* was fastroute */ 0, /* was cpu_collision */ sd->received_rps, flow_limit_count, softnet_backlog_len(sd), (int)seq->index, - softnet_input_pkt_queue_len(sd), softnet_process_queue_len(sd)); + softnet_input_pkt_queue_len(sd), softnet_process_queue_len(sd), + sd->time_squeeze, sd->budget_squeeze); return 0; }