Messages in this thread | | | From | Rusty Russell <> | Subject | Re: [PATCH 3/4] kthreads: rework kthread_stop() | Date | Thu, 5 Feb 2009 11:33:58 +1030 |
| |
On Thursday 05 February 2009 02:29:35 Eric W. Biederman wrote: > Rusty Russell <rusty@rustcorp.com.au> writes: > > Clever? Sure. Neat? Yes. > > > > But you are using a definition of obvious with which I was not previously > > familiar :) ... > Now Rusty I don't know about you but after I learned to do > addition and subtraction it has always been obvious to me that > one is the opposite of the other.
It is *not* obvious that the offset must be constant across all kthreads. On all architectures, and always will be. That noone will *ever* put a variable-size object on the stack in this code path.
I *think* it's true, but I've been surprised before.
> I am slightly concerned that using task_stack_page(tsk) may be > overly clever, but compared to ACCESS_ONCE(), memory barriers, > or not letting kthread_stop be called on a thread that may exit > I think I am ahead of the game.
Absolutely agreed. Just humor me please and put a BUG_ON in there :)
Thanks, Rusty.
| |