From: Daniel Jacobowitz <dan@debian.org>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Roland McGrath <roland@redhat.com>,
Ingo Molnar <mingo@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: another subtle signals issue
Date: Tue, 11 Feb 2003 22:05:27 -0500 [thread overview]
Message-ID: <20030212030527.GA15854@nevyn.them.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0302111833120.2667-100000@home.transmeta.com>
On Tue, Feb 11, 2003 at 06:45:19PM -0800, Linus Torvalds wrote:
>
> On Tue, 11 Feb 2003, Roland McGrath wrote:
> >
> > I think sys_semop would be closer to right if it used ERESTARTSYS instead
> > of EINTR.
>
> You probably mean ERESTARTSYSNOHAND.
>
> There are lots of system calls that simply are not restartable. So
> TIF_SIGPENDING in general should be set only if required, and not "because
> it's easier".
>
> > The reason I am concerned about this is that I think any case that is
> > broken by the lack of the optimization in the patch below must also be
> > broken vis a vis the semantics of stop signals and SIGCONT (when SIG_DFL,
> > SIG_IGN, or blocked). POSIX says that when a process is stopped by
> > e.g. SIGSTOP, and then continued by SIGCONT, any functions that were in
> > progress at the time of stop are unaffected unless SIGCONT runs a handler.
> > That is, nobody returns EINTR because of the stop/continue.
>
> This is what ERESTARTNOHAND does, but quite often if you get interrupted
> you have to return _partial_ results, which is quite inefficient and
> sometimes breaks programs (ie you get things like a read() from a pipe
> that returns a partial result because you resized the window, and a
> SIGWINCH happened - and that is _bad_).
>
> The old code tried rather hard to make signals that were truly ignored
> (SIGSTOP/SIGCONT is not of that kind) be total non-events because of
> things like this.
For things with a timeout, shouldn't they be converted to use
ERESTART_RESTARTBLOCK? The situation Roland is describing is just
about the same as the original problem with nanosleep.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2003-02-12 2:58 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.44.0302111356550.1405-100000@penguin.transmeta.com>
2003-02-12 2:06 ` Roland McGrath
2003-02-12 2:45 ` Linus Torvalds
2003-02-12 3:05 ` Daniel Jacobowitz [this message]
2003-02-12 3:10 ` Linus Torvalds
2003-02-12 3:23 ` Roland McGrath
2003-02-12 3:38 ` Linus Torvalds
2003-02-12 3:13 ` Roland McGrath
2003-02-12 3:18 ` Linus Torvalds
2003-02-12 3:50 ` Roland McGrath
2003-02-12 4:21 ` Linus Torvalds
2003-02-12 20:12 ` Linus Torvalds
2003-02-12 21:11 ` Roland McGrath
2003-02-12 21:19 ` Linus Torvalds
2003-02-12 21:58 ` Roland McGrath
2003-02-12 21:42 ` Linus Torvalds
2003-02-12 22:04 ` Roland McGrath
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030212030527.GA15854@nevyn.them.org \
--to=dan@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=roland@redhat.com \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®