Why does exit_notify() block interrupts?

From: Jun Sun (jsun@mvista.com)
Date: Fri Mar 10 2000 - 18:31:44 EST


I am doing some interrupt latency measurement, and discovered
a bottleneck in kernel/exit.c file. See the code excerption below.

Clearly the interrupt blocking time is a linear function of
the number of the child processes. In my particular test,
the exiting process has about 400 child processes and causes
long blocking time.

Why does this code has to block interrupt? It appears

1) no interrupt handling routines would refer the data modified here.

2) similiar modifications happened elsewhere (such as in
   forget_original_parent())
   only the non-interrupt blocking version is used. In fact,
   read_lock() is used.

I modified the write_lock_irq() to write_lock(), and the kernel seems
to be running fine, at least with all my tests.

Any thoughts?

Jun

-----------------
kernel/exit.c

static void exit_notify(void)
{
        ....
        write_lock_irq(&tasklist_lock);
        while (current->p_cptr != NULL) {
                p = current->p_cptr;
                current->p_cptr = p->p_osptr;
                p->p_ysptr = NULL;
                p->flags &= ~(PF_PTRACED|PF_TRACESYS);

                ...
        }
        write_unlock_irq(&tasklist_lock);

        if (current->leader)
                disassociate_ctty(1);
}

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



This archive was generated by hypermail 2b29 : Wed Mar 15 2000 - 21:00:18 EST