Re: [PATCH 1/3] coredump: introduce dump_interrupted()

From: Andrew Morton
Date: Fri Mar 08 2013 - 16:20:51 EST


On Fri, 8 Mar 2013 18:59:15 +0100 Oleg Nesterov <oleg@xxxxxxxxxx> wrote:

> Change dump_write(), dump_seek() and do_coredump() to check
> signal_pending() and abort if it is true.

hm, why.

I think we're missing some context here - this is to support freezing,
yes? There's some undescribed interaction between the freezer and the
core-dumper which is being fixed?

IOW, can we please have the high-level overview of what this patchset
is trying to achieve?



An example of why this is needed: the dump_interrupted() check which
was added to dump_seek() is just weird. An lseek is instantaneous, so
why do we need to bother checking for signals there if the caller will
be checking one microsecond later anyway??

And if the file doesn't support lseek (do such files exist? should we
be returning 0 instead of -ENOMEM?), we just sit there in a loop
extending the file with write(). This can take *ages*, but this part
of dump_seek() *didn't* get the signal check!

So it makes no sense at all. If we had that what-Oleg-is-trying-to-do
text then perhaps others could understand all of this?

> We add the new trivial helper, dump_interrupted(), to document that
> this probably needs more work and to simplify the potential freezer
> changes. Perhaps it will have more callers.
>
> Ideally it should do try_to_freeze() but then we need the unpleasant
> changes in dump_write() and wait_for_dump_helpers(). So far we simply
> accept the fact that the freezer can truncate a core-dump but at least
> you can reliably suspend.

OK, so there is some connection between this and suspending. Details,
please...

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/