[lkml]   [2012]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [RFC] TIF_NOTIFY_RESUME, arch/*/*/*signal*.c and all such
On 04/25, Al Viro wrote:
> do_signal()
> {
> if (we have any business doing restarts)
> // note: we won't get here on subsequent calls of do_signal()
> // due to the checks above; same logics that currently prevents
> // double restarts
> set NEED_RESTART flag
> sig = get_signal_to_deliver(...)
> if (sig) {
> if (NEED_RESTART set) {
> same thing we do at that spot now - restart or EINTR
> handle_signal(...)
> ...
> return;
> }
> }
> /* no handler */
> if (test_and_clear_...(RESTORE_SIGMASK))
> set_current_blocked(&current->saved_sigmask);
> }


> and in asm glue,

Ah. So we are going to change the ret_from_sys_call-like code.

> check
> NEED_RESTART and if it's set do what we currently do for restarts on
> handlerless signal.

and probably we should clear NEED_RESTART?

OK, thanks, I am starting to understand.

However. Perhaps I missed something, but this doesn't look 100% correct.
Although even _if_ I am right I guess this is pure theoretical problem.

Suppose that we restart the syscall which returned ERESTARTNOHAND. I mean,
the task has already returned to the user-mode and CPU is going to execute
the syscall insn.

What if, say, reschedule interrupt comes before the task enters the kernel
again? The new signal can come before this task returns to the user-mode,
ret_from_intr: will notice it and it is still possible to run a signal
handler before re-entering the syscall.



 \ /
  Last update: 2012-04-26 15:31    [W:0.157 / U:2.196 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site