From patchwork Tue Mar 14 03:05:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Xing X-Patchwork-Id: 69271 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1534612wrd; Mon, 13 Mar 2023 20:09:11 -0700 (PDT) X-Google-Smtp-Source: AK7set+fQynOUEJb5GXT2PCGX2gR05r3hQwJZDb8p0Hzt5KZJFi6w9BkbPEz/moNDg7XYzhfYQG+ X-Received: by 2002:a67:ca92:0:b0:411:c4bc:2736 with SMTP id a18-20020a67ca92000000b00411c4bc2736mr7563724vsl.6.1678763350960; Mon, 13 Mar 2023 20:09:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678763350; cv=none; d=google.com; s=arc-20160816; b=Sb/zLdaWGay6gu+64bKkt/o7uv1jUZXF5k7QY4nTr3dZJaneWG4U/3xTS3Ze6oLvp7 G8B8gf6wmBkni1xflWNmVCeTn7F2BvZh0rKbmYLpuC902/XixQvdZaR6FfJr/dgmPBQt cPiONmWb7Zf2CyZSROckRP7Vy90PCJIUP5D1SXJGMcQK0S6qr5DBT8JEzNt07K4r5jml b1qHqUiKJkK6T8FOJEM8H7wmgWQGaxwcph8h00qacGf1ivTiL4+8fW8fey18cz7c3B0G vZbg2T3ms+4eKRG1yrNYl8z6+0F951lnF5pRuocjWWrsW6Nccwz9YKHVUzRyMIIRNSKV rNEQ== 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=QMnMHWGI+QQmPd732o6xoqQE9KAk9SBU5515vgJD5J0=; b=vFXhW6U5DUAVm9kOeJkHc3G2aJMQfvKqK0oadTTCB7WJR3C/yrYWIeDG0Qq+ECg2FF SlpHYw3v8Z8xRmyQ0KJS+qiUid1cM8Wps5BV2WlWPXf7tC7A0TzqQN5hJPKXvbVz17fg GGktChWVxI7NH+J3WSJAes2ZMea4u0KP3T6oFuIt5TWNLI19M5RF0rsGYHdlWxWdmjB5 IkGv5hjqYjDdnV0+ZNZy0fwEjdqGUWaFOPxBvF4HedgMIimm1ji2IJYaRk0L7Qhn6hXj bLq2T8yOZepxZSQE0lVbygZ2zrsm1FDpCGFVBUTg5uR7Fp9gV2MAfMeXkkH6Zu5Ukopc lkQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=iXVoGEfx; 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 l10-20020a67d50a000000b00416405d9594si700242vsj.271.2023.03.13.20.08.56; Mon, 13 Mar 2023 20:09:10 -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=iXVoGEfx; 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 S230104AbjCNDGM (ORCPT + 99 others); Mon, 13 Mar 2023 23:06:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230029AbjCNDGG (ORCPT ); Mon, 13 Mar 2023 23:06:06 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B7D07B98A; Mon, 13 Mar 2023 20:06:03 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id p6so15221370plf.0; Mon, 13 Mar 2023 20:06:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678763162; 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=QMnMHWGI+QQmPd732o6xoqQE9KAk9SBU5515vgJD5J0=; b=iXVoGEfxqwaNVGV26EajhgquusIVcbpIlWLIhVGZ4F0VGtbRbc2a0KSAaT36hp0yEl A/nwBePWIo66HWBG7PNWaZjJck4SF2ODZL3d4QcAIvc2lhho3kWZvUO9yTKGyNvCGIIS 3ZxTdtgQ1SbA08iVLVeHCCuH44/KDkX2gAzxIE7U/PfuIoYSviDyCMchCcCrqsSDBUd8 qiY16BnIbUYlIlmJImzNxL6rX7qn4fhdDMrrMFJQEhxMWjdGoW6kq4HvvDMt1ZxZfHRP 6EAFu0T85Gsz6XerT75UMjgK6HAylsc4HzvHNwXbqsqlJt2PYJWJv5U8cUHDrGlr/PNu HgdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678763162; 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=QMnMHWGI+QQmPd732o6xoqQE9KAk9SBU5515vgJD5J0=; b=NwlFGKOuPmHLvSaLz1S0manqmuu5JaFBcZ8ZpSqHpSBQxsiPmAn/ec2SQnZk9W8sbd 6TDnHm/6pgTDIpzEbOJURbGyLbJi77FLLsYHpjz82qAEBkLqcDjURJCgpzBrEwpmyNG+ vVn8NyW7g6ij59fcBLuFm/BxvtU90Pgl3zEb0J73g0a4CyQWWFKSobfSu2zPeYBe7XMV KLIEl7yZY5y0HQLkywB3pdTLp6iljmSCasCEHSiJxtQzt1TLND1g0Ecdf5hsRZjiALEs HW1ybDkpAqHtuzYn2ugmXKsDlaYnCQ2TydMuoihpDgbepyBfFgTniJNyaBLP4+MTV9BY SQEA== X-Gm-Message-State: AO0yUKUHRR+rKHkum99Yb+sCHkTiFMDBdGOJN+2AkID73kwD83N5b820 JlWbNifeEMDtBr0UJp+cUeQ= X-Received: by 2002:a05:6a20:a021:b0:d0:212d:ead0 with SMTP id p33-20020a056a20a02100b000d0212dead0mr10062481pzj.26.1678763162587; Mon, 13 Mar 2023 20:06:02 -0700 (PDT) Received: from KERNELXING-MB0.tencent.com ([103.7.29.31]) by smtp.gmail.com with ESMTPSA id i17-20020aa787d1000000b005897f5436c0sm395433pfo.118.2023.03.13.20.05.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 20:06:02 -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 v2 net-next 1/2] net-sysfs: display two backlog queue len separately Date: Tue, 14 Mar 2023 11:05:31 +0800 Message-Id: <20230314030532.9238-2-kerneljasonxing@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230314030532.9238-1-kerneljasonxing@gmail.com> References: <20230314030532.9238-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?1760310959288648759?= X-GMAIL-MSGID: =?utf-8?q?1760310959288648759?= 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 --- 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 | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/net/core/net-procfs.c b/net/core/net-procfs.c index 1ec23bf8b05c..2809b663e78d 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,15 @@ 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), /* keep it untouched */ + (int)seq->index, + softnet_input_pkt_queue_len(sd), softnet_process_queue_len(sd)); return 0; } From patchwork Tue Mar 14 03:05:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Xing X-Patchwork-Id: 69272 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1534817wrd; Mon, 13 Mar 2023 20:09:45 -0700 (PDT) X-Google-Smtp-Source: AK7set/9Vz8oGak5KVtM8xZ6XiG9txKl2/8ZvIi6niY0AbpOHkDn3NN3eE6PvlCYNuW0Y1b4J1HL X-Received: by 2002:a05:6102:d93:b0:419:11b7:a8fa with SMTP id d19-20020a0561020d9300b0041911b7a8famr10757329vst.25.1678763384881; Mon, 13 Mar 2023 20:09:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678763384; cv=none; d=google.com; s=arc-20160816; b=Ehcr31Rx8lD20gw96pvT+cqMrdin39w3yW6XogtJ0j+WVq0/74U1qvFAXIXOXrfkJW D0U3Vf9ShvT7GVOfxt/0/+yz4lEYrmOV8s6rgr6KNSUsrpJkdM57Mc8T42xalmxYzuBp j4xgOSdVYDi8WtGMYpfzLGNWGZoh2TcuTsOjsJQckqhRd9hZR9ABIqMyU14htduG2lAa 1cV9RsKJeQktt6Br2EfuKbR79JwII8At5cl0wkcG89f9z9963v9gjyAOFeCKqP+bH70X aHnCWRRUsPaZZ94q+KsFsuI1Nq33hTORBHo11ZRZuuXgJOtGcaS7rr0w8yANRxoj4IuJ j7Uw== 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=2Glcb7gbJW/2Kbapciwm0FRpblb1W2IM9lseG0c3UVk=; b=FjEG1NOTkmujXdmEUOyHAlLr2jzXXyx6unLHxDYbutSA1jWc0lEYprCV0NMg7a2d3H WHLqlOYnHzvxRqP25Kmdp47s7SjJhpcrvub0pMzBkGB5uQrSjMqCarkZpFSIdPBvUUJS L2NF7QHwr6qhlCQu2oCePEYSuXiFUf3aKSY5y5DED7TC5HL3jWnFT4vnVXxblnPclorE ArP/P+fz7Sf7+fW5Ecu/QZ6qFhFPCMsT7FQcRmFb8eptJSct63PKyadrWs2HTtRKr7mV emThwFJFcU2yIw5pUR7C5loSX5+Ndqif5SmmFwOeYdL2hChhJHdN4bIi/dRdbI5XedbR RayA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=P+3u6NYE; 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 y7-20020a67f247000000b004122af0febdsi635582vsm.132.2023.03.13.20.09.30; Mon, 13 Mar 2023 20:09:44 -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=P+3u6NYE; 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 S229949AbjCNDGi (ORCPT + 99 others); Mon, 13 Mar 2023 23:06:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230110AbjCNDGX (ORCPT ); Mon, 13 Mar 2023 23:06:23 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A34C7BA06; Mon, 13 Mar 2023 20:06:10 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id k18-20020a17090a591200b0023d36e30cb5so896973pji.1; Mon, 13 Mar 2023 20:06:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678763170; 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=2Glcb7gbJW/2Kbapciwm0FRpblb1W2IM9lseG0c3UVk=; b=P+3u6NYEU+wMUxXhli0xb9agEpaA6rAdyhhqv7F8djnqrYstY9on7CGvzQP1zdoevf NWkMtZEbWX/TxXP3XQF1660nVQPDjimbAZJQgpfrypNnkAjnTGKUTtl3xIfD/cOyxpg7 xOwJKroR6D35gqb6VUH8uigc7+K6RzQTe8KxLzJVw0rw8xp7wBYfkZsUhc1wPtggRpy+ YM48WOGRAxeWlSvOvx8pdiLGEWQD3+071OTvPApuEApVHf0cB5FgbsKkOoIEw76WNjbf 6NhoFg/wEgav9IwJbAxSqb+stO6g5dkh1ABPjrK2YbjATAbpPFYPHQ6CN+P44sYz/PnO WaRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678763170; 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=2Glcb7gbJW/2Kbapciwm0FRpblb1W2IM9lseG0c3UVk=; b=oejqAvzFRAm33/1a9a8rQn4WHYHXD6G18B9Clsl7xp8O/903/322J31m0YgUTW3H7D 6uCtgusPwWisVLTF3I+iI5cMXBdiE3fsUoWE2NTRlVSi/Pefwj8sUkTFku6d27+RbHLv rt0vAmK0LH13VE3hX8fACNCwLkZrRktgTbjFOPZDgOB3tkcXcp/mqlQhx2/cfInxs5DR rfKflO7BVUaD+ThPHTBgn+V/7OMtJ0LCnzYWgpqxJEHW6pk4+W7b4gN3bLmNkIEkYkEJ eWWF/sTPMzs6hRKlA2K2Xbo7eaxloYsza1MIhZppruMgAOoyTU5BnzqHEmEyZPUjs78a y4iQ== X-Gm-Message-State: AO0yUKWecq4MgJFwC5FfsxxmByLKNYzSnQl9GGxCkcH5QczNMbXfOaTK DwqVOMsOWtVhKhPlhN5PCXk= X-Received: by 2002:a05:6a20:6009:b0:d4:b24b:4459 with SMTP id r9-20020a056a20600900b000d4b24b4459mr3749090pza.13.1678763170003; Mon, 13 Mar 2023 20:06:10 -0700 (PDT) Received: from KERNELXING-MB0.tencent.com ([103.7.29.31]) by smtp.gmail.com with ESMTPSA id i17-20020aa787d1000000b005897f5436c0sm395433pfo.118.2023.03.13.20.06.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 20:06:09 -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 v2 net-next 2/2] net: introduce budget_squeeze to help us tune rx behavior Date: Tue, 14 Mar 2023 11:05:32 +0800 Message-Id: <20230314030532.9238-3-kerneljasonxing@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230314030532.9238-1-kerneljasonxing@gmail.com> References: <20230314030532.9238-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?1760310995512936978?= X-GMAIL-MSGID: =?utf-8?q?1760310995512936978?= 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 --- 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 | 9 ++++++--- 3 files changed, 15 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 2809b663e78d..25810ee46a04 100644 --- a/net/core/net-procfs.c +++ b/net/core/net-procfs.c @@ -179,14 +179,17 @@ 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, /* keep it untouched */ + 0, 0, 0, 0, 0, /* was fastroute */ 0, /* was cpu_collision */ sd->received_rps, flow_limit_count, softnet_backlog_len(sd), /* keep it untouched */ (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; }