Re: [PATCH 2/2] kthread_worker: reimplement flush_kthread_work() to allow freeing the work item being executed

2012-07-24 Thread Andy Walls
On Mon, 2012-07-23 at 10:12 -0700, Tejun Heo wrote: > Hello, > > On Sun, Jul 22, 2012 at 04:46:54PM -0400, Andy Walls wrote: > > Hmmm, I didn't know about the constraint about 'known to be alive' in > > the other email I just sent. > > > > That might make calling flush_kthread_work() hard for a

Re: [PATCH 2/2] kthread_worker: reimplement flush_kthread_work() to allow freeing the work item being executed

2012-07-24 Thread Andy Walls
On Mon, 2012-07-23 at 10:12 -0700, Tejun Heo wrote: Hello, On Sun, Jul 22, 2012 at 04:46:54PM -0400, Andy Walls wrote: Hmmm, I didn't know about the constraint about 'known to be alive' in the other email I just sent. That might make calling flush_kthread_work() hard for a user to

Re: [PATCH 2/2] kthread_worker: reimplement flush_kthread_work() to allow freeing the work item being executed

2012-07-23 Thread Tejun Heo
Hello, On Sun, Jul 22, 2012 at 04:46:54PM -0400, Andy Walls wrote: > Hmmm, I didn't know about the constraint about 'known to be alive' in > the other email I just sent. > > That might make calling flush_kthread_work() hard for a user to use, if > the user lets the work get freed by another

Re: [PATCH 2/2] kthread_worker: reimplement flush_kthread_work() to allow freeing the work item being executed

2012-07-23 Thread Tejun Heo
Hello, On Sun, Jul 22, 2012 at 04:46:54PM -0400, Andy Walls wrote: Hmmm, I didn't know about the constraint about 'known to be alive' in the other email I just sent. That might make calling flush_kthread_work() hard for a user to use, if the user lets the work get freed by another thread

Re: [PATCH 2/2] kthread_worker: reimplement flush_kthread_work() to allow freeing the work item being executed

2012-07-22 Thread Andy Walls
On Sun, 2012-07-22 at 09:49 -0700, Tejun Heo wrote: > Hello, > > On Sat, Jul 21, 2012 at 02:20:06PM -0400, Andy Walls wrote: > > > + worker->current_work = work; > > > spin_unlock_irq(>lock); > > > > > > if (work) { > > > __set_current_state(TASK_RUNNING); > > >

Re: [PATCH 2/2] kthread_worker: reimplement flush_kthread_work() to allow freeing the work item being executed

2012-07-22 Thread Andy Walls
Hi Tejun, Thanks for responding to my previous questions. I have one more. On Sat, 2012-07-21 at 14:20 -0400, Andy Walls wrote: > On Thu, 2012-07-19 at 14:16 -0700, Tejun Heo wrote: > > From 06f9a06f4aeecdb9d07014713ab41b548ae219b5 Mon Sep 17 00:00:00 2001 > > From: Tejun Heo > > Date: Thu, 19

Re: [PATCH 2/2] kthread_worker: reimplement flush_kthread_work() to allow freeing the work item being executed

2012-07-22 Thread Tejun Heo
Hello, On Sat, Jul 21, 2012 at 02:20:06PM -0400, Andy Walls wrote: > > + worker->current_work = work; > > spin_unlock_irq(>lock); > > > > if (work) { > > __set_current_state(TASK_RUNNING); > > work->func(work); > > If the call to 'work->func(work);' frees the

Re: [PATCH 2/2] kthread_worker: reimplement flush_kthread_work() to allow freeing the work item being executed

2012-07-22 Thread Tejun Heo
Hello, On Sat, Jul 21, 2012 at 02:20:06PM -0400, Andy Walls wrote: + worker-current_work = work; spin_unlock_irq(worker-lock); if (work) { __set_current_state(TASK_RUNNING); work-func(work); If the call to 'work-func(work);' frees the memory

Re: [PATCH 2/2] kthread_worker: reimplement flush_kthread_work() to allow freeing the work item being executed

2012-07-22 Thread Andy Walls
Hi Tejun, Thanks for responding to my previous questions. I have one more. On Sat, 2012-07-21 at 14:20 -0400, Andy Walls wrote: On Thu, 2012-07-19 at 14:16 -0700, Tejun Heo wrote: From 06f9a06f4aeecdb9d07014713ab41b548ae219b5 Mon Sep 17 00:00:00 2001 From: Tejun Heo t...@kernel.org Date:

Re: [PATCH 2/2] kthread_worker: reimplement flush_kthread_work() to allow freeing the work item being executed

2012-07-22 Thread Andy Walls
On Sun, 2012-07-22 at 09:49 -0700, Tejun Heo wrote: Hello, On Sat, Jul 21, 2012 at 02:20:06PM -0400, Andy Walls wrote: + worker-current_work = work; spin_unlock_irq(worker-lock); if (work) { __set_current_state(TASK_RUNNING); work-func(work); If

Re: [PATCH 2/2] kthread_worker: reimplement flush_kthread_work() to allow freeing the work item being executed

2012-07-21 Thread Andy Walls
On Thu, 2012-07-19 at 14:16 -0700, Tejun Heo wrote: > From 06f9a06f4aeecdb9d07014713ab41b548ae219b5 Mon Sep 17 00:00:00 2001 > From: Tejun Heo > Date: Thu, 19 Jul 2012 13:52:53 -0700 > > kthread_worker provides minimalistic workqueue-like interface for > users which need a dedicated worker

Re: [PATCH 2/2] kthread_worker: reimplement flush_kthread_work() to allow freeing the work item being executed

2012-07-21 Thread Andy Walls
On Thu, 2012-07-19 at 14:16 -0700, Tejun Heo wrote: From 06f9a06f4aeecdb9d07014713ab41b548ae219b5 Mon Sep 17 00:00:00 2001 From: Tejun Heo t...@kernel.org Date: Thu, 19 Jul 2012 13:52:53 -0700 kthread_worker provides minimalistic workqueue-like interface for users which need a dedicated

[PATCH 2/2] kthread_worker: reimplement flush_kthread_work() to allow freeing the work item being executed

2012-07-19 Thread Tejun Heo
>From 06f9a06f4aeecdb9d07014713ab41b548ae219b5 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Thu, 19 Jul 2012 13:52:53 -0700 kthread_worker provides minimalistic workqueue-like interface for users which need a dedicated worker thread (e.g. for realtime priority). It has basic queue,

[PATCH 2/2] kthread_worker: reimplement flush_kthread_work() to allow freeing the work item being executed

2012-07-19 Thread Tejun Heo
From 06f9a06f4aeecdb9d07014713ab41b548ae219b5 Mon Sep 17 00:00:00 2001 From: Tejun Heo t...@kernel.org Date: Thu, 19 Jul 2012 13:52:53 -0700 kthread_worker provides minimalistic workqueue-like interface for users which need a dedicated worker thread (e.g. for realtime priority). It has basic