Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1472626 > unrolled thread
| Started by | Bhaktipriya Shridhar <bhaktipriya96@gmail.com> |
|---|---|
| First post | 2016-08-30 18:40 +0200 |
| Last post | 2016-08-31 16:10 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] rsxx: Remove deprecated create_singlethread_workqueue Bhaktipriya Shridhar <bhaktipriya96@gmail.com> - 2016-08-30 18:40 +0200
Re: [PATCH] rsxx: Remove deprecated create_singlethread_workqueue Tejun Heo <tj@kernel.org> - 2016-08-31 16:10 +0200
| From | Bhaktipriya Shridhar <bhaktipriya96@gmail.com> |
|---|---|
| Date | 2016-08-30 18:40 +0200 |
| Subject | [PATCH] rsxx: Remove deprecated create_singlethread_workqueue |
| Message-ID | <sbUeS-7ka-19@gated-at.bofh.it> |
The workqueue "creg_wq" queues a single work item viz
&card->creg_ctrl.done_work and hence it doesn't require execution
ordering. Hence, alloc_workqueue has been used to replace the
deprecated create_singlethread_workqueue instance.
The workqueue "event_wq" queues a single work item viz &card->event_work
and hence it doesn't require execution ordering. Hence, alloc_workqueue
has been used to replace the deprecated create_singlethread_workqueue
instance.
The WQ_MEM_RECLAIM flag has been set in both cases to ensure forward
progress under memory pressure.
Since there are a fixed number of work items, explicit concurrency
limit is unnecessary here.
Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
---
drivers/block/rsxx/core.c | 3 ++-
drivers/block/rsxx/cregs.c | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/block/rsxx/core.c b/drivers/block/rsxx/core.c
index 34997df..d46cab9 100644
--- a/drivers/block/rsxx/core.c
+++ b/drivers/block/rsxx/core.c
@@ -887,7 +887,8 @@ static int rsxx_pci_probe(struct pci_dev *dev,
}
/************* Setup Card Event Handler *************/
- card->event_wq = create_singlethread_workqueue(DRIVER_NAME"_event");
+ card->event_wq = alloc_workqueue(DRIVER_NAME "_event", WQ_MEM_RECLAIM,
+ 0);
if (!card->event_wq) {
dev_err(CARD_TO_DEV(card), "Failed card event setup.\n");
goto failed_event_handler;
diff --git a/drivers/block/rsxx/cregs.c b/drivers/block/rsxx/cregs.c
index 926dce9..4f5a2e8 100644
--- a/drivers/block/rsxx/cregs.c
+++ b/drivers/block/rsxx/cregs.c
@@ -736,8 +736,8 @@ int rsxx_creg_setup(struct rsxx_cardinfo *card)
{
card->creg_ctrl.active_cmd = NULL;
- card->creg_ctrl.creg_wq =
- create_singlethread_workqueue(DRIVER_NAME"_creg");
+ card->creg_ctrl.creg_wq = alloc_workqueue(DRIVER_NAME "_creg",
+ WQ_MEM_RECLAIM, 0);
if (!card->creg_ctrl.creg_wq)
return -ENOMEM;
--
2.1.4
[toc] | [next] | [standalone]
| From | Tejun Heo <tj@kernel.org> |
|---|---|
| Date | 2016-08-31 16:10 +0200 |
| Message-ID | <sceng-3nc-33@gated-at.bofh.it> |
| In reply to | #1472626 |
On Tue, Aug 30, 2016 at 10:04:28PM +0530, Bhaktipriya Shridhar wrote: > The workqueue "creg_wq" queues a single work item viz > &card->creg_ctrl.done_work and hence it doesn't require execution > ordering. Hence, alloc_workqueue has been used to replace the > deprecated create_singlethread_workqueue instance. > > The workqueue "event_wq" queues a single work item viz &card->event_work > and hence it doesn't require execution ordering. Hence, alloc_workqueue > has been used to replace the deprecated create_singlethread_workqueue > instance. > > The WQ_MEM_RECLAIM flag has been set in both cases to ensure forward > progress under memory pressure. > > Since there are a fixed number of work items, explicit concurrency > limit is unnecessary here. > > Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Acked-by: Tejun Heo <tj@kernel.org> Thanks. -- tejun
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web