netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: Added cond_resched() to crdump collection
@ 2024-08-19 21:42 Mohamed Khalfella
  2024-08-20 10:09 ` Przemek Kitszel
  0 siblings, 1 reply; 9+ messages in thread
From: Mohamed Khalfella @ 2024-08-19 21:42 UTC (permalink / raw)
  To: Saeed Mahameed, Leon Romanovsky, Tariq Toukan, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Mohamed Khalfella, Yuanyuan Zhong, Shay Drori, Moshe Shemesh,
	netdev, linux-rdma, linux-kernel

Collecting crdump involves dumping vsc registers from pci config space
of mlx device. The code can run for long time starving other threads
want to run on the cpu. Added conditional reschedule between register
reads and while waiting for register value to release the cpu more
often.

Reviewed-by: Yuanyuan Zhong <yzhong@purestorage.com>
Signed-off-by: Mohamed Khalfella <mkhalfella@purestorage.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/lib/pci_vsc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/pci_vsc.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/pci_vsc.c
index d0b595ba6110..377cc39643b4 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/pci_vsc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/pci_vsc.c
@@ -191,6 +191,7 @@ static int mlx5_vsc_wait_on_flag(struct mlx5_core_dev *dev, u8 expected_val)
 		if ((retries & 0xf) == 0)
 			usleep_range(1000, 2000);
 
+		cond_resched();
 	} while (flag != expected_val);
 
 	return 0;
@@ -280,6 +281,7 @@ int mlx5_vsc_gw_read_block_fast(struct mlx5_core_dev *dev, u32 *data,
 			return read_addr;
 
 		read_addr = next_read_addr;
+		cond_resched();
 	}
 	return length;
 }
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-08-25  5:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-19 21:42 [PATCH] net/mlx5: Added cond_resched() to crdump collection Mohamed Khalfella
2024-08-20 10:09 ` Przemek Kitszel
2024-08-20 22:27   ` Mohamed Khalfella
2024-08-22  6:40     ` Moshe Shemesh
2024-08-22 17:08       ` Mohamed Khalfella
2024-08-23  4:08         ` Przemek Kitszel
2024-08-23  5:16           ` Moshe Shemesh
2024-08-23 17:41             ` Mohamed Khalfella
2024-08-25  5:11               ` Moshe Shemesh

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).