Paolo Mantegazza wrote:
[...]
void cleanup_module(void)
{
rt_sem_delete(&sem);
rt_printk("SEM DELETED\n");
set_cpus_allowed(current, cpumask_of_cpu(task.runnable_on_cpus));
if (task.magic) {
rt_task_delete(&task);
Well, what is the difference between this application-level check and
the one performed in clr_rtext
(http://www.rts.uni-hannover.de/rtai/lxr/source/rtai-core/sched/rtai/sched_lxrt.c?v=cvs-stable-vesuvio#L977)?
I do not yet consider this as a solution, at best it's a workaround.
Sorry, I simply hate kernel oopses when I don't understand their real
reason (and potential side effects).
It is a workaround. The difference is in the serialisation caused by
moving the process doing the cleanup to the CPU of the dying task.
Sorry to bother again: Doesn't work on UP (tested and failed). This
means that task.magic is not cleared (yet?) when I check it in
module_cleanup. And I guess this is also the core of the problem.
If there is no simple way to ensure that my scenario cannot cause a
crash, I would suggest to fall back to 3.1's behaviour. From my point of
view, return some error code due to a slight semantic change is better
then risking crashes while trying to recreate old way (at least RTnet
can live with the 3.1 way).
Jan