mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Smith <paul@mad-scientist.net>
To: Olivier Galibert <galibert@pobox.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	linux-kernel@vger.kernel.org, stable@kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Andi Kleen <andi@firstfloor.org>, Oleg Nesterov <oleg@redhat.com>,
	Roland McGrath <roland@redhat.com>
Subject: Re: [PATCH] coredump: Retry writes where appropriate
Date: Sun, 31 May 2009 12:56:22 -0400	[thread overview]
Message-ID: <1243788982.7369.370.camel@homebase.localnet> (raw)
In-Reply-To: <20090531140354.GA92675@dspnet.fr.eu.org>

On Sun, 2009-05-31 at 16:03 +0200, Olivier Galibert wrote:
> On Sun, May 31, 2009 at 11:18:51AM +0100, Alan Cox wrote:
> > On Sun, 31 May 2009 01:33:39 -0400
> > Paul Smith <paul@mad-scientist.net> wrote:
> > 
> > > coredump: Retry writes where appropriate
> > > 
> > > Core dump write operations (especially to a pipe) can be incomplete due
> > > to signal reception or possibly recoverable partial writes.
> > 
> > NAK this
> > 
> > > Previously any incomplete write in the ELF core dumper caused the core
> > > dump to stop, giving short cores in these cases.  Modify the core dumper
> > > to retry the write where appropriate.
> > 
> > The existing behaviour is an absolute godsend when you've something like
> > a core dump stuck on an NFS mount or something trying to core dump to
> > very slow media.
> > 
> > In fact the signals checks were *purposefully added* some time ago.

This is what Olivier mentioned as well, and I do see the benefit in
being able to get rid of hung up coredumps.  But to me it's more
important to have reliable and robust coredumping, and I'm getting
reports of short cores on my systems at least once a week due to this
problem (the userspace applications I'm working with use signals for
certain well-defined situations, that tend to happen at around the same
time as you might expect core dumps).

> Perhaps removing the "|| r == -EINTR" part would make both of you
> happy?  He gets the reliability on pipes, you keep the interrupt on
> signals.

I'm getting back ERESTARTSYS in my environment, and it's happening
because pipe_write() detects a signal pending.  I don't think this is
due to SIGPIPE, and I'm not sure that removing EINTR will give Alan the
behavior he is looking for.

Another possibility would be to examine the signal itself and don't
retry if it's SIGKILL.  I'm too much of a kernel hacking noob to know
offhand how to find the pending signal but I can certainly figure it
out.  If it's possible, Alan, would that be an acceptable alternative?

I'm not entirely happy with this because, as was discussed in an earlier
thread, there are plenty of common idioms where you can expect to
receive a SIGKILL while you're in the middle of dumping core (lots of
userspace setups will send a few HUPs, followed by a few INTs, and if
the process is still there they send KILLs).  However, for my specific
purposes this would be sufficient.

Other ideas?

  parent reply	other threads:[~2009-05-31 16:56 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-31  5:33 Paul Smith
2009-05-31 10:18 ` Alan Cox
2009-05-31 14:03   ` Olivier Galibert
2009-05-31 16:31     ` Alan Cox
2009-05-31 16:49       ` Olivier Galibert
2009-05-31 17:46       ` Paul Smith
2009-05-31 16:56     ` Paul Smith [this message]
2009-06-01 16:12   ` Oleg Nesterov
2009-06-01 16:41     ` Alan Cox
2009-06-01 17:11       ` Oleg Nesterov
2009-06-01 17:46         ` Alan Cox
2009-06-01 18:23           ` Oleg Nesterov
2009-06-01 20:38             ` Roland McGrath
2009-06-01 22:32               ` Oleg Nesterov
2009-06-01 23:02                 ` Roland McGrath
2009-06-02  0:08                   ` Oleg Nesterov
2009-06-03  7:09                     ` Roland McGrath
2009-06-04  3:15                       ` Oleg Nesterov
2009-06-04 17:14                         ` Roland McGrath
2009-06-23 17:31                           ` Paul Smith
2009-06-23 19:37                             ` Oleg Nesterov
2009-07-07 19:37                               ` Oleg Nesterov
2009-06-02  8:21                 ` Alan Cox
2009-06-02 15:29                   ` Oleg Nesterov
2009-06-03  7:15                     ` Roland McGrath
2009-06-03 14:05               ` Paul Smith
2009-06-01 17:36     ` Paul Smith
2009-06-01 17:49       ` Alan Cox
2009-06-01 18:39         ` Paul Smith
2009-06-01 19:02           ` Alan Cox
2009-06-01 19:09             ` Andi Kleen
2009-06-01 19:06               ` Alan Cox
2009-06-01 19:14                 ` Andi Kleen
2009-06-01 19:51             ` Paul Smith
2009-06-01 20:20               ` Oleg Nesterov
2009-06-01 21:34               ` Alan Cox

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=1243788982.7369.370.camel@homebase.localnet \
    --to=paul@mad-scientist.net \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=andi@firstfloor.org \
    --cc=galibert@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=roland@redhat.com \
    --cc=stable@kernel.org \
    /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

Powered by JetHome