Re: [PATCH] taskstats: fix sub-threads accounting

From: Oleg Nesterov
Date: Tue Oct 31 2006 - 09:31:47 EST


On 10/30, Shailabh Nagar wrote:
>
> Oleg Nesterov wrote:
> >
> >Q: We don't send TASKSTATS_TYPE_AGGR_TGID when single-threaded process
> >exits. Is it good? How can the listener figure out that it was actually
> >a process exit, not sub-thread?
>
> We had a detailed discussion on this on lkml earlier. The overhead of
> sending essentially the same data twice (once as AGGR_TGID and once as
> PID) was deemed too heavy esp. as the taskstats structure size grew.
> Also, single threaded exit is a common case.
>
> Using process events, its possible for user space to distinguish single
> threaded process exits.

Ok, I see.

The taskstats's code is very clean and understandable, the only thing
I can't get is: why these listeners are per-cpu? It is very easy to add
'int exited_on_this_cpu' to struct taskstats.

Probaly this was done to filter out unneeded events (cpusets) ? In that
case it seems better to add cpumask_t to 'struct listener' but have a
single listener_array list.

Thanks!

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/