Re: + make-get_user_pages-interruptible.patch added to -mm tree

From: Oleg Nesterov
Date: Tue Dec 02 2008 - 08:28:28 EST


On 12/01, Ying Han wrote:
>
> On Mon, Dec 1, 2008 at 3:09 PM, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > Note that fatal_signal_pending() is not an exact replacement for
> > sigkill_pending() - fatal_signal_pending() doesn't test the shared
> > pending signals.
> >
> yeah, i noticed that and that is why i used the sigkill_pending
> initially. But after a deeper look
> at the signal code, i found for SIGKILL ( signal we care about in this
> patch ), tsk->pending is a
> superset of tsk->signal->shared_pending.

Yes. If we have SIGKILL in ->shared_pending, we must have it in
in ->pending too.

The only exception is when we send SIGKILL to the already dying task
which has already dequeued SIGKILL from ->pending. And we do have a
special case: coredumping. elf_core_dump() does get_user_pages()
when the process is "almost" dead, it has SIGNAL_GROUP_EXIT.

So, if get_user_pages() calls sigkill_pending() instead of
fatal_signal_pending(), this can help. But:

- this relies on the fact that we always queue SIGKILL
even if the task is dead. This behaviour can be changed.

- this doesn't stop the coredumping, it will continue
with DUMP_SEEK(). Yes, this is better if we want to
stop this thread to populate the memory, but I think
we should just fix the coredumping - it should be
interruptible.

Actually, the patch exists:
http://marc.info/?l=linux-kernel&m=121665710711931

Oleg.

--
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/