Re: send_sig_info() in __switch_to() Ok or not?

From: Andi Kleen
Date: Sun Aug 24 2003 - 16:58:47 EST


Mikael Pettersson <mikpe@xxxxxxxxx> writes:

> I have a kernel extension (the x86 perfctr driver) that needs,
> in a specific but unlikely case(*), to send a SIGILL to current
> (next) in __switch_to(). Is this permitted or not?
>
> I suspect it might not be because send_sig_info() eventually does
> wake_up_process_kick(), and there's this warning in __switch_to()
> not to call printk() since it calls wake_up()...

> If I can't call send_sig_info() in __switch_to(), is there
> another way to post a SIGILL to current from __switch_to()?

You can just do it manually. Fill in the signal in the signal
mask of the process. The next time the process checks for signals it will
kill itself. As it is already running or going to run it doesn't need
a wake up.

You could also forcibly call do_exit with the right signal, but
that cannot be blocked.

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