Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1450699 > unrolled thread
| Started by | Bhaktipriya Shridhar <bhaktipriya96@gmail.com> |
|---|---|
| First post | 2016-07-26 19:10 +0200 |
| Last post | 2016-07-27 00:20 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v2] net/mlx5_core/health: Remove deprecated create_singlethread_workqueue Bhaktipriya Shridhar <bhaktipriya96@gmail.com> - 2016-07-26 19:10 +0200
Re: [PATCH v2] net/mlx5_core/health: Remove deprecated create_singlethread_workqueue Leon Romanovsky <leonro@mellanox.com> - 2016-07-26 20:20 +0200
Re: [PATCH v2] net/mlx5_core/health: Remove deprecated create_singlethread_workqueue David Miller <davem@davemloft.net> - 2016-07-27 00:20 +0200
| From | Bhaktipriya Shridhar <bhaktipriya96@gmail.com> |
|---|---|
| Date | 2016-07-26 19:10 +0200 |
| Subject | [PATCH v2] net/mlx5_core/health: Remove deprecated create_singlethread_workqueue |
| Message-ID | <rZe1I-4Pb-21@gated-at.bofh.it> |
The workqueue health->wq was used as per device private health thread.
This was done to perform delayed work.
The workqueue has a single workitem(&health->work) and
hence doesn't require ordering. It is involved in handling the health of
the device and is not being used on a memory reclaim path.
Hence, the singlethreaded workqueue has been replaced with the use of
system_wq.
Work item has been flushed in mlx5_health_cleanup() to ensure that
there are no pending tasks while disconnecting the driver.
Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
---
Changes in v2:
-Updated commit description as per the feedback received.
drivers/net/ethernet/mellanox/mlx5/core/health.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/health.c b/drivers/net/ethernet/mellanox/mlx5/core/health.c
index 42d16b9..9acbccf 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/health.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/health.c
@@ -267,7 +267,7 @@ static void poll_health(unsigned long data)
if (in_fatal(dev) && !health->sick) {
health->sick = true;
print_health_info(dev);
- queue_work(health->wq, &health->work);
+ schedule_work(&health->work);
}
}
@@ -296,7 +296,7 @@ void mlx5_health_cleanup(struct mlx5_core_dev *dev)
{
struct mlx5_core_health *health = &dev->priv.health;
- destroy_workqueue(health->wq);
+ flush_work(&health->work);
}
int mlx5_health_init(struct mlx5_core_dev *dev)
@@ -311,10 +311,7 @@ int mlx5_health_init(struct mlx5_core_dev *dev)
strcpy(name, "mlx5_health");
strcat(name, dev_name(&dev->pdev->dev));
- health->wq = create_singlethread_workqueue(name);
kfree(name);
- if (!health->wq)
- return -ENOMEM;
INIT_WORK(&health->work, health_care);
--
2.1.4
[toc] | [next] | [standalone]
| From | Leon Romanovsky <leonro@mellanox.com> |
|---|---|
| Date | 2016-07-26 20:20 +0200 |
| Message-ID | <rZf7r-5rm-13@gated-at.bofh.it> |
| In reply to | #1450699 |
[Multipart message — attachments visible in raw view] — view raw
On Tue, Jul 26, 2016 at 10:38:24PM +0530, Bhaktipriya Shridhar wrote: > The workqueue health->wq was used as per device private health thread. > This was done to perform delayed work. > > The workqueue has a single workitem(&health->work) and > hence doesn't require ordering. It is involved in handling the health of > the device and is not being used on a memory reclaim path. > Hence, the singlethreaded workqueue has been replaced with the use of > system_wq. > > Work item has been flushed in mlx5_health_cleanup() to ensure that > there are no pending tasks while disconnecting the driver. > > Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> > --- > Changes in v2: > -Updated commit description as per the feedback received. > > drivers/net/ethernet/mellanox/mlx5/core/health.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) Thanks, Acked-by: Leon Romanovsky <leonro@mellanox.com>
[toc] | [prev] | [next] | [standalone]
| From | David Miller <davem@davemloft.net> |
|---|---|
| Date | 2016-07-27 00:20 +0200 |
| Message-ID | <rZiRI-7L4-33@gated-at.bofh.it> |
| In reply to | #1450699 |
From: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Date: Tue, 26 Jul 2016 22:38:24 +0530 > The workqueue health->wq was used as per device private health thread. > This was done to perform delayed work. > > The workqueue has a single workitem(&health->work) and > hence doesn't require ordering. It is involved in handling the health of > the device and is not being used on a memory reclaim path. > Hence, the singlethreaded workqueue has been replaced with the use of > system_wq. > > Work item has been flushed in mlx5_health_cleanup() to ensure that > there are no pending tasks while disconnecting the driver. > > Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Applied.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web