Message ID | 20230315183408.2723-1-praveen.kannoju@oracle.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp65707wrt; Wed, 15 Mar 2023 12:00:18 -0700 (PDT) X-Google-Smtp-Source: AK7set9y6WWQSo/1akK9bE1YeFFiHHR7vO84sxYD3O7pnR0fgFyzSFNPFKJGjFljF2DJMovusQly X-Received: by 2002:a17:903:234a:b0:19e:6e29:2a8c with SMTP id c10-20020a170903234a00b0019e6e292a8cmr685298plh.5.1678906818389; Wed, 15 Mar 2023 12:00:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678906818; cv=none; d=google.com; s=arc-20160816; b=YTyT/gfmzpd6hdyCouWW/64NvwjTSVWnLs0qVyAU/Q1DJeXzaZuGw33XHEIREKjKuK TTbrDbGvOUfZpNHZD+5yZn4QMJht78mMBH6l1CrbbwaqN3gHUUwxHTwpKznQLqLkgxcf 4LPGgv2aUK0r0Ae4YLhzcqkjWtkY5H9roa5RudzPtp5Y1x1aynpf1io2x9ae1WjooVmI yV7TGLY+ZXZASFymmU+0OfLCvak+0xB8IdaNXKBoV8N7+ANPuNbaHUawaMBvrX6AxOl+ RceBZWv5iJe4aAB7LjtFdHD6rczOIGhxmQ2AhRdejt/jHj9Sem6hSjR9U8e4CiCkya5U wvbw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=P/7EMFa2t+TXowDlsQuNMGN1b4u0zwVqVV3/L/WgKK4=; b=KqmhsFS7F5gSnD3tg/gm5YlDCOu7Z7JjXsDJz4kC+ra2HJ44xgh83r+Qcxf3T9EMD3 jAyJkqdj/47db2Xw0MlPZLm7VYdHOk7s1HKKzYIB3lt9TD3iJNYBjpv9EfA0aDBrmGCP 4ltgzLw+OSa/bsQZCTX5NcLXCYyh1h+7rCsepanFpM8v12AAhjXWzAgy3k8rMaoW7+hN OHmRMs6hVTrDM9BAbXmXELDZTccXx+EEDmihvNMGBWq4IhU/+8kSeXI3JEhDVj745rcY zpKIXyKdxEJxM4/i8/lhvrD6QmolE2rNCPLEsrhOTsz/Vrqt0/MHZ7aNQ7UqbXaoGZEo GVXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b="ZQGF/Qw1"; 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=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lc15-20020a170902fa8f00b0019ca5ddecfesi5608629plb.92.2023.03.15.12.00.03; Wed, 15 Mar 2023 12:00:18 -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=@oracle.com header.s=corp-2022-7-12 header.b="ZQGF/Qw1"; 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=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232351AbjCOSgF (ORCPT <rfc822;ruipengqi7@gmail.com> + 99 others); Wed, 15 Mar 2023 14:36:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232490AbjCOSfq (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 15 Mar 2023 14:35:46 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6EF99544E; Wed, 15 Mar 2023 11:35:08 -0700 (PDT) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32FIJsgG005415; Wed, 15 Mar 2023 18:34:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=corp-2022-7-12; bh=P/7EMFa2t+TXowDlsQuNMGN1b4u0zwVqVV3/L/WgKK4=; b=ZQGF/Qw1JWtDX9DCcCX1UeBREoL+8DNnFzlXhNkvaakn5lc18b394eMsz5REM1/HGoMc a2gynTLxVZpVFrFD87tE0FJAvS5aEOJFAH3CirD+/jf+xqnKAQY8K5fBp8u6pOZf6L7a WIoLfMx3Q3yBeetO8liKR/GvlMJdooMIVqnmwi9YDKMcDl2X9xvrSHpftVLGuJzr8lyS +/rD+2NYLR0CuaQY4klz1xMYuZJFjV+mnTdshBDXkonJmW7chhB4bERXgw1g/TOOldqe Q60nddcG/LqnelPnm0pJnMMguiiPGQnf+vHpd5tmk1b47tXKxRKeW4bJ6KgI4swk4f9Y Xg== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3pb2u324pf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Mar 2023 18:34:20 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 32FHXpTO025203; Wed, 15 Mar 2023 18:34:17 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3pb2w7rwea-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Mar 2023 18:34:17 +0000 Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32FIYHX3019740; Wed, 15 Mar 2023 18:34:17 GMT Received: from pkannoju-vm.us.oracle.com (dhcp-10-191-221-114.vpn.oracle.com [10.191.221.114]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3pb2w7rw9j-1; Wed, 15 Mar 2023 18:34:17 +0000 From: Praveen Kumar Kannoju <praveen.kannoju@oracle.com> To: jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: rajesh.sivaramasubramaniom@oracle.com, rama.nichanamatlu@oracle.com, manjunath.b.patil@oracle.com, Praveen Kumar Kannoju <praveen.kannoju@oracle.com> Subject: [PATCH RFC] net/sched: use real_num_tx_queues in dev_watchdog() Date: Thu, 16 Mar 2023 00:04:08 +0530 Message-Id: <20230315183408.2723-1-praveen.kannoju@oracle.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-15_10,2023-03-15_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=992 adultscore=0 spamscore=0 mlxscore=0 phishscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2302240000 definitions=main-2303150154 X-Proofpoint-ORIG-GUID: 56azL7HXCPNjAfmjjgUaV0TP6tNgiKV2 X-Proofpoint-GUID: 56azL7HXCPNjAfmjjgUaV0TP6tNgiKV2 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760461396104327374?= X-GMAIL-MSGID: =?utf-8?q?1760461396104327374?= |
Series |
[RFC] net/sched: use real_num_tx_queues in dev_watchdog()
|
|
Commit Message
Praveen Kannoju
March 15, 2023, 6:34 p.m. UTC
Currently dev_watchdog() loops through num_tx_queues[Number of TX queues
allocated at alloc_netdev_mq() time] instead of real_num_tx_queues
[Number of TX queues currently active in device] to detect transmit
queue time out. Make this efficient by using real_num_tx_queues.
Signed-off-by: Praveen Kumar Kannoju <praveen.kannoju@oracle.com>
---
PS: Please let me know if I am missing something obvious here.
net/sched/sch_generic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Ping. > -----Original Message----- > From: Praveen Kumar Kannoju <praveen.kannoju@oracle.com> > Sent: 16 March 2023 12:04 AM > To: jhs@mojatatu.com; xiyou.wangcong@gmail.com; jiri@resnulli.us; davem@davemloft.net; edumazet@google.com; > kuba@kernel.org; pabeni@redhat.com; netdev@vger.kernel.org; linux-kernel@vger.kernel.org > Cc: Rajesh Sivaramasubramaniom <rajesh.sivaramasubramaniom@oracle.com>; Rama Nichanamatlu > <rama.nichanamatlu@oracle.com>; Manjunath Patil <manjunath.b.patil@oracle.com>; Praveen Kannoju > <praveen.kannoju@oracle.com> > Subject: [PATCH RFC] net/sched: use real_num_tx_queues in dev_watchdog() > > Currently dev_watchdog() loops through num_tx_queues[Number of TX queues allocated at alloc_netdev_mq() time] instead of > real_num_tx_queues [Number of TX queues currently active in device] to detect transmit queue time out. Make this efficient by > using real_num_tx_queues. > > Signed-off-by: Praveen Kumar Kannoju <praveen.kannoju@oracle.com> > --- > PS: Please let me know if I am missing something obvious here. > net/sched/sch_generic.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index a9aadc4e6858..e7d41a25f0e8 100644 > --- a/net/sched/sch_generic.c > +++ b/net/sched/sch_generic.c > @@ -506,7 +506,7 @@ static void dev_watchdog(struct timer_list *t) > unsigned int i; > unsigned long trans_start; > > - for (i = 0; i < dev->num_tx_queues; i++) { > + for (i = 0; i < dev->real_num_tx_queues; i++) { > struct netdev_queue *txq; > > txq = netdev_get_tx_queue(dev, i); > -- > 2.31.1
On Tue, Mar 21, 2023 at 3:05 AM Praveen Kannoju <praveen.kannoju@oracle.com> wrote: > > Ping. > I do not think dev_watchdog() needs to be efficient ? In any case, reading dev->real_num_tx_queues from a timer handler could be racy vs RTNL. While reading dev->num_tx_queues is not racy. I think you should describe what problem you are trying to solve. > > -----Original Message----- > > From: Praveen Kumar Kannoju <praveen.kannoju@oracle.com> > > Sent: 16 March 2023 12:04 AM > > To: jhs@mojatatu.com; xiyou.wangcong@gmail.com; jiri@resnulli.us; davem@davemloft.net; edumazet@google.com; > > kuba@kernel.org; pabeni@redhat.com; netdev@vger.kernel.org; linux-kernel@vger.kernel.org > > Cc: Rajesh Sivaramasubramaniom <rajesh.sivaramasubramaniom@oracle.com>; Rama Nichanamatlu > > <rama.nichanamatlu@oracle.com>; Manjunath Patil <manjunath.b.patil@oracle.com>; Praveen Kannoju > > <praveen.kannoju@oracle.com> > > Subject: [PATCH RFC] net/sched: use real_num_tx_queues in dev_watchdog() > > > > Currently dev_watchdog() loops through num_tx_queues[Number of TX queues allocated at alloc_netdev_mq() time] instead of > > real_num_tx_queues [Number of TX queues currently active in device] to detect transmit queue time out. Make this efficient by > > using real_num_tx_queues. > > > > Signed-off-by: Praveen Kumar Kannoju <praveen.kannoju@oracle.com> > > --- > > PS: Please let me know if I am missing something obvious here. > > net/sched/sch_generic.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index a9aadc4e6858..e7d41a25f0e8 100644 > > --- a/net/sched/sch_generic.c > > +++ b/net/sched/sch_generic.c > > @@ -506,7 +506,7 @@ static void dev_watchdog(struct timer_list *t) > > unsigned int i; > > unsigned long trans_start; > > > > - for (i = 0; i < dev->num_tx_queues; i++) { > > + for (i = 0; i < dev->real_num_tx_queues; i++) { > > struct netdev_queue *txq; > > > > txq = netdev_get_tx_queue(dev, i); > > -- > > 2.31.1 >
Thank you for the reply, Eric. During net device allocation through the routine "alloc_netdev_mqs()", both the variables "num_tx_queues" and "real_num_tx_queues" are being initialized with same value. After which, drivers chose the number of active queues which are being supported by them and update the variable " real_num_tx_queues " using the routine "netif_set_real_num_tx_queues()". The intention of sending this patch was, Is it not efficient to monitor only the queues which are actively being used by the device instead of ones which are not at all participating in data communication. For example we have seen that for a bnxt interface the values of "num_tx_queues" and "real_num_tx_queues" are 74 and 8 respectively, and for IGB interface they were 8 and 4. So around 50% to 90% of un-necessary queues are being monitored by the device watchdog at every interval. - Praveen > -----Original Message----- > From: Eric Dumazet <edumazet@google.com> > Sent: 21 March 2023 04:38 PM > To: Praveen Kannoju <praveen.kannoju@oracle.com> > Cc: jhs@mojatatu.com; xiyou.wangcong@gmail.com; jiri@resnulli.us; davem@davemloft.net; kuba@kernel.org; pabeni@redhat.com; > netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Rajesh Sivaramasubramaniom <rajesh.sivaramasubramaniom@oracle.com>; > Rama Nichanamatlu <rama.nichanamatlu@oracle.com>; Manjunath Patil <manjunath.b.patil@oracle.com> > Subject: Re: [PATCH RFC] net/sched: use real_num_tx_queues in dev_watchdog() > > On Tue, Mar 21, 2023 at 3:05 AM Praveen Kannoju <praveen.kannoju@oracle.com> wrote: > > > > Ping. > > > > I do not think dev_watchdog() needs to be efficient ? > > In any case, reading dev->real_num_tx_queues from a timer handler could be racy vs RTNL. > > While reading dev->num_tx_queues is not racy. > > I think you should describe what problem you are trying to solve. > > > > -----Original Message----- > > > From: Praveen Kumar Kannoju <praveen.kannoju@oracle.com> > > > Sent: 16 March 2023 12:04 AM > > > To: jhs@mojatatu.com; xiyou.wangcong@gmail.com; jiri@resnulli.us; > > > davem@davemloft.net; edumazet@google.com; kuba@kernel.org; > > > pabeni@redhat.com; netdev@vger.kernel.org; > > > linux-kernel@vger.kernel.org > > > Cc: Rajesh Sivaramasubramaniom > > > <rajesh.sivaramasubramaniom@oracle.com>; Rama Nichanamatlu > > > <rama.nichanamatlu@oracle.com>; Manjunath Patil > > > <manjunath.b.patil@oracle.com>; Praveen Kannoju > > > <praveen.kannoju@oracle.com> > > > Subject: [PATCH RFC] net/sched: use real_num_tx_queues in > > > dev_watchdog() > > > > > > Currently dev_watchdog() loops through num_tx_queues[Number of TX > > > queues allocated at alloc_netdev_mq() time] instead of > > > real_num_tx_queues [Number of TX queues currently active in device] to detect transmit queue time out. Make this efficient by > using real_num_tx_queues. > > > > > > Signed-off-by: Praveen Kumar Kannoju <praveen.kannoju@oracle.com> > > > --- > > > PS: Please let me know if I am missing something obvious here. > > > net/sched/sch_generic.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index > > > a9aadc4e6858..e7d41a25f0e8 100644 > > > --- a/net/sched/sch_generic.c > > > +++ b/net/sched/sch_generic.c > > > @@ -506,7 +506,7 @@ static void dev_watchdog(struct timer_list *t) > > > unsigned int i; > > > unsigned long trans_start; > > > > > > - for (i = 0; i < dev->num_tx_queues; i++) { > > > + for (i = 0; i < dev->real_num_tx_queues; i++) > > > + { > > > struct netdev_queue *txq; > > > > > > txq = netdev_get_tx_queue(dev, i); > > > -- > > > 2.31.1 > >
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index a9aadc4e6858..e7d41a25f0e8 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -506,7 +506,7 @@ static void dev_watchdog(struct timer_list *t) unsigned int i; unsigned long trans_start; - for (i = 0; i < dev->num_tx_queues; i++) { + for (i = 0; i < dev->real_num_tx_queues; i++) { struct netdev_queue *txq; txq = netdev_get_tx_queue(dev, i);