Re: [PATCH] Don't apply for write lock on tasklist_lock if parentdoesn't ptrace other processes

From: David Rientjes
Date: Thu Jul 15 2010 - 15:53:56 EST


On Thu, 15 Jul 2010, Zhang, Yanmin wrote:

> We run some sub-cases (fork, exec, pipe, tcp, udp) of aim7 on 8-socket machine.
> Perf shows write_lock_irq(&tasklist_lock) consumes more than 50% cpu time.
>
> One hot caller is exit_ptrace. If the exiting process doesn't ptrace other
> processes, kernel needn't apply for the write lock on tasklist_lock.
>
> With below patch against kernel 2.6.35-rc5, we get more than 10% result improvement.
>
> Signed-off-by: Zhang Yanmin <yanmin_zhang@xxxxxxxxxxxxxxx>

Acked-by: David Rientjes <rientjes@xxxxxxxxxx>

We're guarded against ptrace_attach() because tracer->exit_state is
non-zero at this point in the exit path.
--
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/