From: Leon Romanovsky <leon@kernel.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Ivan Vecera <ivecera@redhat.com>,
SlawomirX Laba <slawomirx.laba@intel.com>,
Eric Dumazet <edumazet@google.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>,
"Piotrowski, Patryk" <patryk.piotrowski@intel.com>,
intel-wired-lan@lists.osuosl.org, Paolo Abeni <pabeni@redhat.com>,
"David S. Miller" <davem@davemloft.net>,
"sassmann@redhat.com" <sassmann@redhat.com>
Subject: Re: [Intel-wired-lan] [PATCH net] iavf: Do not restart Tx queues after reset task failure
Date: Thu, 10 Nov 2022 23:07:21 +0200 [thread overview]
Message-ID: <Y21oCUjEHEMr9HGb@unreal> (raw)
In-Reply-To: <20221110122418.32414666@kernel.org>
On Thu, Nov 10, 2022 at 12:24:18PM -0800, Jakub Kicinski wrote:
> On Thu, 10 Nov 2022 19:07:02 +0200 Leon Romanovsky wrote:
> > > > Yes I think you're right. A ton of people check it without the
> > > > lock but I think thats not strictly safe. Is dev_close safe to
> > > > call when netif_running is false? Why not just remove the check
> > > > and always call dev_close then.
> > >
> > > Check for a bit value (like netif_runnning()) is much cheaper than
> > > unconditionally taking global lock like RTNL.
> >
> > This cheap operation is racy and performed in non-performance
> > critical path.
>
> To be clear - the rtnl_lock around the entire if is still racy
> in the grand scheme of things, no? What's stopping someone from
> bringing the device right back up after you drop the lock?
I want to believe what there is some sort of state machine that won't
allow simple toggling of dev_close/dev_open. If it doesn't, rtnl_lock
users should audit their code for possible toggling right after that
lock is dropped.
Anyway, this discussion reminds me our devl_lock debate where we had
completely opposite views if rtnl_lock model is the right one.
https://lore.kernel.org/netdev/20211101073259.33406da3@kicinski-fedora-PC1C0HJN/
Let's not start argue again, we had enough back then. :)
Thanks
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
WARNING: multiple messages have this Message-ID (diff)
From: Leon Romanovsky <leon@kernel.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Ivan Vecera <ivecera@redhat.com>,
"Keller, Jacob E" <jacob.e.keller@intel.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"sassmann@redhat.com" <sassmann@redhat.com>,
"Piotrowski, Patryk" <patryk.piotrowski@intel.com>,
SlawomirX Laba <slawomirx.laba@intel.com>,
"Brandeburg, Jesse" <jesse.brandeburg@intel.com>,
"Nguyen, Anthony L" <anthony.l.nguyen@intel.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
intel-wired-lan@lists.osuosl.org,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net] iavf: Do not restart Tx queues after reset task failure
Date: Thu, 10 Nov 2022 23:07:21 +0200 [thread overview]
Message-ID: <Y21oCUjEHEMr9HGb@unreal> (raw)
In-Reply-To: <20221110122418.32414666@kernel.org>
On Thu, Nov 10, 2022 at 12:24:18PM -0800, Jakub Kicinski wrote:
> On Thu, 10 Nov 2022 19:07:02 +0200 Leon Romanovsky wrote:
> > > > Yes I think you're right. A ton of people check it without the
> > > > lock but I think thats not strictly safe. Is dev_close safe to
> > > > call when netif_running is false? Why not just remove the check
> > > > and always call dev_close then.
> > >
> > > Check for a bit value (like netif_runnning()) is much cheaper than
> > > unconditionally taking global lock like RTNL.
> >
> > This cheap operation is racy and performed in non-performance
> > critical path.
>
> To be clear - the rtnl_lock around the entire if is still racy
> in the grand scheme of things, no? What's stopping someone from
> bringing the device right back up after you drop the lock?
I want to believe what there is some sort of state machine that won't
allow simple toggling of dev_close/dev_open. If it doesn't, rtnl_lock
users should audit their code for possible toggling right after that
lock is dropped.
Anyway, this discussion reminds me our devl_lock debate where we had
completely opposite views if rtnl_lock model is the right one.
https://lore.kernel.org/netdev/20211101073259.33406da3@kicinski-fedora-PC1C0HJN/
Let's not start argue again, we had enough back then. :)
Thanks
next prev parent reply other threads:[~2022-11-10 21:07 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-08 10:25 [Intel-wired-lan] [PATCH net] iavf: Do not restart Tx queues after reset task failure Ivan Vecera
2022-11-08 10:25 ` Ivan Vecera
2022-11-08 16:40 ` [Intel-wired-lan] " Jacob Keller
2022-11-08 16:40 ` Jacob Keller
2022-11-09 18:20 ` [Intel-wired-lan] " Leon Romanovsky
2022-11-09 18:20 ` Leon Romanovsky
2022-11-09 20:11 ` [Intel-wired-lan] " Keller, Jacob E
2022-11-09 20:11 ` Keller, Jacob E
2022-11-10 9:17 ` [Intel-wired-lan] " Leon Romanovsky
2022-11-10 9:17 ` Leon Romanovsky
2022-11-10 14:51 ` [Intel-wired-lan] " Ivan Vecera
2022-11-10 14:51 ` Ivan Vecera
2022-11-10 17:07 ` [Intel-wired-lan] " Leon Romanovsky
2022-11-10 17:07 ` Leon Romanovsky
2022-11-10 20:24 ` [Intel-wired-lan] " Jakub Kicinski
2022-11-10 21:07 ` Leon Romanovsky [this message]
2022-11-10 21:07 ` Leon Romanovsky
2022-11-10 21:13 ` [Intel-wired-lan] " Keller, Jacob E
2022-11-10 21:13 ` Keller, Jacob E
2022-11-18 14:30 ` [Intel-wired-lan] " Jankowski, Konrad0
2022-11-18 14:30 ` Jankowski, Konrad0
2022-11-18 14:31 ` Jankowski, Konrad0
2022-11-18 14:31 ` Jankowski, Konrad0
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y21oCUjEHEMr9HGb@unreal \
--to=leon@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=ivecera@redhat.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=patryk.piotrowski@intel.com \
--cc=sassmann@redhat.com \
--cc=slawomirx.laba@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.