Re: [PATCH v5 05/20] kthread: Add destroy_kthread_worker()

2016-02-26 Thread Petr Mladek
On Thu 2016-02-25 13:36:41, Peter Zijlstra wrote: > On Mon, Feb 22, 2016 at 03:56:55PM +0100, Petr Mladek wrote: > > Also note that drain() correctly handles self-queuing works in compare > > with flush(). > > Nothing seems to prevent adding more work after drain() observes > list_empty(). You mi

Re: [PATCH v5 05/20] kthread: Add destroy_kthread_worker()

2016-02-25 Thread Peter Zijlstra
On Mon, Feb 22, 2016 at 03:56:55PM +0100, Petr Mladek wrote: > Also note that drain() correctly handles self-queuing works in compare > with flush(). Nothing seems to prevent adding more work after drain() observes list_empty().

[PATCH v5 05/20] kthread: Add destroy_kthread_worker()

2016-02-22 Thread Petr Mladek
The current kthread worker users call flush() and stop() explicitly. This function drains the worker, stops it, and frees the kthread_worker struct in one call. It is supposed to be used together with create_kthread_worker*() that allocates struct kthread_worker. Also note that drain() correctly