[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111026185838.GA24358@redhat.com>
Date: Wed, 26 Oct 2011 20:58:38 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Russell King <rmk@....linux.org.uk>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Srikar Dronamraju <srikar@...ux.vnet.ibm.com>,
Peter Zijlstra <peterz@...radead.org>,
"H. Peter Anvin" <hpa@...or.com>,
Steven Rostedt <rostedt@...dmis.org>,
Christoph Hellwig <hch@...radead.org>,
Ananth N Mavinakayanahalli <ananth@...ibm.com>,
Thomas Gleixner <tglx@...utronix.de>,
Andi Kleen <andi@...stfloor.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Jim Keniston <jkenisto@...ux.vnet.ibm.com>,
Roland McGrath <roland@...k.frob.com>,
Shuah Khan <shuah.khan@...com>, Ingo Molnar <mingo@...e.hu>,
Alexander van Heukelum <heukelum@...tmail.fm>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [RESEND] [RFC][PATCH X86_32 1/2]: Call do_notify_resume() with
interrupts enabled
On 10/26, Russell King wrote:
>
> I've been toying with a similar patch for ARM, but I keep feeling uneasy
> about having interrupts enabled in this path (even though they get enabled
> in the depths of the signal handling code.)
>
> I worry about are race condition like the following:
>
> syscall enter
> ...
> syscall returns -ERESTARTNOHAND
> check for signal
> signal pending, but no handler, setup for restart
> interrupt happens, sets need_resched
> need_resched set
> switch to another thread
> ...
> something happens which queues SIGIO
> switch back to this thread
I don't understand how "interrupts disabled" can help... A signal
can come without preempt_schedule().
> check for signal
> signal pending, has handler, but we've setup for a restart
> return to userspace
> run SIGIO handler
> restart syscall
>
> This feels like it violates the expectations of the syscall being
> restarted - which explicitly asks to be restarted only if there wasn't
> a handler run.
But this doesn't differ from the case when this signal comes after
the sycall was already restarted?
> However, that doesn't solve the (probably unsolvable) case where an
> ERESTARTSYS syscall is interrupted by a SA_RESTART-marked handler, and
> while that handler is running it is then interrupted by a non-SA_RESTART-
> marked handler. I think that is far too an obscure case to care about
> though.
If I understand correctly, this was already discussed:
Re: HR timers prevent an itimer from generating EINTR?
http://marc.info/?l=linux-kernel&m=125384722012869
Unfortunately, marc.info doesn't show the authoritative reply from
Roland, but he agreed with "not a problem".
Or I misunderstood?
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists