Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-20 Thread Pavel Machek
On Mon 2007-03-12 17:58:05, Paul E. McKenney wrote: > On Mon, Mar 12, 2007 at 11:39:06PM +0100, Pavel Machek wrote: > > Hi! > > > > > > > Looks good to me! The other kthread_should_stop() calls in > > > > > rcutorture.c should also become > > > > > kthread_should_top_check_freeze(). > > > > > >

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-20 Thread Pavel Machek
Hi! > > Do not do it, then. Confusion it causes is not worth saving one line > > of code. > > > > You do less typing, but the resulting code is _less_ readable, not > > more. > > Then please document it _clearly_ with the kthread code somewhere. The > reason I brought this up is I had no idea

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-20 Thread Pavel Machek
Hi! Do not do it, then. Confusion it causes is not worth saving one line of code. You do less typing, but the resulting code is _less_ readable, not more. Then please document it _clearly_ with the kthread code somewhere. The reason I brought this up is I had no idea we had to put

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-20 Thread Pavel Machek
On Mon 2007-03-12 17:58:05, Paul E. McKenney wrote: On Mon, Mar 12, 2007 at 11:39:06PM +0100, Pavel Machek wrote: Hi! Looks good to me! The other kthread_should_stop() calls in rcutorture.c should also become kthread_should_top_check_freeze(). Why is it useful?

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-17 Thread Paul E. McKenney
On Mon, Mar 12, 2007 at 11:39:06PM +0100, Pavel Machek wrote: > Hi! > > > > > Looks good to me! The other kthread_should_stop() calls in > > > > rcutorture.c should also become > > > > kthread_should_top_check_freeze(). > > > > Why is it useful? > > > > Because we want to avoid repeating > >

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-17 Thread Paul E. McKenney
On Mon, Mar 12, 2007 at 11:39:06PM +0100, Pavel Machek wrote: Hi! Looks good to me! The other kthread_should_stop() calls in rcutorture.c should also become kthread_should_top_check_freeze(). Why is it useful? Because we want to avoid repeating while

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-13 Thread Christoph Hellwig
On Tue, Mar 13, 2007 at 03:28:08PM +0530, Srivatsa Vaddagiri wrote: > On Tue, Mar 13, 2007 at 09:16:29AM +, Christoph Hellwig wrote: > > > Document as well in the kernel_thread() API, as I notice people still > > > use kernel_thread() some places (ex: rtasd.c in powerpc arch)? > > > > They

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-13 Thread Srivatsa Vaddagiri
On Tue, Mar 13, 2007 at 09:16:29AM +, Christoph Hellwig wrote: > > Document as well in the kernel_thread() API, as I notice people still > > use kernel_thread() some places (ex: rtasd.c in powerpc arch)? > > They shouldn't use kernel_thread. Hmm ..that needs to be documented as well then! I

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-13 Thread Christoph Hellwig
On Tue, Mar 13, 2007 at 08:44:11AM +0530, Srivatsa Vaddagiri wrote: > On Mon, Mar 12, 2007 at 05:45:24PM -0500, Anton Blanchard wrote: > > Then please document it _clearly_ with the kthread code somewhere. > > Document as well in the kernel_thread() API, as I notice people still > use

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-13 Thread Christoph Hellwig
On Tue, Mar 13, 2007 at 08:44:11AM +0530, Srivatsa Vaddagiri wrote: On Mon, Mar 12, 2007 at 05:45:24PM -0500, Anton Blanchard wrote: Then please document it _clearly_ with the kthread code somewhere. Document as well in the kernel_thread() API, as I notice people still use kernel_thread()

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-13 Thread Srivatsa Vaddagiri
On Tue, Mar 13, 2007 at 09:16:29AM +, Christoph Hellwig wrote: Document as well in the kernel_thread() API, as I notice people still use kernel_thread() some places (ex: rtasd.c in powerpc arch)? They shouldn't use kernel_thread. Hmm ..that needs to be documented as well then! I can

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-13 Thread Christoph Hellwig
On Tue, Mar 13, 2007 at 03:28:08PM +0530, Srivatsa Vaddagiri wrote: On Tue, Mar 13, 2007 at 09:16:29AM +, Christoph Hellwig wrote: Document as well in the kernel_thread() API, as I notice people still use kernel_thread() some places (ex: rtasd.c in powerpc arch)? They shouldn't use

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-12 Thread Srivatsa Vaddagiri
On Tue, Mar 13, 2007 at 10:57:16AM +0530, Gautham R Shenoy wrote: > CPU_DEAD: > thaw_process(p); > kthread_stop(p); > p = NULL; This neednt guarantee that the thread will see the stop request before it exits the kthread_should_stop_freeze() function. There will always be races .. So the only safe

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-12 Thread Gautham R Shenoy
On Sun, Mar 11, 2007 at 06:49:08PM +0100, Rafael J. Wysocki wrote: > On Saturday, 3 March 2007 18:32, Oleg Nesterov wrote: > > On 03/02, Paul E. McKenney wrote: > > > > > > On Sat, Mar 03, 2007 at 02:33:37AM +0300, Oleg Nesterov wrote: > > > > On 03/02, Paul E. McKenney wrote: > > > > > > > > > >

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-12 Thread Srivatsa Vaddagiri
On Mon, Mar 12, 2007 at 05:45:24PM -0500, Anton Blanchard wrote: > Then please document it _clearly_ with the kthread code somewhere. Document as well in the kernel_thread() API, as I notice people still use kernel_thread() some places (ex: rtasd.c in powerpc arch)? > The reason I brought this

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-12 Thread Anton Blanchard
> Do not do it, then. Confusion it causes is not worth saving one line > of code. > > You do less typing, but the resulting code is _less_ readable, not > more. Then please document it _clearly_ with the kthread code somewhere. The reason I brought this up is I had no idea we had to put the

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-12 Thread Pavel Machek
Hi! > > > Looks good to me! The other kthread_should_stop() calls in > > > rcutorture.c should also become > > > kthread_should_top_check_freeze(). > > Why is it useful? > > Because we want to avoid repeating > > while (!kthread_should_stop()) { > try_to_freeze(); > ... > } > >

Re: [PATCH] kthread_should_stop_check_freeze

2007-03-12 Thread Rafael J. Wysocki
On Monday, 12 March 2007 14:24, Cedric Le Goater wrote: > Oleg Nesterov wrote: > > On 03/12, Rafael J. Wysocki wrote: > >> On Monday, 12 March 2007 09:14, Pavel Machek wrote: > >>> Can we get better name for this function? > >> Well, I took the name from the Oleg's message. Can you please suggest

Re: [PATCH] kthread_should_stop_check_freeze

2007-03-12 Thread Cedric Le Goater
Oleg Nesterov wrote: > On 03/12, Rafael J. Wysocki wrote: >> On Monday, 12 March 2007 09:14, Pavel Machek wrote: >>> Can we get better name for this function? >> Well, I took the name from the Oleg's message. Can you please suggest >> something? > > Well, kthread_should_stop_check_freeze() is

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-12 Thread Oleg Nesterov
On 03/12, Rafael J. Wysocki wrote: > > On Monday, 12 March 2007 09:14, Pavel Machek wrote: > > > > Can we get better name for this function? > > Well, I took the name from the Oleg's message. Can you please suggest > something? Well, kthread_should_stop_check_freeze() is really awful, I agree

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-12 Thread Rafael J. Wysocki
Hi, On Monday, 12 March 2007 09:14, Pavel Machek wrote: > Hi! > > > > > I personally think we should do the opposite, add > > > > kthread_should_stop_check_freeze() > > > > or something. kthread_should_stop() is like signal_pending(), we can use > > > > it under spin_lock (and it is probably

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-12 Thread Pavel Machek
Hi! > > > I personally think we should do the opposite, add > > > kthread_should_stop_check_freeze() > > > or something. kthread_should_stop() is like signal_pending(), we can use > > > it under spin_lock (and it is probably used this way by some out-of-tree > > > driver). The new helper is

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-12 Thread Pavel Machek
Hi! I personally think we should do the opposite, add kthread_should_stop_check_freeze() or something. kthread_should_stop() is like signal_pending(), we can use it under spin_lock (and it is probably used this way by some out-of-tree driver). The new helper is obviously

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-12 Thread Rafael J. Wysocki
Hi, On Monday, 12 March 2007 09:14, Pavel Machek wrote: Hi! I personally think we should do the opposite, add kthread_should_stop_check_freeze() or something. kthread_should_stop() is like signal_pending(), we can use it under spin_lock (and it is probably used this way by

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-12 Thread Oleg Nesterov
On 03/12, Rafael J. Wysocki wrote: On Monday, 12 March 2007 09:14, Pavel Machek wrote: Can we get better name for this function? Well, I took the name from the Oleg's message. Can you please suggest something? Well, kthread_should_stop_check_freeze() is really awful, I agree :) We

Re: [PATCH] kthread_should_stop_check_freeze

2007-03-12 Thread Cedric Le Goater
Oleg Nesterov wrote: On 03/12, Rafael J. Wysocki wrote: On Monday, 12 March 2007 09:14, Pavel Machek wrote: Can we get better name for this function? Well, I took the name from the Oleg's message. Can you please suggest something? Well, kthread_should_stop_check_freeze() is really awful,

Re: [PATCH] kthread_should_stop_check_freeze

2007-03-12 Thread Rafael J. Wysocki
On Monday, 12 March 2007 14:24, Cedric Le Goater wrote: Oleg Nesterov wrote: On 03/12, Rafael J. Wysocki wrote: On Monday, 12 March 2007 09:14, Pavel Machek wrote: Can we get better name for this function? Well, I took the name from the Oleg's message. Can you please suggest something?

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-12 Thread Pavel Machek
Hi! Looks good to me! The other kthread_should_stop() calls in rcutorture.c should also become kthread_should_top_check_freeze(). Why is it useful? Because we want to avoid repeating while (!kthread_should_stop()) { try_to_freeze(); ... } in many places? Do

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-12 Thread Anton Blanchard
Do not do it, then. Confusion it causes is not worth saving one line of code. You do less typing, but the resulting code is _less_ readable, not more. Then please document it _clearly_ with the kthread code somewhere. The reason I brought this up is I had no idea we had to put the freezer

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-12 Thread Srivatsa Vaddagiri
On Mon, Mar 12, 2007 at 05:45:24PM -0500, Anton Blanchard wrote: Then please document it _clearly_ with the kthread code somewhere. Document as well in the kernel_thread() API, as I notice people still use kernel_thread() some places (ex: rtasd.c in powerpc arch)? The reason I brought this up

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-12 Thread Gautham R Shenoy
On Sun, Mar 11, 2007 at 06:49:08PM +0100, Rafael J. Wysocki wrote: On Saturday, 3 March 2007 18:32, Oleg Nesterov wrote: On 03/02, Paul E. McKenney wrote: On Sat, Mar 03, 2007 at 02:33:37AM +0300, Oleg Nesterov wrote: On 03/02, Paul E. McKenney wrote: One way to embed

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-12 Thread Srivatsa Vaddagiri
On Tue, Mar 13, 2007 at 10:57:16AM +0530, Gautham R Shenoy wrote: CPU_DEAD: thaw_process(p); kthread_stop(p); p = NULL; This neednt guarantee that the thread will see the stop request before it exits the kthread_should_stop_freeze() function. There will always be races .. So the only safe way

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-11 Thread Paul E. McKenney
On Sun, Mar 11, 2007 at 06:49:08PM +0100, Rafael J. Wysocki wrote: > On Saturday, 3 March 2007 18:32, Oleg Nesterov wrote: > > On 03/02, Paul E. McKenney wrote: > > > > > > On Sat, Mar 03, 2007 at 02:33:37AM +0300, Oleg Nesterov wrote: > > > > On 03/02, Paul E. McKenney wrote: > > > > > > > > > >

[PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-11 Thread Rafael J. Wysocki
On Saturday, 3 March 2007 18:32, Oleg Nesterov wrote: > On 03/02, Paul E. McKenney wrote: > > > > On Sat, Mar 03, 2007 at 02:33:37AM +0300, Oleg Nesterov wrote: > > > On 03/02, Paul E. McKenney wrote: > > > > > > > > One way to embed try_to_freeze() into kthread_should_stop() might be > > > > as

[PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-11 Thread Rafael J. Wysocki
On Saturday, 3 March 2007 18:32, Oleg Nesterov wrote: On 03/02, Paul E. McKenney wrote: On Sat, Mar 03, 2007 at 02:33:37AM +0300, Oleg Nesterov wrote: On 03/02, Paul E. McKenney wrote: One way to embed try_to_freeze() into kthread_should_stop() might be as follows:

Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread)

2007-03-11 Thread Paul E. McKenney
On Sun, Mar 11, 2007 at 06:49:08PM +0100, Rafael J. Wysocki wrote: On Saturday, 3 March 2007 18:32, Oleg Nesterov wrote: On 03/02, Paul E. McKenney wrote: On Sat, Mar 03, 2007 at 02:33:37AM +0300, Oleg Nesterov wrote: On 03/02, Paul E. McKenney wrote: One way to embed