linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/4] fs/afs/vlocation: Remove deprecated create_singlethread_workqueue
       [not found] <cover.1472589043.git.bhaktipriya96@gmail.com>
@ 2016-08-30 20:32 ` Bhaktipriya Shridhar
  2016-08-30 20:33 ` [PATCH v2 2/4] fs/afs/rxrpc: " Bhaktipriya Shridhar
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Bhaktipriya Shridhar @ 2016-08-30 20:32 UTC (permalink / raw)
  To: David Howells; +Cc: linux-afs, linux-kernel, Tejun Heo

The workqueue "afs_vlocation_update_worker" queues a single work item
&afs_vlocation_update and hence it doesn't require execution ordering.
Hence, alloc_workqueue has been used to replace the deprecated
create_singlethread_workqueue instance.

Since the workqueue is being used on a memory reclaim path, WQ_MEM_RECLAIM
flag has been set to ensure forward progress under memory pressure.

Since there are fixed number of work items, explicit concurrency
limit is unnecessary here.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
---
 Changes in v2:
	-No change.

 fs/afs/vlocation.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/afs/vlocation.c b/fs/afs/vlocation.c
index 5297678..45a8639 100644
--- a/fs/afs/vlocation.c
+++ b/fs/afs/vlocation.c
@@ -594,8 +594,8 @@ static void afs_vlocation_reaper(struct work_struct *work)
  */
 int __init afs_vlocation_update_init(void)
 {
-	afs_vlocation_update_worker =
-		create_singlethread_workqueue("kafs_vlupdated");
+	afs_vlocation_update_worker = alloc_workqueue("kafs_vlupdated",
+						      WQ_MEM_RECLAIM, 0);
 	return afs_vlocation_update_worker ? 0 : -ENOMEM;
 }

--
2.1.4

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

* [PATCH v2 2/4] fs/afs/rxrpc: Remove deprecated create_singlethread_workqueue
       [not found] <cover.1472589043.git.bhaktipriya96@gmail.com>
  2016-08-30 20:32 ` [PATCH v2 1/4] fs/afs/vlocation: Remove deprecated create_singlethread_workqueue Bhaktipriya Shridhar
@ 2016-08-30 20:33 ` Bhaktipriya Shridhar
  2016-08-30 20:33 ` [PATCH v2 3/4] fs/afs/callback: " Bhaktipriya Shridhar
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Bhaktipriya Shridhar @ 2016-08-30 20:33 UTC (permalink / raw)
  To: David Howells; +Cc: linux-afs, linux-kernel, Tejun Heo

The workqueue "afs_async_calls" queues a single work item viz
&call->async_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 to ensure forward progress under
memory pressure because the workqueue is being used on a memory reclaim
path.

Since there are fixed number of work items, explicit concurrency
limit is unnecessary here.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
---
 Changes in v2:
	-No change

 fs/afs/rxrpc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c
index 63cd9f9..4f9e9b3 100644
--- a/fs/afs/rxrpc.c
+++ b/fs/afs/rxrpc.c
@@ -85,7 +85,7 @@ int afs_open_socket(void)

 	skb_queue_head_init(&afs_incoming_calls);

-	afs_async_calls = create_singlethread_workqueue("kafsd");
+	afs_async_calls = alloc_workqueue("kafsd", WQ_MEM_RECLAIM, 0);
 	if (!afs_async_calls) {
 		_leave(" = -ENOMEM [wq]");
 		return -ENOMEM;
--
2.1.4

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

* [PATCH v2 3/4] fs/afs/callback: Remove deprecated create_singlethread_workqueue
       [not found] <cover.1472589043.git.bhaktipriya96@gmail.com>
  2016-08-30 20:32 ` [PATCH v2 1/4] fs/afs/vlocation: Remove deprecated create_singlethread_workqueue Bhaktipriya Shridhar
  2016-08-30 20:33 ` [PATCH v2 2/4] fs/afs/rxrpc: " Bhaktipriya Shridhar
@ 2016-08-30 20:33 ` Bhaktipriya Shridhar
  2016-08-30 20:34 ` [PATCH v2 4/4] fs/afs/flock: " Bhaktipriya Shridhar
  2016-08-30 22:15 ` [PATCH v2 2/4] fs/afs/rxrpc: " David Howells
  4 siblings, 0 replies; 9+ messages in thread
From: Bhaktipriya Shridhar @ 2016-08-30 20:33 UTC (permalink / raw)
  To: David Howells; +Cc: linux-afs, linux-kernel, Tejun Heo

The workqueue "afs_callback_update_worker" queues multiple work items
viz  &vnode->cb_broken_work, &server->cb_break_work which require strict
execution ordering. Hence, an ordered dedicated workqueue has been used.

Since the workqueue is being used on a memory reclaim path, WQ_MEM_RECLAIM
has been set to ensure forward progress under memory pressure.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
---
 Changes in v2:
	-No change

 fs/afs/callback.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/afs/callback.c b/fs/afs/callback.c
index 7ef637d..1e9d2f8 100644
--- a/fs/afs/callback.c
+++ b/fs/afs/callback.c
@@ -461,8 +461,8 @@ static void afs_callback_updater(struct work_struct *work)
  */
 int __init afs_callback_update_init(void)
 {
-	afs_callback_update_worker =
-		create_singlethread_workqueue("kafs_callbackd");
+	afs_callback_update_worker = alloc_ordered_workqueue("kafs_callbackd",
+							     WQ_MEM_RECLAIM);
 	return afs_callback_update_worker ? 0 : -ENOMEM;
 }

--
2.1.4

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

* [PATCH v2 4/4] fs/afs/flock: Remove deprecated create_singlethread_workqueue
       [not found] <cover.1472589043.git.bhaktipriya96@gmail.com>
                   ` (2 preceding siblings ...)
  2016-08-30 20:33 ` [PATCH v2 3/4] fs/afs/callback: " Bhaktipriya Shridhar
@ 2016-08-30 20:34 ` Bhaktipriya Shridhar
  2016-08-30 22:15 ` [PATCH v2 2/4] fs/afs/rxrpc: " David Howells
  4 siblings, 0 replies; 9+ messages in thread
From: Bhaktipriya Shridhar @ 2016-08-30 20:34 UTC (permalink / raw)
  To: David Howells; +Cc: linux-afs, linux-kernel, Tejun Heo

The workqueue "afs_lock_manager" queues a single work item
&vnode->lock_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 to ensure forward progress under
memory pressure because the workqueue is being used on a memory reclaim
path.

Since there are fixed number of work items, explicit concurrency
limit is unnecessary here.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
---
 Changes in v2:
	-No Change

 fs/afs/flock.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/afs/flock.c b/fs/afs/flock.c
index d91a9c9..3191dff 100644
--- a/fs/afs/flock.c
+++ b/fs/afs/flock.c
@@ -36,8 +36,8 @@ static int afs_init_lock_manager(void)
 	if (!afs_lock_manager) {
 		mutex_lock(&afs_lock_manager_mutex);
 		if (!afs_lock_manager) {
-			afs_lock_manager =
-				create_singlethread_workqueue("kafs_lockd");
+			afs_lock_manager = alloc_workqueue("kafs_lockd",
+							   WQ_MEM_RECLAIM, 0);
 			if (!afs_lock_manager)
 				ret = -ENOMEM;
 		}
--
2.1.4

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

* Re: [PATCH v2 2/4] fs/afs/rxrpc: Remove deprecated create_singlethread_workqueue
       [not found] <cover.1472589043.git.bhaktipriya96@gmail.com>
                   ` (3 preceding siblings ...)
  2016-08-30 20:34 ` [PATCH v2 4/4] fs/afs/flock: " Bhaktipriya Shridhar
@ 2016-08-30 22:15 ` David Howells
  2016-08-31 14:40   ` Tejun Heo
  2016-08-31 20:24   ` David Howells
  4 siblings, 2 replies; 9+ messages in thread
From: David Howells @ 2016-08-30 22:15 UTC (permalink / raw)
  To: Bhaktipriya Shridhar; +Cc: dhowells, linux-afs, linux-kernel, Tejun Heo

Bhaktipriya Shridhar <bhaktipriya96@gmail.com> wrote:

> The workqueue "afs_async_calls" queues a single work item viz
> &call->async_work and hence it doesn't require execution ordering.
> ...
> Since there are fixed number of work items, explicit concurrency
> limit is unnecessary here.

There can be more than one single call and there's no fixed number.

> The workqueue "afs_lock_manager" queues a single work item
> &vnode->lock_work, and hence it doesn't require execution ordering.
> ...
> Since there are fixed number of work items, explicit concurrency
> limit is unnecessary here.

There may be more than one single vnode and there's no fixed number.

David

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

* Re: [PATCH v2 2/4] fs/afs/rxrpc: Remove deprecated create_singlethread_workqueue
  2016-08-30 22:15 ` [PATCH v2 2/4] fs/afs/rxrpc: " David Howells
@ 2016-08-31 14:40   ` Tejun Heo
  2016-08-31 20:24   ` David Howells
  1 sibling, 0 replies; 9+ messages in thread
From: Tejun Heo @ 2016-08-31 14:40 UTC (permalink / raw)
  To: David Howells; +Cc: Bhaktipriya Shridhar, linux-afs, linux-kernel

On Tue, Aug 30, 2016 at 11:15:43PM +0100, David Howells wrote:
> Bhaktipriya Shridhar <bhaktipriya96@gmail.com> wrote:
> 
> > The workqueue "afs_async_calls" queues a single work item viz
> > &call->async_work and hence it doesn't require execution ordering.
> > ...
> > Since there are fixed number of work items, explicit concurrency
> > limit is unnecessary here.
> 
> There can be more than one single call and there's no fixed number.
> 
> > The workqueue "afs_lock_manager" queues a single work item
> > &vnode->lock_work, and hence it doesn't require execution ordering.
> > ...
> > Since there are fixed number of work items, explicit concurrency
> > limit is unnecessary here.
> 
> There may be more than one single vnode and there's no fixed number.

Ah, okay, the work items are dynamically allocated.  Do they need
strict execution ordering or can they be executed concurrently?

Thanks.

-- 
tejun

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

* Re: [PATCH v2 2/4] fs/afs/rxrpc: Remove deprecated create_singlethread_workqueue
  2016-08-30 22:15 ` [PATCH v2 2/4] fs/afs/rxrpc: " David Howells
  2016-08-31 14:40   ` Tejun Heo
@ 2016-08-31 20:24   ` David Howells
  2016-08-31 21:17     ` Tejun Heo
  1 sibling, 1 reply; 9+ messages in thread
From: David Howells @ 2016-08-31 20:24 UTC (permalink / raw)
  To: Tejun Heo; +Cc: dhowells, Bhaktipriya Shridhar, linux-afs, linux-kernel

Tejun Heo <tj@kernel.org> wrote:

> Ah, okay, the work items are dynamically allocated.  Do they need
> strict execution ordering or can they be executed concurrently?

Concurrently is fine.

David

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

* Re: [PATCH v2 2/4] fs/afs/rxrpc: Remove deprecated create_singlethread_workqueue
  2016-08-31 20:24   ` David Howells
@ 2016-08-31 21:17     ` Tejun Heo
  2016-09-01 13:45       ` Bhaktipriya Shridhar
  0 siblings, 1 reply; 9+ messages in thread
From: Tejun Heo @ 2016-08-31 21:17 UTC (permalink / raw)
  To: David Howells; +Cc: Bhaktipriya Shridhar, linux-afs, linux-kernel

Hello, David.

On Wed, Aug 31, 2016 at 09:24:40PM +0100, David Howells wrote:
> Tejun Heo <tj@kernel.org> wrote:
> 
> > Ah, okay, the work items are dynamically allocated.  Do they need
> > strict execution ordering or can they be executed concurrently?
> 
> Concurrently is fine.

I see.  Bhaktpriya, can you please update the patch description?  The
code itself should be fine, I think.

Thanks for the clarification.

-- 
tejun

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

* Re: [PATCH v2 2/4] fs/afs/rxrpc: Remove deprecated create_singlethread_workqueue
  2016-08-31 21:17     ` Tejun Heo
@ 2016-09-01 13:45       ` Bhaktipriya Shridhar
  0 siblings, 0 replies; 9+ messages in thread
From: Bhaktipriya Shridhar @ 2016-09-01 13:45 UTC (permalink / raw)
  To: Tejun Heo; +Cc: David Howells, linux-afs, Linux-Kernel@Vger. Kernel. Org

On Thu, Sep 1, 2016 at 2:47 AM, Tejun Heo <tj@kernel.org> wrote:
> On Wed, Aug 31, 2016 at 09:24:40PM +0100, David Howells wrote:
>> Concurrently is fine.
>
> I see.  Bhaktpriya, can you please update the patch description?  The
> code itself should be fine, I think.
>
Sure. Will update it in v2.

Thanks,
Bhaktipriya

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

end of thread, other threads:[~2016-09-01 13:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cover.1472589043.git.bhaktipriya96@gmail.com>
2016-08-30 20:32 ` [PATCH v2 1/4] fs/afs/vlocation: Remove deprecated create_singlethread_workqueue Bhaktipriya Shridhar
2016-08-30 20:33 ` [PATCH v2 2/4] fs/afs/rxrpc: " Bhaktipriya Shridhar
2016-08-30 20:33 ` [PATCH v2 3/4] fs/afs/callback: " Bhaktipriya Shridhar
2016-08-30 20:34 ` [PATCH v2 4/4] fs/afs/flock: " Bhaktipriya Shridhar
2016-08-30 22:15 ` [PATCH v2 2/4] fs/afs/rxrpc: " David Howells
2016-08-31 14:40   ` Tejun Heo
2016-08-31 20:24   ` David Howells
2016-08-31 21:17     ` Tejun Heo
2016-09-01 13:45       ` Bhaktipriya Shridhar

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