Re: [RFC PATCH 00/18] kthreads/signal: Safer kthread API and signal handling

2015-06-17 Thread Christoph Hellwig
On Fri, Jun 05, 2015 at 05:00:59PM +0200, Petr Mladek wrote: > Kthreads are implemented as an infinite loop. They include check points > for termination, freezer, parking, and even signal handling. > > We need to touch all kthreads every time we want to add or > modify the behavior of such checkpo

Re: [RFC PATCH 00/18] kthreads/signal: Safer kthread API and signal handling

2015-06-11 Thread Tejun Heo
Hello, Peter. On Wed, Jun 10, 2015 at 12:40:57PM +0200, Peter Zijlstra wrote: > > Because there's a pool of them and the workers come and go > > dynamically. There's no way around it. The attributes just have to > > be per-pool. > > Sure, but there's a few possible ways to still make that work

Re: [RFC PATCH 00/18] kthreads/signal: Safer kthread API and signal handling

2015-06-10 Thread Peter Zijlstra
On Tue, Jun 09, 2015 at 03:14:46PM +0900, Tejun Heo wrote: > Hey, Peter. > > On Fri, Jun 05, 2015 at 06:22:16PM +0200, Peter Zijlstra wrote: > > There's a lot more problems with workqueues: > > > > - they're not regular tasks and all the task controls don't work on > >them. This means all th

Re: [RFC PATCH 00/18] kthreads/signal: Safer kthread API and signal handling

2015-06-09 Thread Tejun Heo
Hello, Petr. I've skimmed through the patchset and I'm not quite sure. kthread_iterant seems to map almost one to one to kthread_worker interface. One calls a predefined callback repeatedly while the other queues work items which contain callback. One does nasty plumbing tasks inbetween interati

Re: [RFC PATCH 00/18] kthreads/signal: Safer kthread API and signal handling

2015-06-08 Thread Tejun Heo
Hey, Peter. On Fri, Jun 05, 2015 at 06:22:16PM +0200, Peter Zijlstra wrote: > There's a lot more problems with workqueues: > > - they're not regular tasks and all the task controls don't work on >them. This means all things scheduler, like cpu-affinity, nice, and >RT/deadline scheduling

Re: [RFC PATCH 00/18] kthreads/signal: Safer kthread API and signal handling

2015-06-08 Thread Tejun Heo
Hello, On Fri, Jun 05, 2015 at 05:00:59PM +0200, Petr Mladek wrote: > Workqueue ... > But there are many kthreads that need to cycle many times > until some work is finished, e.g. khugepaged, virtio_balloon, > jffs2_garbage_collect_thread. They would need to queue the > work item repeatedly from t

Re: [RFC PATCH 00/18] kthreads/signal: Safer kthread API and signal handling

2015-06-05 Thread Peter Zijlstra
On Fri, Jun 05, 2015 at 05:00:59PM +0200, Petr Mladek wrote: > Workqueue > > > Workqueues are quite popular and many kthreads have already been > converted into them. > > Work queues allow to split the function into even more pieces and > reach the common check point more often. It is especially

[RFC PATCH 00/18] kthreads/signal: Safer kthread API and signal handling

2015-06-05 Thread Petr Mladek
Kthreads are implemented as an infinite loop. They include check points for termination, freezer, parking, and even signal handling. We need to touch all kthreads every time we want to add or modify the behavior of such checkpoints. It is not easy because there are several hundreds of kthreads and