From: Moshe Shemesh <moshe@nvidia.com>
To: Mohamed Khalfella <mkhalfella@purestorage.com>,
Tariq Toukan <tariqt@nvidia.com>,
Alexander Lobakin <aleksander.lobakin@intel.com>,
"Saeed Mahameed" <saeedm@nvidia.com>,
Leon Romanovsky <leon@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>
Cc: <yzhong@purestorage.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Shay Drori <shayd@nvidia.com>, <netdev@vger.kernel.org>,
<linux-rdma@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 1/1] net/mlx5: Added cond_resched() to crdump collection
Date: Thu, 19 Sep 2024 20:48:20 +0300 [thread overview]
Message-ID: <0d7deb6e-f12d-4cd9-97f5-2661ddaab25a@nvidia.com> (raw)
In-Reply-To: <20240905040249.91241-2-mkhalfella@purestorage.com>
On 9/5/2024 7:02 AM, Mohamed Khalfella wrote:
> Collecting crdump involves reading vsc registers from pci config space
> of mlx device, which can take long time to complete. This might result
> in starving other threads waiting to run on the cpu.
>
> Numbers I got from testing ConnectX-5 Ex MCX516A-CDAT in the lab:
>
> - mlx5_vsc_gw_read_block_fast() was called with length = 1310716.
> - mlx5_vsc_gw_read_fast() reads 4 bytes at a time. It was not used to
> read the entire 1310716 bytes. It was called 53813 times because
> there are jumps in read_addr.
> - On average mlx5_vsc_gw_read_fast() took 35284.4ns.
> - In total mlx5_vsc_wait_on_flag() called vsc_read() 54707 times.
> The average time for each call was 17548.3ns. In some instances
> vsc_read() was called more than one time when the flag was not set.
> As expected the thread released the cpu after 16 iterations in
> mlx5_vsc_wait_on_flag().
> - Total time to read crdump was 35284.4ns * 53813 ~= 1.898s.
>
> It was seen in the field that crdump can take more than 5 seconds to
> complete. During that time mlx5_vsc_wait_on_flag() did not release the
> cpu because it did not complete 16 iterations. It is believed that pci
> config reads were slow. Adding cond_resched() every 128 register read
> improves the situation. In the common case the, crdump takes ~1.8989s,
> the thread yields the cpu every ~4.51ms. If crdump takes ~5s, the thread
> yields the cpu every ~18.0ms.
>
> Fixes: 8b9d8baae1de ("net/mlx5: Add Crdump support")
> Reviewed-by: Yuanyuan Zhong<yzhong@purestorage.com>
> Signed-off-by: Mohamed Khalfella<mkhalfella@purestorage.com>
> ---
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
prev parent reply other threads:[~2024-09-19 17:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-05 4:02 [PATCH v3 0/1] " Mohamed Khalfella
2024-09-05 4:02 ` [PATCH v3 1/1] net/mlx5: " Mohamed Khalfella
2024-09-19 17:48 ` Moshe Shemesh [this message]
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=0d7deb6e-f12d-4cd9-97f5-2661ddaab25a@nvidia.com \
--to=moshe@nvidia.com \
--cc=aleksander.lobakin@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mkhalfella@purestorage.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=saeedm@nvidia.com \
--cc=shayd@nvidia.com \
--cc=tariqt@nvidia.com \
--cc=yzhong@purestorage.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
all inboxes | Powered by JetHome®