netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Moshe Shemesh <moshe@nvidia.com>,
	"David S. Miller" <davem@davemloft.net>,
	Saeed Mahameed <saeedm@nvidia.com>,
	Leon Romanovsky <leon@kernel.org>,
	Tariq Toukan <tariqt@nvidia.com>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Jiri Pirko <jiri@nvidia.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next 2/9] net: devlink: remove region snapshots list dependency on devlink->lock
Date: Thu, 28 Jul 2022 10:50:29 +0200	[thread overview]
Message-ID: <YuJN1SYkPR33trcs@nanopsycho> (raw)
In-Reply-To: <20220727190156.0ec856ae@kernel.org>

Thu, Jul 28, 2022 at 04:01:56AM CEST, kuba@kernel.org wrote:
>On Wed, 27 Jul 2022 20:03:29 +0300 Moshe Shemesh wrote:
>> From: Jiri Pirko <jiri@nvidia.com>
>> 
>> After mlx4 driver is converted to do locked reload,
>> devlink_region_snapshot_create() may be called from both locked and
>> unlocked context.
>
>You need to explain why, tho. What makes region snapshots special? 

Will do.


>
>> So resolve this by removing dependency on devlink->lock for region
>> snapshots list consistency and introduce new mutex to ensure it.
>
>I was hoping to avoid per-subobject locks. What prevents us from
>depending on the instance lock here (once the driver is converted)?

The fact that it could be called in mlx4 from both devl locked and
unlocked context. Basically whenever CMD to fw is called.

What is wrong in small locks here and there when they are sufficient?


  reply	other threads:[~2022-07-28  8:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-27 17:03 [PATCH net-next 0/9] Take devlink lock on mlx4 and mlx5 callbacks Moshe Shemesh
2022-07-27 17:03 ` [PATCH net-next 1/9] net: devlink: remove region snapshot ID tracking dependency on devlink->lock Moshe Shemesh
2022-07-28  1:58   ` Jakub Kicinski
2022-07-28  8:46     ` Jiri Pirko
2022-07-28  9:21       ` Jiri Pirko
2022-07-27 17:03 ` [PATCH net-next 2/9] net: devlink: remove region snapshots list " Moshe Shemesh
2022-07-28  2:01   ` Jakub Kicinski
2022-07-28  8:50     ` Jiri Pirko [this message]
2022-07-28 16:16       ` Jakub Kicinski
2022-07-27 17:03 ` [PATCH net-next 3/9] net/mlx5: Move fw reset unload to mlx5_fw_reset_complete_reload Moshe Shemesh
2022-07-27 17:03 ` [PATCH net-next 4/9] net/mlx5: Lock mlx5 devlink reload callbacks Moshe Shemesh
2022-07-27 17:03 ` [PATCH net-next 5/9] net/mlx4: Use devl_ API for devlink region create / destroy Moshe Shemesh
2022-07-27 17:03 ` [PATCH net-next 6/9] net/mlx4: Use devl_ API for devlink port register / unregister Moshe Shemesh
2022-07-27 17:03 ` [PATCH net-next 7/9] net/mlx4: Lock mlx4 devlink reload callback Moshe Shemesh
2022-07-27 17:03 ` [PATCH net-next 8/9] net/mlx5: Lock mlx5 devlink health recovery callback Moshe Shemesh
2022-07-27 17:03 ` [PATCH net-next 9/9] devlink: Hold the instance lock in health callbacks Moshe Shemesh

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=YuJN1SYkPR33trcs@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jiri@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=moshe@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).