Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-17 Thread Gautham R Shenoy
On Sat, Feb 17, 2007 at 11:02:33AM +0530, Gautham R Shenoy wrote: > This looks ok, but probably we could do it in a better way. > How about an api to thaw only a specific task something like > thaw_process(struct task_struct p). I see that thaw_process already exists in freezer.h! Awesome!! So

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-17 Thread Gautham R Shenoy
On Sat, Feb 17, 2007 at 11:02:33AM +0530, Gautham R Shenoy wrote: This looks ok, but probably we could do it in a better way. How about an api to thaw only a specific task something like thaw_process(struct task_struct p). I see that thaw_process already exists in freezer.h! Awesome!! So

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-16 Thread Gautham R Shenoy
On Fri, Feb 16, 2007 at 01:42:09PM +0530, Srivatsa Vaddagiri wrote: > On Fri, Feb 16, 2007 at 12:46:17PM +0530, Srivatsa Vaddagiri wrote: > > frozen. The only exception is cleaning up of per-cpu threads (which is > > not possible with processes frozen - if we can find a way to make that > >

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-16 Thread Srivatsa Vaddagiri
On Fri, Feb 16, 2007 at 10:46:05PM +0300, Oleg Nesterov wrote: > Instead, we can just clear PF_FROZEN before kthread_should_stop(). That should work too. Thanks! > I don't claim this is better, but this way we don't need to add a > subtle change to process.c. -- Regards, vatsa - To unsubscribe

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-16 Thread Oleg Nesterov
On 02/16, Srivatsa Vaddagiri wrote: > > On Fri, Feb 16, 2007 at 12:46:17PM +0530, Srivatsa Vaddagiri wrote: > > frozen. The only exception is cleaning up of per-cpu threads (which is > > not possible with processes frozen - if we can find a way to make that > > possible, then everything can be

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-16 Thread Oleg Nesterov
On 02/16, Srivatsa Vaddagiri wrote: > > On Wed, Feb 14, 2007 at 11:22:09PM +0300, Oleg Nesterov wrote: > > > o Splits CPU_DEAD into two events namely > > > - CPU_DEAD: which will be handled while the processes are still > > > frozen. > > > > > > - CPU_DEAD_KILL_THREADS: To be

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-16 Thread Oleg Nesterov
On 02/16, Srivatsa Vaddagiri wrote: > > On Wed, Feb 14, 2007 at 10:47:42PM +0300, Oleg Nesterov wrote: > > > for (;;) { > > > - if (cwq->wq->freezeable) > > > + if (cwq->wq->freezeable) { > > > > Else? This is wrong. The change like this should start from making all > >

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-16 Thread Rafael J. Wysocki
On Friday, 16 February 2007 10:59, Srivatsa Vaddagiri wrote: > On Fri, Feb 16, 2007 at 10:29:20AM +0100, Rafael J. Wysocki wrote: > > Well, the suspend code has been developed with the assumption that frozen > > threads stay frozen until _we_ let them thaw by calling thaw_processes(). > > I'm >

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-16 Thread Srivatsa Vaddagiri
On Fri, Feb 16, 2007 at 10:29:20AM +0100, Rafael J. Wysocki wrote: > Well, the suspend code has been developed with the assumption that frozen > threads stay frozen until _we_ let them thaw by calling thaw_processes(). I'm > a bit afraid of this change. Note that only kernel threads created thr'

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-16 Thread Rafael J. Wysocki
On Friday, 16 February 2007 09:12, Srivatsa Vaddagiri wrote: > On Fri, Feb 16, 2007 at 12:46:17PM +0530, Srivatsa Vaddagiri wrote: > > frozen. The only exception is cleaning up of per-cpu threads (which is > > not possible with processes frozen - if we can find a way to make that > > possible,

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-16 Thread Srivatsa Vaddagiri
On Fri, Feb 16, 2007 at 12:46:17PM +0530, Srivatsa Vaddagiri wrote: > frozen. The only exception is cleaning up of per-cpu threads (which is > not possible with processes frozen - if we can find a way to make that > possible, then everything can be done in CPU_DEAD). How abt a patch like below?

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-16 Thread Srivatsa Vaddagiri
On Fri, Feb 16, 2007 at 12:46:17PM +0530, Srivatsa Vaddagiri wrote: frozen. The only exception is cleaning up of per-cpu threads (which is not possible with processes frozen - if we can find a way to make that possible, then everything can be done in CPU_DEAD). How abt a patch like below?

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-16 Thread Rafael J. Wysocki
On Friday, 16 February 2007 09:12, Srivatsa Vaddagiri wrote: On Fri, Feb 16, 2007 at 12:46:17PM +0530, Srivatsa Vaddagiri wrote: frozen. The only exception is cleaning up of per-cpu threads (which is not possible with processes frozen - if we can find a way to make that possible, then

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-16 Thread Srivatsa Vaddagiri
On Fri, Feb 16, 2007 at 10:29:20AM +0100, Rafael J. Wysocki wrote: Well, the suspend code has been developed with the assumption that frozen threads stay frozen until _we_ let them thaw by calling thaw_processes(). I'm a bit afraid of this change. Note that only kernel threads created thr'

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-16 Thread Rafael J. Wysocki
On Friday, 16 February 2007 10:59, Srivatsa Vaddagiri wrote: On Fri, Feb 16, 2007 at 10:29:20AM +0100, Rafael J. Wysocki wrote: Well, the suspend code has been developed with the assumption that frozen threads stay frozen until _we_ let them thaw by calling thaw_processes(). I'm a bit

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-16 Thread Oleg Nesterov
On 02/16, Srivatsa Vaddagiri wrote: On Wed, Feb 14, 2007 at 10:47:42PM +0300, Oleg Nesterov wrote: for (;;) { - if (cwq-wq-freezeable) + if (cwq-wq-freezeable) { Else? This is wrong. The change like this should start from making all cwq-threads freezeable,

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-16 Thread Oleg Nesterov
On 02/16, Srivatsa Vaddagiri wrote: On Wed, Feb 14, 2007 at 11:22:09PM +0300, Oleg Nesterov wrote: o Splits CPU_DEAD into two events namely - CPU_DEAD: which will be handled while the processes are still frozen. - CPU_DEAD_KILL_THREADS: To be handled after we

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-16 Thread Oleg Nesterov
On 02/16, Srivatsa Vaddagiri wrote: On Fri, Feb 16, 2007 at 12:46:17PM +0530, Srivatsa Vaddagiri wrote: frozen. The only exception is cleaning up of per-cpu threads (which is not possible with processes frozen - if we can find a way to make that possible, then everything can be done in

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-16 Thread Srivatsa Vaddagiri
On Fri, Feb 16, 2007 at 10:46:05PM +0300, Oleg Nesterov wrote: Instead, we can just clear PF_FROZEN before kthread_should_stop(). That should work too. Thanks! I don't claim this is better, but this way we don't need to add a subtle change to process.c. -- Regards, vatsa - To unsubscribe

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-16 Thread Gautham R Shenoy
On Fri, Feb 16, 2007 at 01:42:09PM +0530, Srivatsa Vaddagiri wrote: On Fri, Feb 16, 2007 at 12:46:17PM +0530, Srivatsa Vaddagiri wrote: frozen. The only exception is cleaning up of per-cpu threads (which is not possible with processes frozen - if we can find a way to make that possible,

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-15 Thread Srivatsa Vaddagiri
On Wed, Feb 14, 2007 at 11:22:09PM +0300, Oleg Nesterov wrote: > > o Splits CPU_DEAD into two events namely > > - CPU_DEAD: which will be handled while the processes are still > > frozen. > > > > - CPU_DEAD_KILL_THREADS: To be handled after we thaw_processes. > > > Imho, this

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-15 Thread Srivatsa Vaddagiri
On Wed, Feb 14, 2007 at 10:47:42PM +0300, Oleg Nesterov wrote: > > for (;;) { > > - if (cwq->wq->freezeable) > > + if (cwq->wq->freezeable) { > > Else? This is wrong. The change like this should start from making all > cwq->threads freezeable, otherwise it just doesn't

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-15 Thread Srivatsa Vaddagiri
On Wed, Feb 14, 2007 at 10:47:42PM +0300, Oleg Nesterov wrote: for (;;) { - if (cwq-wq-freezeable) + if (cwq-wq-freezeable) { Else? This is wrong. The change like this should start from making all cwq-threads freezeable, otherwise it just doesn't work. I agree we

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-15 Thread Srivatsa Vaddagiri
On Wed, Feb 14, 2007 at 11:22:09PM +0300, Oleg Nesterov wrote: o Splits CPU_DEAD into two events namely - CPU_DEAD: which will be handled while the processes are still frozen. - CPU_DEAD_KILL_THREADS: To be handled after we thaw_processes. Imho, this is not right.

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-14 Thread Oleg Nesterov
On 02/14, Gautham R Shenoy wrote: > > o Splits CPU_DEAD into two events namely > - CPU_DEAD: which will be handled while the processes are still > frozen. > > - CPU_DEAD_KILL_THREADS: To be handled after we thaw_processes. Imho, this is not right. This change the meaning of

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-14 Thread Oleg Nesterov
Gautham, I'll try to apply this patch and read the code on Sunday, right now a couple of comments about workqueue.c changes. On 02/14, Gautham R Shenoy wrote: > > --- hotplug.orig/kernel/workqueue.c > +++ hotplug/kernel/workqueue.c > @@ -368,6 +368,7 @@ static int worker_thread(void *__cwq) >

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-14 Thread Srivatsa Vaddagiri
On Wed, Feb 14, 2007 at 08:12:29PM +0530, Gautham R Shenoy wrote: > o Can the SYSTEM_RUNNING hack in _cpu_up be avoided by some cleaner means. Basically freeze_processes doesnt seem to work at the early stages of bootup (during smp_init) and hence the hack. One option is to investigate why it

[RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-14 Thread Gautham R Shenoy
This patch implements process_freezer based cpu-hotplug core. The sailent features are: o No more (un)lock_cpu_hotplug. o No more CPU_LOCK_ACQUIRE and CPU_LOCK_RELEASE. Hence no per-subsystem hotcpu mutexes. o Calls freeze_process/thaw_processes at the beginning/end of the hotplug operation.

[RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-14 Thread Gautham R Shenoy
This patch implements process_freezer based cpu-hotplug core. The sailent features are: o No more (un)lock_cpu_hotplug. o No more CPU_LOCK_ACQUIRE and CPU_LOCK_RELEASE. Hence no per-subsystem hotcpu mutexes. o Calls freeze_process/thaw_processes at the beginning/end of the hotplug operation.

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-14 Thread Srivatsa Vaddagiri
On Wed, Feb 14, 2007 at 08:12:29PM +0530, Gautham R Shenoy wrote: o Can the SYSTEM_RUNNING hack in _cpu_up be avoided by some cleaner means. Basically freeze_processes doesnt seem to work at the early stages of bootup (during smp_init) and hence the hack. One option is to investigate why it

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-14 Thread Oleg Nesterov
Gautham, I'll try to apply this patch and read the code on Sunday, right now a couple of comments about workqueue.c changes. On 02/14, Gautham R Shenoy wrote: --- hotplug.orig/kernel/workqueue.c +++ hotplug/kernel/workqueue.c @@ -368,6 +368,7 @@ static int worker_thread(void *__cwq)

Re: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core

2007-02-14 Thread Oleg Nesterov
On 02/14, Gautham R Shenoy wrote: o Splits CPU_DEAD into two events namely - CPU_DEAD: which will be handled while the processes are still frozen. - CPU_DEAD_KILL_THREADS: To be handled after we thaw_processes. Imho, this is not right. This change the meaning of