Messages in this thread | | | From | Roland McGrath <> | Subject | Re: [PATCH 2/3] ptrace_untrace: use wake_up_process() instead of bogus signal_wake_up() | Date | Sun, 8 Feb 2009 19:42:55 -0800 (PST) |
| |
> We are holding ->siglock, and task->state is TASK_TRACED. We can not do > the "wrong" wakeup, afaics.
I guess that's true with the siglock. But you'd be wrong to think that this sort of detailed thinking is why wake_up_process() appears *anywhere at all* in ptrace-related code. I'm really quite sure that it's the aforementioned (ancient) lack of detailed thinking about it that led to wake_up_process() appearing originally--so any use of it reminds us of that dubious past.
> Because it complicates the understanding of this code. I spent a lot > of time trying to understand this signal_wake_up(). > > Perhaps this is just me. But when you see the code which does something, > it is always good to understand the reason, otherwise the code at least > looks wrong.
I had presumed most people interpret it the way I do: it does signal_wake_up(,1), meaning "whatever it is that works right for SIGKILL or SIGCONT", which it seems intuitive to think is right for this case too. You don't have to think about exactly what is always exactly right for this case, because it makes sense to think that this is like the wakeup that SIGCONT would do. To me, it takes much more thought to be convinced that wake_up_process() without other considerations is correct here--because it looks like such a scary, unconditional thing, whereas normally that is wrapped up inside calls that handle appropriate bookkeeping--signal_wake_up() being one of those.
Thanks, Roland
| |